作者 lyh

gx创建作者

... ... @@ -40,7 +40,7 @@ class AiBlogTask extends Command
while (true){
$info = $aiBlogTaskModel->where('status',1)->orderBy('id','asc')->first();
if(empty($info)){
sleep(30);
sleep(300);
continue;
}
$info = $info->toArray();
... ...
... ... @@ -27,6 +27,41 @@ class AiBlogController extends BaseController
}
/**
* @remark :获取详情
* @name :getInfo
* @author :lyh
* @method :post
* @time :2025/2/20 18:17
*/
public function getInfo(AiBlog $aiBlog){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => '主键不能为空',
]);
$info = $aiBlog->read(['id'=>$this->param['id']]);
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :删除
* @name :delete
* @author :lyh
* @method :post
* @time :2025/2/20 18:19
*/
public function delete(AiBlogLogic $aiBlogLogic)
{
$this->request->validate([
'ids'=>['required', new Ids()]
],[
'ids.required' => 'ID不能为空'
]);
$aiBlogLogic->blogDelete();
$this->response('success');
}
/**
* @remark :获取ai博客列表
* @name :getAiBlog
* @author :lyh
... ...
... ... @@ -88,4 +88,24 @@ class AiBlogLogic extends BaseLogic
$result = $aiBlogService->createAuthor();
return $this->success($result);
}
/**
* @remark :删除
* @name :blogDelete
* @author :lyh
* @method :post
* @time :2025/2/20 18:21
*/
public function blogDelete(){
try {
foreach ($this->param['ids'] as $id) {
//删除路由映射
RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']);
$this->model->del(['id'=>$id]);
}
}catch (\Exception $e){
$this->fail('删除失败');
}
return $this->success();
}
}
... ...