|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :CopyProject.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/1/15 14:40
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Jobs;
|
|
|
|
namespace App\Console\Commands\Project;
|
|
|
|
|
|
|
|
use App\Events\CopyProject;
|
|
|
|
use App\Events\UpdateHtml;
|
|
|
|
use App\Jobs\updateHtmlJob;
|
|
|
|
use App\Models\Project\After;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use App\Models\Project\DeployOptimize;
|
|
...
|
...
|
@@ -14,40 +18,27 @@ use App\Models\Template\Setting; |
|
|
|
use App\Models\User\User as UserModel;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Hashids\Hashids;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class CopyProjectJob implements ShouldQueue
|
|
|
|
class CopyProject extends Command
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public $tries = 3; // 可配置任务重试次数
|
|
|
|
|
|
|
|
protected $param;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new job instance.
|
|
|
|
* The name and signature of the console command.
|
|
|
|
*
|
|
|
|
* @param CopyImageFile $event
|
|
|
|
* @return void
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public function __construct($data)
|
|
|
|
{
|
|
|
|
$this->param = $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected $signature = 'copy_project';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle the event.
|
|
|
|
* The console command description.
|
|
|
|
*
|
|
|
|
* @param UpdateHtml $event
|
|
|
|
* @return void
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $description = 'copy--复制项目';
|
|
|
|
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
$projectModel = new Project();
|
...
|
...
|
|