作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !1934
... ... @@ -39,14 +39,12 @@ class AiVideoTask extends Command
public $updateProject = [];//需更新的列表
public $routes = [];//需要更新的路由
/**
* The console command description.
*
* @var string
*/
protected $description = '查询ai_video是否已经生成';
/**
* @return bool
* @throws \Exception
... ...
... ... @@ -48,6 +48,7 @@ class AiBlogController extends BaseController
'id.required' => '主键不能为空',
]);
$info = $aiBlog->read(['id'=>$this->param['id']]);
$info['anchor'] = json_decode($info['anchor'] ?? [],true);
$info['image'] = getImageUrl($info['image']);
$this->response('success',Code::SUCCESS,$info);
}
... ...
... ... @@ -52,6 +52,8 @@ class AiVideoController extends BaseController
'id.required' => '主键不能为空',
]);
$info = $aiVideo->read(['id'=>$this->param['id']]);
$info['anchor'] = json_decode($info['anchor'] ?? [],true);
$info['images'] = json_decode($info['images'] ?? [],true);
$this->response('success',Code::SUCCESS,$info);
}
... ... @@ -119,7 +121,7 @@ class AiVideoController extends BaseController
* @method :post
* @time :2025/2/21 16:22
*/
public function getAiBlogList(AiVideoList $aiVideoList){
public function getAiVideoList(AiVideoList $aiVideoList){
$lists = $aiVideoList->lists($this->map,$this->page,$this->row,'id',['id','route','created_at','updated_at']);
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
... ... @@ -129,4 +131,21 @@ class AiVideoController extends BaseController
}
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :获取列表页数据详情
* @name :getAiBlogListInfo
* @author :lyh
* @method :post
* @time :2025/2/21 16:26
*/
public function getAiBlogListInfo(AiVideoList $aiVideoList){
$this->request->validate([
'id'=>['required'],
],[
'id.required' => '主键不能为空',
]);
$info = $aiVideoList->read($this->map);
$this->response('success',Code::SUCCESS,$info);
}
}
... ...
... ... @@ -58,7 +58,7 @@ class AiBlogLogic extends BaseLogic
}
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_AI_BLOG, $this->param['id'], $this->user['project_id']);
$anchor = $this->param['anchor'] ?? [];
$this->param['anchor'] = json_encode($this->param['anchor'],true);
$this->param['anchor'] = json_encode($anchor,true);
$this->model->edit($this->param,['id'=>$this->param['id']]);
$aiSettingInfo = $this->getProjectAiSetting();
$aiBlogService = new AiBlogService();
... ...
... ... @@ -41,7 +41,7 @@ class AiVideoLogic extends BaseLogic
try {
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_AI_VIDEO, $this->param['id'], $this->user['project_id']);
$anchor = $this->param['anchor'] ?? [];
$this->param['anchor'] = json_encode($this->param['anchor'],true);
$this->param['anchor'] = json_encode($anchor,true);
$this->param['images'] = json_encode($this->param['images'],true);
$this->model->edit($this->param,['id'=>$this->param['id']]);
$aiVideoService = new AiVideoService($this->user['project_id']);
... ...
... ... @@ -159,6 +159,8 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('/sendTask', [\App\Http\Controllers\Bside\Ai\AiVideoController::class, 'sendTask'])->name('ai_video_sendTask');
Route::any('/save', [\App\Http\Controllers\Bside\Ai\AiVideoController::class, 'save'])->name('ai_video_save');
Route::any('/del', [\App\Http\Controllers\Bside\Ai\AiVideoController::class, 'delete'])->name('ai_video_delete');
Route::any('/getAiVideoList', [\App\Http\Controllers\Bside\Ai\AiVideoController::class, 'getAiVideoList'])->name('ai_video_getAiVideoList');
Route::any('/getAiBlogListInfo', [\App\Http\Controllers\Bside\Ai\AiVideoController::class, 'getAiBlogListInfo'])->name('ai_video_getAiBlogListInfo');
});
//ai
Route::any('/news/', [\App\Http\Controllers\Bside\Ai\AiNewsController::class, 'save'])->name('ai_news_save');
... ...