a66207ffa9
代码核销功能
96 lines
1.4 KiB
TypeScript
96 lines
1.4 KiB
TypeScript
import { IsIn, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
import { SmsScene } from '@dukang/shared-types';
|
|
|
|
export class SendSmsDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
phone: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@IsIn(Object.values(SmsScene))
|
|
scene: string;
|
|
}
|
|
|
|
export class LoginSmsDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
phone: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
code: string;
|
|
}
|
|
|
|
export class BootstrapSessionDto {
|
|
@IsString()
|
|
@IsOptional()
|
|
deviceKey?: string;
|
|
}
|
|
|
|
export class RefreshTokenDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
refreshToken: string;
|
|
}
|
|
|
|
export class BindPhoneDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
phone: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
code: string;
|
|
}
|
|
|
|
export class LoginWechatDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
code: string;
|
|
|
|
@IsString()
|
|
@IsIn(['h5', 'mini'])
|
|
@IsOptional()
|
|
platform?: 'h5' | 'mini';
|
|
}
|
|
|
|
export class BindWechatPhoneDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
wxSessionKey: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
phone: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
code: string;
|
|
}
|
|
|
|
export class LoginPasswordDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
loginName: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
password: string;
|
|
}
|
|
|
|
export class BindWechatDto {
|
|
@IsString()
|
|
@IsOptional()
|
|
code?: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
wxSessionKey?: string;
|
|
|
|
@IsString()
|
|
@IsIn(['h5', 'mini'])
|
|
@IsOptional()
|
|
platform?: 'h5' | 'mini';
|
|
}
|