|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Listeners;
|
|
|
|
|
|
|
|
use App\Events\CopyImageFile;
|
|
|
|
use App\Events\UpdateHtml;
|
|
|
|
use App\Jobs\CopyImageFileJob;
|
|
|
|
use App\Jobs\updateHtmlJob;
|
|
|
|
use App\Models\File\File as FileModel;
|
|
|
|
use App\Models\File\Image as ImageModel;
|
|
|
|
use App\Services\AmazonS3Service;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
|
|
|
class CopyImageFileListener implements ShouldQueue
|
|
|
|
{
|
|
|
|
use InteractsWithQueue, SerializesModels;
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handle(CopyImageFile $event)
|
|
|
|
{
|
|
|
|
$this->param = $event->data;
|
|
|
|
// 将任务推送到队列,异步执行
|
|
|
|
dispatch(new CopyImageFileJob($event));
|
|
|
|
}
|
|
|
|
} |