bdf80e577b
CI / verify (pull_request) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
132 lines
2.0 KiB
TypeScript
132 lines
2.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';
|
|
}
|
|
|
|
/** 小程序 getPhoneNumber 返回的 phoneCode,可选附带 wx.login code 绑定 openId */
|
|
export class LoginWechatPhoneDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
phoneCode: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
loginCode?: 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';
|
|
}
|
|
|
|
export class MiniWechatProfileDto {
|
|
@IsString()
|
|
@IsOptional()
|
|
nickname?: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
avatarUrl?: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
avatarResourceId?: string;
|
|
}
|
|
|
|
export class CheckPartnerPhoneDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
phone: string;
|
|
}
|