feat: 實作機台日誌核心功能與 IoT 高併發處理架構
All checks were successful
star-cloud-deploy-demo / deploy-demo (push) Successful in 36s

This commit is contained in:
2026-03-09 09:43:51 +08:00
parent 21e064ff91
commit c30c3a399d
53 changed files with 2300 additions and 2130 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace Database\Factories\Machine;
use App\Models\Machine\Machine;
use App\Models\Machine\MachineLog;
use Illuminate\Database\Eloquent\Factories\Factory;
class MachineLogFactory extends Factory
{
protected $model = MachineLog::class;
public function definition(): array
{
return [
'machine_id' => Machine::factory(),
'level' => $this->faker->randomElement(['info', 'warning', 'error']),
'message' => $this->faker->sentence(),
'context' => [
'ip' => $this->faker->ipv4(),
'uptime' => $this->faker->numberBetween(1000, 100000),
],
'created_at' => now(),
];
}
}