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,
HttpStatus,
} from '@nestjs/common';
import { IsString, IsNotEmpty, IsOptional } from 'class-validator';
import { AuthService } from './auth.service';
class CreateAnonymousDto {
fingerprint: string;
@IsOptional()
@IsString()
fingerprint?: string;
}
class SendCodeDto {
@IsNotEmpty()
@IsString()
phone: string;
}
class VerifyCodeDto {
@IsNotEmpty()
@IsString()
phone: string;
@IsNotEmpty()
@IsString()
code: string;
}
class RefreshTokenDto {
@IsNotEmpty()
@IsString()
token: string;
}