2
0

TestAiTask.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. use App\Http\Api\AiTaskPrepare;
  5. class TestAiTask extends Command
  6. {
  7. /**
  8. * The name and signature of the console command.
  9. * php artisan test:ai.task c77af42f-ffb5-48ae-af71-4c32e1c30dab
  10. * php artisan test:ai.task f42fa690-c590-400f-9de9-fbc81e838a5a
  11. * @var string
  12. */
  13. protected $signature = 'test:ai.task {id} {--test}';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = 'test ai task';
  20. /**
  21. * Create a new command instance.
  22. *
  23. * @return void
  24. */
  25. public function __construct()
  26. {
  27. parent::__construct();
  28. }
  29. /**
  30. * Execute the console command.
  31. *
  32. * @return int
  33. */
  34. public function handle()
  35. {
  36. $taskId = $this->argument('id');
  37. $params = AiTaskPrepare::translate($taskId, !$this->option('test'));
  38. var_dump($params);
  39. var_dump($this->option('test'));
  40. $this->info('total:' . count($params));
  41. return 0;
  42. }
  43. }