info("Syncing star-cloud-gateway auth..."); $gatewayKey = "machine_auth:star-cloud-gateway"; $gatewayPass = hash('sha256', "StarCloudSecret999"); \Illuminate\Support\Facades\Redis::hSet($gatewayKey, 'password', $gatewayPass); $this->info("Gateway auth synced."); // 2. 同步所有機台的認證資料 (僅限未刪除的) $machines = Machine::get(); $this->info("Syncing " . $machines->count() . " machines to Redis..."); $bar = $this->output->createProgressBar($machines->count()); $bar->start(); foreach ($machines as $machine) { $machineService->syncMqttAuth($machine); $bar->advance(); } $bar->finish(); $this->newLine(); $this->info("Sync completed."); } }