注册必填 7-32 位账号,手机号区号/本地号分存;登录默认账号模式并支持切换手机号登录;Player i18n 拆包与赛事接口优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
75 lines
1.5 KiB
TypeScript
75 lines
1.5 KiB
TypeScript
import { IsString, MinLength, IsOptional, IsNumber } from 'class-validator';
|
||
import { ApiProperty } from '@nestjs/swagger';
|
||
|
||
export class LoginDto {
|
||
@ApiProperty()
|
||
@IsString()
|
||
username!: string;
|
||
|
||
@ApiProperty()
|
||
@IsString()
|
||
@MinLength(1)
|
||
password!: string;
|
||
|
||
@ApiProperty({ required: false, description: '国家区号,不含 +,如 86' })
|
||
@IsOptional()
|
||
@IsString()
|
||
countryCode?: string;
|
||
}
|
||
|
||
export class RegisterDto {
|
||
@ApiProperty({ description: '登录账号,7-32 位字母数字' })
|
||
@IsString()
|
||
@MinLength(7)
|
||
username!: string;
|
||
|
||
@ApiProperty({ description: '本地手机号,不含国家区号' })
|
||
@IsString()
|
||
phone!: string;
|
||
|
||
@ApiProperty({ description: '国家区号,不含 +,如 86' })
|
||
@IsString()
|
||
countryCode!: string;
|
||
|
||
@ApiProperty()
|
||
@IsString()
|
||
@MinLength(8)
|
||
password!: string;
|
||
|
||
@ApiProperty({ description: '短信验证码' })
|
||
@IsString()
|
||
smsCode!: string;
|
||
|
||
@ApiProperty({ description: '发送验证码返回的 sessionId' })
|
||
@IsString()
|
||
sessionId!: string;
|
||
|
||
@ApiProperty({ required: false })
|
||
@IsOptional()
|
||
@IsString()
|
||
inviteCode?: string;
|
||
|
||
@ApiProperty({ required: false })
|
||
@IsOptional()
|
||
@IsString()
|
||
locale?: string;
|
||
}
|
||
|
||
export class ChangePasswordDto {
|
||
@ApiProperty()
|
||
@IsString()
|
||
oldPassword!: string;
|
||
|
||
@ApiProperty()
|
||
@IsString()
|
||
@MinLength(8)
|
||
newPassword!: string;
|
||
}
|
||
|
||
export class GenerateInviteDto {
|
||
@ApiProperty({ required: false, description: 'Decimal cashback rate, e.g. 0.01 = 1%. Admin only.' })
|
||
@IsOptional()
|
||
@IsNumber()
|
||
cashbackRate?: number;
|
||
}
|