| 1 | import { createZodDto } from '@yikart/common' |
| 2 | import { z } from 'zod' |
| 3 | |
| 4 | export const ChannelAccountGroupCreateSchema = z.object({ |
| 5 | name: z.string().min(1).describe('分组名称'), |
| 6 | rank: z.number().optional().describe('排序值'), |
| 7 | ip: z.string().optional().describe('IP'), |
| 8 | location: z.string().optional().describe('位置'), |
| 9 | countryCode: z.string().optional().describe('国家代码'), |
| 10 | proxyIp: z.string().optional().describe('代理 IP'), |
| 11 | browserConfig: z.record(z.string(), z.unknown()).optional().describe('浏览器指纹配置'), |
| 12 | }) |
| 13 | |
| 14 | export class ChannelAccountGroupCreateDto extends createZodDto(ChannelAccountGroupCreateSchema) {} |
| 15 | |
| 16 | export const ChannelAccountGroupUpdateSchema = ChannelAccountGroupCreateSchema.partial() |
| 17 | |
| 18 | export class ChannelAccountGroupUpdateDto extends createZodDto(ChannelAccountGroupUpdateSchema) {} |
| 19 | |
| 20 | export const ChannelAccountGroupDeleteQuerySchema = z.object({ |
| 21 | ids: z.array(z.string().min(1)).min(1).describe('分组 ID 数组'), |
| 22 | }) |
| 23 | |
| 24 | export class ChannelAccountGroupDeleteQueryDto extends createZodDto(ChannelAccountGroupDeleteQuerySchema) {} |
| 25 | |
| 26 | export const ChannelAccountGroupRankItemSchema = z.object({ |
| 27 | id: z.string().min(1).describe('账号 ID'), |
| 28 | rank: z.number().describe('排序值'), |
| 29 | }) |
| 30 | |
| 31 | export const ChannelAccountGroupRankUpdateSchema = z.object({ |
| 32 | list: z.array(ChannelAccountGroupRankItemSchema).describe('排序列表'), |
| 33 | }) |
| 34 | |
| 35 | export class ChannelAccountGroupRankUpdateDto extends createZodDto(ChannelAccountGroupRankUpdateSchema) {} |
| 36 |