forked from 77media/video-flow
更新获取相似角色的接口路径,修改为调用新的搜索和推荐接口。同时,移除不必要的调试代码,优化角色编辑用例的代码结构,提升可读性。
This commit is contained in:
parent
b6bb65eddb
commit
60c7d11101
@ -902,7 +902,7 @@ export const getSimilarCharacters = async (request: {
|
|||||||
/** 总数量 */
|
/** 总数量 */
|
||||||
total_count: number;
|
total_count: number;
|
||||||
}>> => {
|
}>> => {
|
||||||
return post("/character/get_similar_characters", request);
|
return post("/character/search_and_recommend", request);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -346,7 +346,6 @@ export const useShotService = (): UseShotService => {
|
|||||||
|
|
||||||
// 上传到七牛云
|
// 上传到七牛云
|
||||||
const imageUrl = await uploadToQiniu(file, token);
|
const imageUrl = await uploadToQiniu(file, token);
|
||||||
console.log('imageUrl', imageUrl);
|
|
||||||
// 调用用例中的识别角色方法
|
// 调用用例中的识别角色方法
|
||||||
if (vidoEditUseCase) {
|
if (vidoEditUseCase) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -88,13 +88,6 @@ export class RoleEditUseCase {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 解析项目角色列表接口返回的数据
|
|
||||||
* @description 将接口返回的项目角色列表数据转换为RoleEntity数组
|
|
||||||
* @param {RoleResponse[]} projectRoleData - 项目角色列表数据
|
|
||||||
* @returns {RoleEntity[]} 角色实体数组
|
|
||||||
* @throws {Error} 如果数据格式不正确则抛出异常
|
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
* 解析项目角色列表接口返回的数据
|
* 解析项目角色列表接口返回的数据
|
||||||
* @description 将接口返回的项目角色列表数据转换为RoleEntity数组
|
* @description 将接口返回的项目角色列表数据转换为RoleEntity数组
|
||||||
|
|||||||
@ -74,39 +74,41 @@ export function HomePage2() {
|
|||||||
|
|
||||||
// 处理创建项目
|
// 处理创建项目
|
||||||
const handleCreateProject = async () => {
|
const handleCreateProject = async () => {
|
||||||
if (isCreating) return;
|
// console.log('isCreating', isCreating);
|
||||||
|
|
||||||
try {
|
|
||||||
setIsCreating(true);
|
|
||||||
router.push(`/create`);
|
router.push(`/create`);
|
||||||
return;
|
// if (isCreating) return;
|
||||||
|
|
||||||
// 使用默认值
|
// try {
|
||||||
const projectType = ProjectTypeEnum.SCRIPT_TO_VIDEO;
|
// setIsCreating(true);
|
||||||
|
// router.push(`/create`);
|
||||||
|
// return;
|
||||||
|
|
||||||
// 构建项目数据并调用API
|
// // 使用默认值
|
||||||
const projectData: CreateScriptProjectRequest = {
|
// const projectType = ProjectTypeEnum.SCRIPT_TO_VIDEO;
|
||||||
title: "script default", // 默认剧本名称
|
|
||||||
project_type: projectType,
|
|
||||||
mode: ModeEnum.MANUAL === 'manual' ? 1 : 2, // 1 表示手动模式,2 表示自动模式
|
|
||||||
resolution: 1080 // 1080p 分辨率
|
|
||||||
};
|
|
||||||
|
|
||||||
const projectResponse = await createScriptProject(projectData);
|
// // 构建项目数据并调用API
|
||||||
|
// const projectData: CreateScriptProjectRequest = {
|
||||||
|
// title: "script default", // 默认剧本名称
|
||||||
|
// project_type: projectType,
|
||||||
|
// mode: ModeEnum.MANUAL === 'manual' ? 1 : 2, // 1 表示手动模式,2 表示自动模式
|
||||||
|
// resolution: 1080 // 1080p 分辨率
|
||||||
|
// };
|
||||||
|
|
||||||
if (projectResponse.code === 0 && projectResponse.data.id) {
|
// const projectResponse = await createScriptProject(projectData);
|
||||||
const projectId = projectResponse.data.id;
|
|
||||||
setCreatedProjectId(projectId);
|
// if (projectResponse.code === 0 && projectResponse.data.id) {
|
||||||
// projectId 作为参数传递给 create 页面
|
// const projectId = projectResponse.data.id;
|
||||||
router.push(`/create?projectId=${projectId}`);
|
// setCreatedProjectId(projectId);
|
||||||
} else {
|
// // projectId 作为参数传递给 create 页面
|
||||||
alert(`创建项目失败: ${projectResponse.message}`);
|
// router.push(`/create?projectId=${projectId}`);
|
||||||
}
|
// } else {
|
||||||
} catch (error) {
|
// alert(`创建项目失败: ${projectResponse.message}`);
|
||||||
alert("创建项目时发生错误,请稍后重试");
|
// }
|
||||||
} finally {
|
// } catch (error) {
|
||||||
setIsCreating(false);
|
// alert("创建项目时发生错误,请稍后重试");
|
||||||
}
|
// } finally {
|
||||||
|
// setIsCreating(false);
|
||||||
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理工具切换
|
// 处理工具切换
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user