| 1 | import { createZodDto, PaginationDtoSchema } from '@yikart/common' |
| 2 | import { AiLogChannel, AiLogStatus, AiLogType } from '@yikart/mongodb' |
| 3 | import { z } from 'zod' |
| 4 | |
| 5 | // 日志列表查询参数 |
| 6 | export const logListQuerySchema = z.object({ |
| 7 | type: z.enum(AiLogType).optional().describe('日志类型'), |
| 8 | status: z.enum(AiLogStatus).optional().describe('日志状态'), |
| 9 | channel: z.enum(AiLogChannel).optional().describe('渠道'), |
| 10 | model: z.string().optional().describe('模型名称'), |
| 11 | ...PaginationDtoSchema.shape, |
| 12 | }) |
| 13 | |
| 14 | export class LogListQueryDto extends createZodDto(logListQuerySchema) {} |
| 15 | |
| 16 | // 日志详情查询请求 |
| 17 | const logDetailQuerySchema = z.object({ |
| 18 | id: z.string().min(1).describe('日志ID'), |
| 19 | }) |
| 20 | |
| 21 | export class LogDetailQueryDto extends createZodDto(logDetailQuerySchema) {} |
| 22 |