forked from natuka/web.puabadge.com
修改:京东demo页面编辑效果图流程调整
This commit is contained in:
1 parent
e1da41c2f8
commit
0199b924ac
3 files changed
+95
-135
No files matched your search
+17
-34
@@ -98,25 +98,15 @@ export interface UploadTicket {
|
||||
|
||||
export interface ImageGenSubmitInput {
|
||||
session_id: string
|
||||
upload_id: string
|
||||
product_id: number
|
||||
product_name?: string
|
||||
style_id?: number
|
||||
/** 导入生图传 upload_id;编辑效果图不传 */
|
||||
upload_id?: string
|
||||
/** 编辑效果图传 image_id;导入生图不传 */
|
||||
image_id?: string
|
||||
prompt?: string
|
||||
n?: number
|
||||
mounts_id?: number
|
||||
scene_prop?: string
|
||||
custom_text?: string
|
||||
base_type?: number
|
||||
frame_type?: number
|
||||
mount_id?: number
|
||||
pid?: number
|
||||
proportion_id?: number
|
||||
pose_id?: number
|
||||
/** 效果图编辑 edit;原图编辑 / 普通立即生成 generate */
|
||||
mode?: 'generate' | 'edit'
|
||||
/** 主体数量文案,来自 orders/stat.subject_name,如「1人」「2人+1宠物」 */
|
||||
subject_name?: string
|
||||
}
|
||||
|
||||
export interface ImageGenImage {
|
||||
@@ -773,28 +763,21 @@ export const classifySubject = (input: {
|
||||
|
||||
/** POST /jd/imagegen/submit */
|
||||
export const submitImageGen = (input: ImageGenSubmitInput) => {
|
||||
const data: Record<string, string> = {
|
||||
session_id: input.session_id,
|
||||
prompt: input.prompt || '',
|
||||
scene_prop: input.scene_prop || '',
|
||||
custom_text: input.custom_text || '',
|
||||
mode: input.mode || 'generate',
|
||||
}
|
||||
const uploadId = String(input.upload_id || '').trim()
|
||||
const imageId = String(input.image_id || '').trim()
|
||||
// 导入生图:upload_id;编辑效果图:image_id(互斥)
|
||||
if (uploadId) data.upload_id = uploadId
|
||||
if (imageId) data.image_id = imageId
|
||||
return request(`${PREFIX}/imagegen/submit`, {
|
||||
method: 'POST',
|
||||
data: {
|
||||
session_id: input.session_id,
|
||||
upload_id: input.upload_id,
|
||||
product_id: input.product_id,
|
||||
product_name: input.product_name || '',
|
||||
style_id: input.style_id ?? 0,
|
||||
prompt: input.prompt || '',
|
||||
n: input.n ?? 1,
|
||||
mounts_id: input.mounts_id ?? 0,
|
||||
scene_prop: input.scene_prop || '',
|
||||
custom_text: input.custom_text || '',
|
||||
base_type: input.base_type ?? 0,
|
||||
frame_type: input.frame_type ?? 0,
|
||||
mount_id: input.mount_id ?? 0,
|
||||
pid: input.pid ?? 0,
|
||||
proportion_id: input.proportion_id ?? 0,
|
||||
pose_id: input.pose_id ?? 0,
|
||||
mode: input.mode || 'generate',
|
||||
subject_name: input.subject_name || '',
|
||||
},
|
||||
data,
|
||||
}) as Promise<ImageGenTask>
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user