|
...
|
...
|
@@ -70,4 +70,47 @@ class AiCommandController extends BaseController |
|
|
|
return $aiLog->add($param);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取排版指令
|
|
|
|
* @name :getAiTypesetting
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/5/26 17:11
|
|
|
|
*/
|
|
|
|
public function getLayoutDesignInfo(){
|
|
|
|
$aiCommonModel = new AiCommand();
|
|
|
|
$data = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>$this->user['project_id']]);
|
|
|
|
if($data === false){
|
|
|
|
$data = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>0]);
|
|
|
|
}
|
|
|
|
$this->response('success', Code::SUCCESS, $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存指令
|
|
|
|
* @name :saveAiCommand
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/5/26 17:15
|
|
|
|
*/
|
|
|
|
public function saveLayoutDesign(){
|
|
|
|
$this->request->validate([
|
|
|
|
'key'=>['required']
|
|
|
|
],[
|
|
|
|
'key.required' => '场景不能为空',
|
|
|
|
]);
|
|
|
|
$aiCommonModel = new AiCommand();
|
|
|
|
if($this->param['key'] != 'ai_layout_design'){
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
$data = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>$this->user['project_id']]);
|
|
|
|
if($data === false) {
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$id = $aiCommonModel->addReturnId($this->param);
|
|
|
|
}else{
|
|
|
|
$id = $data['id'];
|
|
|
|
$aiCommonModel->edit($this->param,['id'=>$data['id']]);
|
|
|
|
}
|
|
|
|
$this->response('success', Code::SUCCESS, ['id'=>$id]);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|