正在显示
3 个修改的文件
包含
4 行增加
和
31 行删除
| @@ -6,6 +6,7 @@ use App\Enums\Common\Code; | @@ -6,6 +6,7 @@ use App\Enums\Common\Code; | ||
| 6 | use App\Events\CopyImageFile; | 6 | use App\Events\CopyImageFile; |
| 7 | use App\Events\CopyProject; | 7 | use App\Events\CopyProject; |
| 8 | use App\Exceptions\AsideGlobalException; | 8 | use App\Exceptions\AsideGlobalException; |
| 9 | +use App\Jobs\CopyImageFileJob; | ||
| 9 | use App\Models\Com\NoticeLog; | 10 | use App\Models\Com\NoticeLog; |
| 10 | use App\Models\Com\UpdateLog; | 11 | use App\Models\Com\UpdateLog; |
| 11 | use App\Models\Devops\ServerConfig; | 12 | use App\Models\Devops\ServerConfig; |
| @@ -165,7 +166,7 @@ class ProjectLogic extends BaseLogic | @@ -165,7 +166,7 @@ class ProjectLogic extends BaseLogic | ||
| 165 | 166 | ||
| 166 | public function syncImageFile($location,$project_id){ | 167 | public function syncImageFile($location,$project_id){ |
| 167 | if($location == 1){ | 168 | if($location == 1){ |
| 168 | - CopyImageFile::dispatch(['project_id'=>$project_id]); | 169 | + CopyImageFileJob::dispatch(['project_id'=>$project_id]); |
| 169 | } | 170 | } |
| 170 | return $this->success(); | 171 | return $this->success(); |
| 171 | } | 172 | } |
| @@ -23,9 +23,9 @@ class CopyImageFileJob implements ShouldQueue | @@ -23,9 +23,9 @@ class CopyImageFileJob implements ShouldQueue | ||
| 23 | * @param CopyImageFile $event | 23 | * @param CopyImageFile $event |
| 24 | * @return void | 24 | * @return void |
| 25 | */ | 25 | */ |
| 26 | - public function __construct(CopyImageFile $event) | 26 | + public function __construct($data) |
| 27 | { | 27 | { |
| 28 | - $this->param = $event->data; | 28 | + $this->param = $data; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
app/Listeners/CopyImageFileListener.php
已删除
100644 → 0
| 1 | -<?php | ||
| 2 | - | ||
| 3 | -namespace App\Listeners; | ||
| 4 | - | ||
| 5 | -use App\Events\CopyImageFile; | ||
| 6 | -use App\Events\UpdateHtml; | ||
| 7 | -use App\Jobs\CopyImageFileJob; | ||
| 8 | -use App\Jobs\updateHtmlJob; | ||
| 9 | -use App\Models\File\File as FileModel; | ||
| 10 | -use App\Models\File\Image as ImageModel; | ||
| 11 | -use App\Services\AmazonS3Service; | ||
| 12 | -use Illuminate\Contracts\Queue\ShouldQueue; | ||
| 13 | - | ||
| 14 | -class CopyImageFileListener implements ShouldQueue | ||
| 15 | -{ | ||
| 16 | - use InteractsWithQueue, SerializesModels; | ||
| 17 | - public function __construct() | ||
| 18 | - { | ||
| 19 | - // | ||
| 20 | - } | ||
| 21 | - | ||
| 22 | - public function handle(CopyImageFile $event) | ||
| 23 | - { | ||
| 24 | - $this->param = $event->data; | ||
| 25 | - // 将任务推送到队列,异步执行 | ||
| 26 | - dispatch(new CopyImageFileJob($event)); | ||
| 27 | - } | ||
| 28 | -} |
-
请 注册 或 登录 后发表评论