forked from yoone/API
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { ApiProperty } from '@midwayjs/swagger';
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
import { SubscriptionStatus } from '../enums/base.enum';
|
|
|
|
// 订阅列表查询参数(分页与筛选)
|
|
export class QuerySubscriptionDTO {
|
|
// 当前页码(从 1 开始)
|
|
@ApiProperty({ example: 1, description: '页码' })
|
|
@Rule(RuleType.number().default(1))
|
|
current: number;
|
|
|
|
// 每页数量
|
|
@ApiProperty({ example: 10, description: '每页大小' })
|
|
@Rule(RuleType.number().default(10))
|
|
pageSize: number;
|
|
|
|
// 站点 ID(可选)
|
|
@ApiProperty({ description: '站点ID' })
|
|
@Rule(RuleType.string().allow(''))
|
|
siteId: string;
|
|
|
|
// 订阅状态筛选(可选),支持枚举值
|
|
@ApiProperty({ description: '订阅状态', enum: SubscriptionStatus })
|
|
@Rule(RuleType.string().valid(...Object.values(SubscriptionStatus)).allow(''))
|
|
status: SubscriptionStatus | '';
|
|
|
|
// 客户邮箱(模糊匹配,可选)
|
|
@ApiProperty({ description: '客户邮箱' })
|
|
@Rule(RuleType.string().allow(''))
|
|
customer_email: string;
|
|
|
|
// 关键字(订阅ID,邮箱等,模糊匹配,可选)
|
|
@ApiProperty({ description: '关键字(订阅ID,邮箱等)' })
|
|
@Rule(RuleType.string().allow(''))
|
|
keyword: string;
|
|
} |