作者 lyh

gx添加随机模块

... ... @@ -177,6 +177,13 @@ class IndexController extends BaseController
'text.required' => '文本text不能为空',
'lang.required' => '语种不能为空',
]);
if($this->param['lang'] == 0){
$lang = Translate::translateSl($this->param['text']);
$this->param['lang'] = $lang['texts']['sl'] ?? '';
}
if(empty($this->param['lang'])){
$this->fail('未获取到语种');
}
$service = new HumanizeAiTextService();
$data = $service->humanizer($this->param['text'],$this->param['lang']);
$this->response('success', Code::SUCCESS, $data);
... ...
... ... @@ -139,11 +139,14 @@ class AiBlogLogic extends BaseLogic
try {
$aiSettingInfo = $this->getProjectAiSetting();
$aiBlogService = new AiBlogService();
$aiBlogTask = new AiBlogTask();
foreach ($this->param['ids'] as $id) {
$info = $this->model->read(['id'=>$id],['task_id','route']);
$info = $this->model->read(['id'=>$id],['task_id','route','author_id']);
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
$aiBlogService->key = $aiSettingInfo['key'];
$aiBlogService->delDetail($info['task_id']);
//重新生成作者页面
$aiBlogTask->addReturnId(['type'=>$aiBlogTask::TYPE_AUTHOR_ID,'task_id'=>$info['author_id'],'status'=>1,'project_id'=>$this->user['project_id']]);
//删除路由映射
RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']);
$this->model->del(['id'=>$id]);
... ...