Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘小敏
loveisland
Commits
89218a74
Commit
89218a74
authored
May 07, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AI试戴 增加查询试戴详情接口
parent
4b88b534
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
AiTryon.php
addons/shopro/controller/user/AiTryon.php
+21
-2
AiTryon.php
addons/shopro/validate/user/AiTryon.php
+5
-1
No files found.
addons/shopro/controller/user/AiTryon.php
View file @
89218a74
...
@@ -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
);
//
//
// }
// }
}
}
...
...
addons/shopro/validate/user/AiTryon.php
View file @
89218a74
...
@@ -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'
],
];
];
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment