configService = $configService; } /** * 执行命令 * * @return int */ public function handle() { $outputPath = $this->option('output'); // 确保输出目录存在 if (!File::exists($outputPath)) { File::makeDirectory($outputPath, 0755, true); } // 生成任务基础配置表 $taskConfig = $this->configService->exportTaskConfig(); File::put("$outputPath/task_config.json", $taskConfig); $this->info("任务基础配置表已生成:$outputPath/task_config.json"); // 生成任务条件配置表 $conditionConfig = $this->configService->exportTaskConditionConfig(); File::put("$outputPath/task_condition_config.json", $conditionConfig); $this->info("任务条件配置表已生成:$outputPath/task_condition_config.json"); // 生成任务奖励配置表 $rewardConfig = $this->configService->exportTaskRewardConfig(); File::put("$outputPath/task_reward_config.json", $rewardConfig); $this->info("任务奖励配置表已生成:$outputPath/task_reward_config.json"); // 生成任务消耗配置表 $costConfig = $this->configService->exportTaskCostConfig(); File::put("$outputPath/task_cost_config.json", $costConfig); $this->info("任务消耗配置表已生成:$outputPath/task_cost_config.json"); return 0; } }