作者 lyh

gx脚本

... ... @@ -124,16 +124,12 @@ class AiCommandController extends BaseController
*/
public function sendLayoutDesign(){
$this->request->validate([
'key'=>['required']
'ai'=>['required']
],[
'key.required' => '场景不能为空',
'ai.required' => '场景不能为空',
]);
$aiCommonModel = new AiCommand();
$info = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>$this->user['project_id']]);
if($info === false){
$info = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>0]);
}
$aiCommandService = new AiCommandService();
$info['ai'] = '请根据这个 {​海外展会与独立站数字营销的结合:线下资源如何助力线上推广} 文章标题帮我生成一个更有吸引力、引发读者兴趣的新标题,只需要给我标题内容,不要回复我别的内容(比如序号、你的提示、寒暄、代码解释、总结之类的)';
$result = $aiCommandService->send_layout_design($info['ai']);
$this->response('success', Code::SUCCESS, $result);
}
... ...