返回 AiToEarn
agent-asset.ts
根目录 / project / aitoearn-web / src / types / agent-asset.ts
1 /**
2 * AI 生成素材类型定义
3 * 定义 AI 生成的图片/视频资源类型
4 */
5
6 /**
7 * Asset 类型枚举
8 * - aiImage: AI 生成的图片
9 * - aiVideo: AI 生成的视频
10 * - aiCard: AI 生成的卡片
11 * - aiChatImage: AI 聊天中生成的图片
12 * - aideoOutput: AI 视频输出
13 * - videoEdit: 视频编辑
14 * - dramaRecap: 剧情回顾
15 * - styleTransfer: 风格迁移
16 */
17 export type AssetType
18 = | 'aiImage'
19 | 'aiVideo'
20 | 'aiCard'
21 | 'aiChatImage'
22 | 'aideoOutput'
23 | 'videoEdit'
24 | 'dramaRecap'
25 | 'styleTransfer'
26 | string // 支持扩展其他类型
27
28 /**
29 * Asset 元数据
30 */
31 export interface AssetMetadata {
32 /** 图片/视频宽度 */
33 width?: number
34 /** 图片/视频高度 */
35 height?: number
36 /** 视频时长(秒) */
37 duration?: number
38 /** 视频封面 URL */
39 cover?: string
40 /** 其他扩展字段 */
41 [key: string]: unknown
42 }
43
44 /**
45 * Asset 单项
46 */
47 export interface AssetVo {
48 /** 资源 ID */
49 id: string
50 /** 资源 URL */
51 url: string
52 /** 资源类型 */
53 type: AssetType
54 /** MIME 类型 */
55 mimeType: string
56 /** 文件名 */
57 filename?: string
58 /** 元数据 */
59 metadata?: AssetMetadata
60 /** 文件路径 */
61 path?: string
62 /** 文件大小(字节) */
63 size?: number
64 /** 状态 */
65 status?: string
66 /** 用户类型 */
67 userType?: string
68 /** 创建时间 */
69 createdAt: string
70 /** 更新时间 */
71 updatedAt?: string
72 /** 用户 ID */
73 userId?: string
74 }
75
76 /**
77 * Asset 列表响应
78 */
79 export interface AssetListVo {
80 /** 当前页码 */
81 page: number
82 /** 每页数量 */
83 pageSize: number
84 /** 总数 */
85 total: number
86 /** 资源列表 */
87 list: AssetVo[]
88 }
89
90 /**
91 * 视频类型的 AssetType 列表
92 */
93 export const VIDEO_ASSET_TYPES: AssetType[] = [
94 'aiVideo',
95 'aideoOutput',
96 'videoEdit',
97 'dramaRecap',
98 'styleTransfer',
99 ]
100
101 /**
102 * 图片类型的 AssetType 列表
103 */
104 export const IMAGE_ASSET_TYPES: AssetType[] = ['aiImage', 'aiCard', 'aiChatImage']
105
105 lines TYPESCRIPT