Commit 89218a74 authored by 刘小敏's avatar 刘小敏

AI试戴 增加查询试戴详情接口

parent 4b88b534
...@@ -168,6 +168,24 @@ class AiTryon extends Common ...@@ -168,6 +168,24 @@ class AiTryon extends Common
} }
/** /**
* AI试戴 查询AI试戴结果
*/
public function getAiDetail()
{
if (!$this->request->isGet()) {
$this->error('请用get方式请求');
}
$params = $this->request->only(['id']);
$this->svalidate($params, ".aidetail");
$res = AiTryOnModel::get($params['id']);
$this->success('AI试戴详情', $res);
}
/**
* AI试戴 生成视频 * AI试戴 生成视频
*/ */
public function genVideo() public function genVideo()
...@@ -195,7 +213,7 @@ class AiTryon extends Common ...@@ -195,7 +213,7 @@ class AiTryon extends Common
} else { } else {
// 开发过程中临时代码 // 开发过程中临时代码
$this->success('视频生成中'); $this->success('视频生成中', 3);
// // 合成AI视频 // // 合成AI视频
// $ai = new Ai(); // $ai = new Ai();
...@@ -226,11 +244,12 @@ class AiTryon extends Common ...@@ -226,11 +244,12 @@ class AiTryon extends Common
// $tryonData['ai_status'] = 0; // $tryonData['ai_status'] = 0;
// $tryonData['ai_task_id'] = isset($res['data']) ? $res['data'] : ''; // $tryonData['ai_task_id'] = isset($res['data']) ? $res['data'] : '';
// $tryonModel->save($tryonData); // $tryonModel->save($tryonData);
// $id = $tryonModel->id;
// //
// // 推送队列 // // 推送队列
// \think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => $res['data'], 'user' => $user], 'shopro-high'); // \think\Queue::push('\addons\shopro\job\AiVideoGen@save', ['taskid' => $res['data'], 'user' => $user], 'shopro-high');
// //
// $this->success($res['msg']); // $this->success($res['msg'], $id);
// //
// } // }
} }
......
...@@ -10,6 +10,7 @@ class AiTryon extends Validate ...@@ -10,6 +10,7 @@ class AiTryon extends Validate
* 验证规则 * 验证规则
*/ */
protected $rule = [ protected $rule = [
'id' => 'require',
'url' => 'require|length:0,255', 'url' => 'require|length:0,255',
'goods_title' => 'require|length:0,255', 'goods_title' => 'require|length:0,255',
'goods_sku_name' => 'require|length:0,255', 'goods_sku_name' => 'require|length:0,255',
...@@ -22,6 +23,8 @@ class AiTryon extends Validate ...@@ -22,6 +23,8 @@ class AiTryon extends Validate
* 提示消息 * 提示消息
*/ */
protected $message = [ protected $message = [
'id.require' => 'id入参缺失',
'url.require' => 'AI结果缺失', 'url.require' => 'AI结果缺失',
'url.length' => 'AI结果长度必须在 0-255 位', 'url.length' => 'AI结果长度必须在 0-255 位',
...@@ -44,7 +47,8 @@ class AiTryon extends Validate ...@@ -44,7 +47,8 @@ class AiTryon extends Validate
protected $scene = [ protected $scene = [
'add' => ['url', 'goods_id', 'goods_title', 'goods_sku_id', 'goods_sku_name', 'goods_sku_image'], 'add' => ['url', 'goods_id', 'goods_title', 'goods_sku_id', 'goods_sku_name', 'goods_sku_image'],
'edit' => [], 'edit' => [],
'aiadd' => ['person_image', 'jewelry_image', 'goods_id', 'goods_title'] 'aiadd' => ['person_image', 'jewelry_image', 'goods_id', 'goods_title'],
'aidetail' => ['id'],
]; ];
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment