| 1 | import { AccountType, createZodDto } from '@yikart/common' |
| 2 | import { PublishRecordLinkStatus, PublishStatus } from '@yikart/mongodb' |
| 3 | import { z } from 'zod' |
| 4 | |
| 5 | export const ChannelPublishFlowTaskVoSchema = z.object({ |
| 6 | id: z.string().describe('发布任务 ID'), |
| 7 | accountId: z.string().describe('账号 ID'), |
| 8 | platform: z.enum(AccountType).describe('平台'), |
| 9 | status: z.enum(PublishStatus).optional().describe('发布状态'), |
| 10 | publishTime: z.coerce.date().optional().describe('发布时间'), |
| 11 | platformWorkId: z.string().optional().describe('平台作品 ID'), |
| 12 | workLink: z.string().optional().describe('作品链接'), |
| 13 | linkStatus: z.enum(PublishRecordLinkStatus).optional().describe('作品链接状态'), |
| 14 | linkError: z.string().optional().describe('作品链接获取错误'), |
| 15 | linkMeta: z.record(z.string(), z.any()).optional().describe('作品链接扩展信息'), |
| 16 | errorMsg: z.string().optional().describe('错误信息'), |
| 17 | }) |
| 18 | |
| 19 | export const ChannelPublishFlowVoSchema = z.object({ |
| 20 | flowId: z.string().describe('发布 Flow ID'), |
| 21 | tasks: z.array(ChannelPublishFlowTaskVoSchema).describe('发布任务列表'), |
| 22 | }) |
| 23 | |
| 24 | export class ChannelPublishFlowVo extends createZodDto( |
| 25 | ChannelPublishFlowVoSchema, |
| 26 | 'ChannelPublishFlowVo', |
| 27 | ) {} |
| 28 |