108 lines
2.2 KiB
TypeScript

/**
* 实体接口定义
* 所有实体都应该实现这些基础接口
*/
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 {
/** 文本内容 */
content: string;
}
/**
* 角色实体接口
*/
export interface RoleEntity extends BaseEntity {
/** 角色名称 */
name: string;
/** 角色提示词 */
generateText: string;
/**角色标签 */
tags: TagValueObject[];
/** 角色图片URL */
imageUrl: string;
/**来源于草稿箱 */
fromDraft: boolean;
/**发生角色形象的生成或者替换 */
isChangeRole: boolean;
}
/**
* 场景实体接口
*/
export interface SceneEntity extends BaseEntity {
/** 场景名称 */
name: string;
/** 场景图片URL */
imageUrl: string;
/** 场景标签 */
tagIds: TagValueObject[];
/** 场景提示词 */
generateText: string;
}
/**
* 视频片段实体接口
*/
export interface VideoSegmentEntity extends BaseEntity {
/** 视频片段名称 */
name: string;
/**视频片段草图Url */
sketchUrl: string;
/**视频片段视频Url */
videoUrl: string[];
/**视频片段状态 0:视频加载中 1:任务已完成 2:任务失败 */
status: 0 | 1 | 2;
/**镜头项 */
lens: LensType[];
}
/**
* 图片故事类型枚举
* @description 标识图片故事的来源类型
*/
export enum ImageStoryType {
/** 空文案自动生成故事 */
autoStory = 'autoStory',
/** 用户描述生成故事 */
userStory = 'userStory',
/** 模板故事 */
templateStory = 'templateStory',
}
/**
* 图片故事实体接口
* @description 表示一条图片故事及其相关信息
*/
export interface ImageStoryEntity extends BaseEntity {
/** 图片URL */
imageUrl: string;
/** 图片描述 */
imageDescription: string;
/** 图片故事内容 */
imageStory: string;
/** 图片故事剧本 */
imageScript: string;
/** 故事涉及的角色 */
storyRole: RoleEntity[];
/** 故事类型 */
storyType: ImageStoryType;
}