作者 lyh

变更数据

... ... @@ -26,10 +26,8 @@ use App\Services\DingService;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use App\Models\Project\AiBlogTask as AiBlogTaskModel;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use function Symfony\Component\String\s;
class AiBlogTask extends Command
{
... ... @@ -257,14 +255,21 @@ class AiBlogTask extends Command
$saveData = [];
$result = $aiBlogService->getAiBlogList($page,15);
if(!isset($result['status']) || $result['status'] != 200){
// 钉钉通知
$dingService = new DingService();
$body = [
'keyword' => 'AI_BLOG列表页未生成拉取失败',
'msg' => '项目ID:' . $project_id . PHP_EOL . '返回信息:' . json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
'isAtAll' => false, // 是否@所有人
];
$dingService->handle($body);
try {
// 钉钉通知
$dingService = new DingService();
$body = [
'keyword' => 'AI_BLOG列表页未生成拉取失败',
'msg' => '项目ID:' . $project_id . PHP_EOL . '返回信息:' . json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
'isAtAll' => false, // 是否@所有人
];
$dingService->handle($body);
//写一条更新记录
$aiBlogTaskModel = new AiBlogTaskModel();
$aiBlogTaskModel->addReturnId(['project_id'=>$project_id,'task_id'=>$project_id,'status'=>$aiBlogTaskModel::STATUS_RUNNING,'type'=>$aiBlogTaskModel::TYPE_LIST]);
}catch (\Exception $e){
$this->output('更新列表页失败同时通知失败--error:' . $e->getMessage());
}
return true;
}
$total_page = $result['data']['total_page'];
... ...
... ... @@ -27,4 +27,5 @@ class AiBlogTask extends Base
const TYPE_AUTHOR = 1;
const TYPE_BLOG = 2;
const TYPE_AUTHOR_ID = 3;//根据对应id页面
const TYPE_LIST = 4;//更新列表页
}
... ...