init
All checks were successful
Deploy to Production / deploy (push) Successful in 17s

This commit is contained in:
梁朝伟 2024-11-14 16:06:13 +08:00
parent ece6b274d7
commit 0c62637702
4 changed files with 15 additions and 13 deletions

View File

@ -12,7 +12,7 @@ max_line_length = 150
[*.md] [*.md]
trim_trailing_whitespace = false trim_trailing_whitespace = false
[*.{yml,yaml,js,html,css,scss}] [*.{yml,yaml,js,html,css,scss,less}]
indent_size = 2 indent_size = 2
[docker-compose.yml] [docker-compose.yml]

View File

@ -22,7 +22,9 @@ public function testdrive(Request $request)
$this->validate($request, $rules); $this->validate($request, $rules);
$requestId = Str::uuid(); $requestId = Str::uuid();
$request->merge(['request_id' => $requestId]); $request->merge(['request_id' => $requestId]);
(new TestdriveCreateAction())->execute($request);
$model = (new TestdriveCreateAction())->execute($request);
// TestdrivePushJob::dispatch($model);
return response()->json(['code' => 0, 'message' => '提交成功', 'request_id' => $requestId]); return response()->json(['code' => 0, 'message' => '提交成功', 'request_id' => $requestId]);
} }

View File

@ -21,12 +21,12 @@ public function __construct(protected Testdrive $model) {}
public function handle(): void public function handle(): void
{ {
try { // try {
$this->sendNotification(); // $this->sendNotification();
$this->model->update(['status' => Testdrive::STATUS_PUBLISHED]); // $this->model->update(['status' => Testdrive::STATUS_PUBLISHED]);
} catch (\Exception $e) { // } catch (\Exception $e) {
info('===== TestdrivePushJob::handle exception', ['message' => $e->getMessage()]); // info('===== TestdrivePushJob::handle exception', ['message' => $e->getMessage()]);
} // }
} }
public function sendNotification() public function sendNotification()

View File

@ -16,10 +16,10 @@ public function creating(Testdrive $model)
public function created(Testdrive $model) public function created(Testdrive $model)
{ {
if ($model->status === Testdrive::STATUS_DRAFT) { // if ($model->status === Testdrive::STATUS_DRAFT) {
TestdrivePushJob::dispatch($model); // TestdrivePushJob::dispatch($model);
} else { // } else {
info('===== TestdriveObserver::created not a draft', ['id' => $model->id, 'status' => $model->status]); // info('===== TestdriveObserver::created not a draft', ['id' => $model->id, 'status' => $model->status]);
} // }
} }
} }