All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 1m6s
1. 修復帳號管理與角色權限頁面搜尋功能,支援 Enter 鍵快捷提交。 2. 完成 B013 (機台故障上報) API 實作,改用非同步隊列 (ProcessMachineError) 處理日誌上報。 3. 精簡 B013 API 參數,移除冗餘的 message 欄位,統一由雲端對照表翻譯。 4. 更新技術規格文件 (SKILL.md) 與系統 API 文件配置 (api-docs.php)。 5. 修正平台管理員帳號在搜尋過濾時的資料隔離邏輯。
41 lines
952 B
PHP
41 lines
952 B
PHP
<?php
|
|
|
|
namespace App\Jobs\Machine;
|
|
|
|
use App\Models\Machine\Machine;
|
|
use App\Services\Machine\MachineService;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ProcessMachineError implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
protected $serialNo;
|
|
protected $data;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*/
|
|
public function __construct(string $serialNo, array $data)
|
|
{
|
|
$this->serialNo = $serialNo;
|
|
$this->data = $data;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*/
|
|
public function handle(MachineService $service): void
|
|
{
|
|
$machine = Machine::where('serial_no', $this->serialNo)->first();
|
|
|
|
if ($machine) {
|
|
$service->recordErrorLog($machine, $this->data);
|
|
}
|
|
}
|
|
}
|