UpgradeDaily.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. use Illuminate\Support\Carbon;
  5. use Illuminate\Support\Facades\Http;
  6. class UpgradeDaily extends Command
  7. {
  8. /**
  9. * The name and signature of the console command.
  10. *
  11. * @var string
  12. */
  13. protected $signature = 'upgrade:daily';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = '每天的任务';
  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. $start = time();
  37. $url = "https://oapi.dingtalk.com/robot/send?access_token=34143dbec80a8fc09c1cb5897a5639ee3a9a32ecfe31835ad29bf7013bdb9fdf";
  38. $param = [
  39. "markdown"=> [
  40. "title"=> "后台任务",
  41. "text"=> " wikipali: 每日统计后台任务开始执行。",
  42. ],
  43. "msgtype"=>"markdown"
  44. ];
  45. $response = Http::post($url, $param);
  46. # 刷巴利语句子uuid 仅调用一次
  47. //$this->call('upgrade:palitextid');
  48. //巴利原文段落库目录结构改变时运行
  49. $this->call('upgrade:palitext');
  50. #巴利段落标签
  51. $this->call('upgrade:palitexttag');
  52. #译文进度
  53. $this->call('upgrade:progress');
  54. $this->call('upgrade:progresschapter');
  55. # 段落更新图
  56. $this->call('upgrade:chapterdynamic');
  57. # 逐词译数据库分析
  58. $this->call('upgrade:wbwanalyses');
  59. $time = time()-$start;
  60. $param = [
  61. "markdown"=> [
  62. "title"=> "后台任务",
  63. "text"=> " wikipali: 每日统计后台任务执行完毕。用时{$time}",
  64. ],
  65. "msgtype"=>"markdown"
  66. ];
  67. $response = Http::post($url, $param);
  68. return 0;
  69. }
  70. }