fix(user-service): add class-validator decorators to auth DTOs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-09 21:01:54 -08:00
parent f87c089ca2
commit 3efce36f92
1 changed files with 13 additions and 1 deletions

View File

@ -6,22 +6,34 @@ import {
HttpCode, HttpCode,
HttpStatus, HttpStatus,
} from '@nestjs/common'; } from '@nestjs/common';
import { IsString, IsNotEmpty, IsOptional } from 'class-validator';
import { AuthService } from './auth.service'; import { AuthService } from './auth.service';
class CreateAnonymousDto { class CreateAnonymousDto {
fingerprint: string; @IsOptional()
@IsString()
fingerprint?: string;
} }
class SendCodeDto { class SendCodeDto {
@IsNotEmpty()
@IsString()
phone: string; phone: string;
} }
class VerifyCodeDto { class VerifyCodeDto {
@IsNotEmpty()
@IsString()
phone: string; phone: string;
@IsNotEmpty()
@IsString()
code: string; code: string;
} }
class RefreshTokenDto { class RefreshTokenDto {
@IsNotEmpty()
@IsString()
token: string; token: string;
} }