49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
|
|
import { ApiProperty } from '@nestjs/swagger';
|
||
|
|
import { IsOptional, IsString, IsNumber } from 'class-validator';
|
||
|
|
|
||
|
|
export class CaptchaCreateDto {
|
||
|
|
@ApiProperty({ description: '验证码类型', required: false })
|
||
|
|
@IsOptional()
|
||
|
|
@IsString()
|
||
|
|
type?: string;
|
||
|
|
|
||
|
|
@ApiProperty({ description: '验证码长度', required: false })
|
||
|
|
@IsOptional()
|
||
|
|
@IsNumber()
|
||
|
|
length?: number;
|
||
|
|
|
||
|
|
@ApiProperty({ description: '验证码宽度', required: false })
|
||
|
|
@IsOptional()
|
||
|
|
@IsNumber()
|
||
|
|
width?: number;
|
||
|
|
|
||
|
|
@ApiProperty({ description: '验证码高度', required: false })
|
||
|
|
@IsOptional()
|
||
|
|
@IsNumber()
|
||
|
|
height?: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export class CaptchaCheckDto {
|
||
|
|
@ApiProperty({ description: '验证码ID' })
|
||
|
|
@IsString()
|
||
|
|
captchaId: string;
|
||
|
|
|
||
|
|
@ApiProperty({ description: '验证码值' })
|
||
|
|
@IsString()
|
||
|
|
captchaValue: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export class CaptchaVerificationDto {
|
||
|
|
@ApiProperty({ description: '验证码ID' })
|
||
|
|
@IsString()
|
||
|
|
captchaId: string;
|
||
|
|
|
||
|
|
@ApiProperty({ description: '验证码值' })
|
||
|
|
@IsString()
|
||
|
|
captchaValue: string;
|
||
|
|
|
||
|
|
@ApiProperty({ description: '二次验证参数', required: false })
|
||
|
|
@IsOptional()
|
||
|
|
params?: Record<string, any>;
|
||
|
|
}
|