Commit 5ac69d48 by wangfa

任务发送,下载回调完成

parent fbe013a5
...@@ -22,6 +22,7 @@ public function handle() ...@@ -22,6 +22,7 @@ public function handle()
if (filled($data)) { if (filled($data)) {
$data = json_decode($data[1], true); $data = json_decode($data[1], true);
if (filled($data)) { if (filled($data)) {
$this->info("开始处理消息 {$data['message_content']}");
dispatch(new ReadDiscordMessageJob($data)); dispatch(new ReadDiscordMessageJob($data));
} }
} }
......
...@@ -30,8 +30,8 @@ public function handle() ...@@ -30,8 +30,8 @@ public function handle()
$data = $result['data']; $data = $result['data'];
$updateData = [ $updateData = [
'result_img_status' => TaskService::STATUS_SUCCESS, 'cut_status' => TaskService::STATUS_SUCCESS,
'result_img' => $data[0] ?? '', 'cut_img' => $data[0] ?? '',
]; ];
PromptTask::where('id', $this->data['prompt_id']) PromptTask::where('id', $this->data['prompt_id'])
->update($updateData); ->update($updateData);
......
...@@ -33,8 +33,8 @@ public function handle() ...@@ -33,8 +33,8 @@ public function handle()
$cachePrompt = Cache::get($key); $cachePrompt = Cache::get($key);
if (!empty($cachePrompt)) { if (!empty($cachePrompt)) {
$updateData = [ $updateData = [
'cut_status' => TaskService::STATUS_SUCCESS, 'result_img_status' => TaskService::STATUS_SUCCESS,
'cut_img' => $data['attachment_url'], 'result_img' => $data['attachment_url'],
]; ];
PromptTask::where('id', $cachePrompt['prompt_task_id']) PromptTask::where('id', $cachePrompt['prompt_task_id'])
->update($updateData); ->update($updateData);
......
...@@ -350,9 +350,10 @@ public function create_split_img_task(int $user_id = 0, $data = []) ...@@ -350,9 +350,10 @@ public function create_split_img_task(int $user_id = 0, $data = [])
Redis::rpush('discord_img_split', json_encode($list)); Redis::rpush('discord_img_split', json_encode($list));
} else { } else {
$downloadData = [ $downloadData = [
'url' => $prompt->cut_img, 'url' => $prompt->result_img,
'name' => Str::uuid()->toString(), 'name' => Str::uuid()->toString(),
'index' => $cut_id 'index' => $cut_id,
'prompt_id' => $prompt_id,
]; ];
dispatch(new DownloadImageJob($downloadData)); dispatch(new DownloadImageJob($downloadData));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment