SyncQuestionsFromQuestionBank.php 686 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. class SyncQuestionsFromQuestionBank extends Command
  5. {
  6. protected $signature = 'question:sync-from-question-bank
  7. {--dry-run : Preview only, do not write to MySQL}';
  8. protected $description = 'Sync AI-generated questions from QuestionBankService into MySQL questions table';
  9. public function handle(): int
  10. {
  11. $dryRun = (bool) $this->option('dry-run');
  12. $this->info(sprintf(
  13. '题库已完全迁移到本地数据库,question:sync-from-question-bank 已停用。dry_run=%s',
  14. $dryRun ? 'true' : 'false'
  15. ));
  16. return self::SUCCESS;
  17. }
  18. }