作者 lyh

gx

@@ -21,6 +21,7 @@ use App\Models\Project\Project; @@ -21,6 +21,7 @@ use App\Models\Project\Project;
21 use App\Models\Project\ProjectAiSetting; 21 use App\Models\Project\ProjectAiSetting;
22 use App\Models\RouteMap\RouteMap; 22 use App\Models\RouteMap\RouteMap;
23 use App\Services\AiBlogService; 23 use App\Services\AiBlogService;
  24 +use App\Services\DingService;
24 use App\Services\ProjectServer; 25 use App\Services\ProjectServer;
25 use Illuminate\Console\Command; 26 use Illuminate\Console\Command;
26 use App\Models\Project\AiBlogTask as AiBlogTaskModel; 27 use App\Models\Project\AiBlogTask as AiBlogTaskModel;
@@ -87,6 +88,13 @@ class AiBlogTask extends Command @@ -87,6 +88,13 @@ class AiBlogTask extends Command
87 }else{ 88 }else{
88 $aiBlogTaskModel->edit(['status'=>9],['id'=>$item['id']]); 89 $aiBlogTaskModel->edit(['status'=>9],['id'=>$item['id']]);
89 // 钉钉通知 90 // 钉钉通知
  91 + $dingService = new DingService();
  92 + $body = [
  93 + 'keyword' => '生成错误',
  94 + 'msg' => '任务id:'.$item['task_id'].'拉取数据失败',
  95 + 'isAtAll' => false, // 是否@所有人
  96 + ];
  97 + $result = $dingService->handle($body);
90 } 98 }
91 echo date('Y-m-d H:i:s'). '错误信息:'.json_encode($result,true).PHP_EOL; 99 echo date('Y-m-d H:i:s'). '错误信息:'.json_encode($result,true).PHP_EOL;
92 return false; 100 return false;
@@ -15,7 +15,7 @@ class DingService @@ -15,7 +15,7 @@ class DingService
15 { 15 {
16 use RedisTrait; 16 use RedisTrait;
17 17
18 - const LINK = 'https://oapi.dingtalk.com/robot/send111?access_token=723c99369cc16806a26fee8b8ab2c5ae37a78ef842e6a3af89fed0b2a6211836'; 18 + const LINK = 'https://oapi.dingtalk.com/robot/send?access_token=2cdba958f11f24f961f13aba2d1acbcd60ed64c998a184492cc63814696e34e1';
19 const INFO = 'INFO'; 19 const INFO = 'INFO';
20 const ERROR = 'ERROR'; 20 const ERROR = 'ERROR';
21 const WARNNING = 'WARNNING'; 21 const WARNNING = 'WARNNING';