Files
dukang/server/dukang-api/src/modules/iam/dto/auth.dto.ts
T
2026-07-06 13:18:56 +08:00

71 lines
1.0 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;
}