From 2c4bb10a36e44686eb41ca85da42ab7b9095ece8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E9=BE=99?= Date: Fri, 15 Aug 2025 13:59:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/Interaction/RoleService.ts | 4 -- app/service/Interaction/RoleShotService.ts | 2 - app/service/Interaction/ShotService.ts | 3 -- app/service/adapter/oldErrAdapter.ts | 2 - app/service/domain/Entities.ts | 48 +++++++++++++++------- app/service/domain/valueObject.ts | 4 -- app/service/usecase/RoleEditUseCase.ts | 15 ------- components/ui/shot-tab-content.tsx | 2 - 8 files changed, 34 insertions(+), 46 deletions(-) diff --git a/app/service/Interaction/RoleService.ts b/app/service/Interaction/RoleService.ts index 636ed23..d069f18 100644 --- a/app/service/Interaction/RoleService.ts +++ b/app/service/Interaction/RoleService.ts @@ -151,8 +151,6 @@ export const useRoleServiceHook = (): UseRoleService => { name: keyword, /** 内容 */ content: keyword, - loadingProgress: 100, - updatedAt: Date.now(), })), } : role @@ -170,8 +168,6 @@ export const useRoleServiceHook = (): UseRoleService => { name: keyword, /** 内容 */ content: keyword, - loadingProgress: 100, - updatedAt: Date.now(), })), }); } diff --git a/app/service/Interaction/RoleShotService.ts b/app/service/Interaction/RoleShotService.ts index 3c47515..2726b1c 100644 --- a/app/service/Interaction/RoleShotService.ts +++ b/app/service/Interaction/RoleShotService.ts @@ -100,8 +100,6 @@ export const useRoleShotServiceHook = (projectId: string,selectRole?:RoleEntity, videoUrl: scene.video_urls,// 保持为string[]类型 status:scene.video_urls.length>0?1:0, // 默认为已完成状态 lens: [], - updatedAt: Date.now(), - loadingProgress: 100, selected: false, applied: true // 由于是通过角色查询到的,所以都是已应用的 })); diff --git a/app/service/Interaction/ShotService.ts b/app/service/Interaction/ShotService.ts index d6f312b..c3682ba 100644 --- a/app/service/Interaction/ShotService.ts +++ b/app/service/Interaction/ShotService.ts @@ -132,8 +132,6 @@ export const useShotService = (): UseShotService => { status: newSegment.status, sketchUrl: newSegment.sketchUrl, lens: newSegment.lens, - updatedAt: newSegment.updatedAt, - loadingProgress: newSegment.loadingProgress, }); } else { existingSegmentsMap.set(newSegment.id, newSegment); @@ -197,7 +195,6 @@ export const useShotService = (): UseShotService => { ? { ...segment, status: 0, // 设置为视频加载中状态 - loadingProgress: 0 // 重置加载进度 } : segment ) diff --git a/app/service/adapter/oldErrAdapter.ts b/app/service/adapter/oldErrAdapter.ts index 0753af9..d4a1791 100644 --- a/app/service/adapter/oldErrAdapter.ts +++ b/app/service/adapter/oldErrAdapter.ts @@ -154,8 +154,6 @@ export class VideoSegmentEntityAdapter { // 创建VideoSegmentEntity const entity: VideoSegmentEntity = { id: `video_mock_${index}`, // 生成临时ID,包含索引 - updatedAt: Date.now(), - loadingProgress: status === 1 ? 100 : status === 0 ? 50 : 0, // 已完成100%,进行中50%,失败0% name: `视频片段_${index}`, // 生成临时名称,包含索引 sketchUrl: "", // 后端数据中没有sketchUrl,设为空字符串 videoUrl: result.videos, diff --git a/app/service/domain/Entities.ts b/app/service/domain/Entities.ts index d008fc9..a1b6920 100644 --- a/app/service/domain/Entities.ts +++ b/app/service/domain/Entities.ts @@ -11,17 +11,14 @@ import { ContentItem, LensType, TagValueObject } from "./valueObject"; export interface BaseEntity { /** 唯一标识 */ readonly id: string; - /** 更新时间 */ - readonly updatedAt: number; - - /**loading进度 0-100 */ - loadingProgress: number; } /** * AI文本实体接口 */ -export interface AITextEntity extends BaseEntity { +export interface AITextEntity { + /** 唯一标识 */ + readonly id: string; /** 文本内容 */ content: string; } @@ -29,7 +26,9 @@ export interface AITextEntity extends BaseEntity { /** * 角色实体接口 */ -export interface RoleEntity extends BaseEntity { +export interface RoleEntity { + /** 唯一标识 */ + readonly id: string; /** 角色名称 */ name: string; /** 角色提示词 */ @@ -47,7 +46,9 @@ export interface RoleEntity extends BaseEntity { /** * 场景实体接口 */ -export interface SceneEntity extends BaseEntity { +export interface SceneEntity { + /** 唯一标识 */ + readonly id: string; /** 场景名称 */ name: string; /** 场景图片URL */ @@ -61,7 +62,9 @@ export interface SceneEntity extends BaseEntity { /** * 视频片段实体接口 */ -export interface VideoSegmentEntity extends BaseEntity { +export interface VideoSegmentEntity { + /** 唯一标识 */ + readonly id: string; /** 视频片段名称 */ name: string; /**视频片段草图Url */ @@ -70,7 +73,7 @@ export interface VideoSegmentEntity extends BaseEntity { videoUrl: { video_url: string; video_id: string; - video_status: number|null; + video_status: number | null; }[]; /**视频片段状态 0:视频加载中 1:任务已完成 2:任务失败 */ status: number; @@ -84,18 +87,20 @@ export interface VideoSegmentEntity extends BaseEntity { */ export enum ImageStoryType { /** 空文案自动生成故事 */ - autoStory = 'autoStory', + autoStory = "autoStory", /** 用户描述生成故事 */ - userStory = 'userStory', + userStory = "userStory", /** 模板故事 */ - templateStory = 'templateStory', + templateStory = "templateStory", } /** * 图片故事实体接口 * @description 表示一条图片故事及其相关信息 */ -export interface ImageStoryEntity extends BaseEntity { +export interface ImageStoryEntity { + /** 唯一标识 */ + readonly id: string; /** 图片URL */ imageUrl: string; /** 图片描述 */ @@ -109,3 +114,18 @@ export interface ImageStoryEntity extends BaseEntity { /** 故事类型 */ storyType: ImageStoryType; } + +export interface StoryTemplateEntity { + /** 唯一标识 */ + readonly id: string; + /** 故事模板名称 */ + name: string; + /** 故事模板描述 */ + description: string; + /** 故事模板图片 */ + imageUrl: string; + /** 故事模板提示词 */ + generateText: string; + /**故事角色 */ + storyRole: RoleEntity[]; +} diff --git a/app/service/domain/valueObject.ts b/app/service/domain/valueObject.ts index df2b0a8..b4c2e52 100644 --- a/app/service/domain/valueObject.ts +++ b/app/service/domain/valueObject.ts @@ -89,13 +89,9 @@ export interface TagValueObject { name: string; /** 内容标签类型 */ content: number | string; - /**loading进度 0-100 */ - loadingProgress: number; /** 颜色 */ color?: string; - /** 更新时间 */ - readonly updatedAt: number; } diff --git a/app/service/usecase/RoleEditUseCase.ts b/app/service/usecase/RoleEditUseCase.ts index ba5e6b1..28175af 100644 --- a/app/service/usecase/RoleEditUseCase.ts +++ b/app/service/usecase/RoleEditUseCase.ts @@ -71,8 +71,6 @@ export class RoleEditUseCase { generateText: char.character_description || '', tags: [], // 默认为空标签数组 imageUrl: char.image_path || '', // 使用API返回的图片路径 - loadingProgress: 100, // 默认加载完成 - updatedAt: Date.now(), fromDraft: false, isChangeRole: false }; @@ -107,7 +105,6 @@ export class RoleEditUseCase { ...draftRoleList[char.character_name], fromDraft: true, id: `role_${index + 1}`, - updatedAt: Date.now(), }; } /** 角色实体对象 */ @@ -118,17 +115,13 @@ export class RoleEditUseCase { tags: Array.isArray(char.highlights) ? char.highlights.map((highlight: string) => ({ id: `tag_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, - updatedAt: Date.now(), /** 名称 */ name: highlight, /** 内容 */ content: highlight, - loadingProgress: 100, })) : [], imageUrl: char.image_path || '', - loadingProgress: 100, - updatedAt: Date.now(), fromDraft: false, isChangeRole: false }; @@ -158,8 +151,6 @@ export class RoleEditUseCase { generateText: char.brief || '', tags: [], // 相似角色接口可能不返回标签,暂时为空 imageUrl: char.avatar || '', - loadingProgress: 100, - updatedAt: Date.now(), fromDraft: false, isChangeRole: false }; @@ -245,14 +236,10 @@ export class RoleEditUseCase { generateText: characterData.character_description, tags: (characterData.highlights || []).map(highlight => ({ id: `tag_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`, - updatedAt: Date.now(), name: highlight, content: highlight, - loadingProgress: 100, })), // 将高亮关键词转换为TagValueObject格式 imageUrl: characterData.image_url || '', - loadingProgress: 100, - updatedAt: Date.now(), fromDraft: false, isChangeRole: true }; @@ -434,8 +421,6 @@ export class RoleEditUseCase { name: highlight, /** 内容 */ content: highlight, - loadingProgress: 100, - updatedAt: Date.now(), })), }; diff --git a/components/ui/shot-tab-content.tsx b/components/ui/shot-tab-content.tsx index c4e6e59..9e29850 100644 --- a/components/ui/shot-tab-content.tsx +++ b/components/ui/shot-tab-content.tsx @@ -129,8 +129,6 @@ export function ShotTabContent({ imageUrl: person.imageUrl, fromDraft: false, // 默认不是来自草稿箱 isChangeRole: true, // 默认没有发生角色形象的变更 - updatedAt: Date.now(), // 使用当前时间戳 - loadingProgress: 100 // 已完成加载 }; console.log('role', role); setSelectedRole(role);