add openapi decorators
This commit is contained in:
parent
4b025b9ec7
commit
ea74d34363
@ -1,9 +1,12 @@
|
||||
import { IsString } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class LoginRequestDto {
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
username: string;
|
||||
|
||||
@IsString()
|
||||
@ApiProperty()
|
||||
password: string;
|
||||
}
|
||||
|
||||
@ -1,14 +1,18 @@
|
||||
import { IsString, IsEmail, MinLength } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class CreateUserDto {
|
||||
@IsString()
|
||||
@MinLength(3)
|
||||
@ApiProperty()
|
||||
username: string;
|
||||
|
||||
@IsEmail()
|
||||
@ApiProperty()
|
||||
email: string;
|
||||
|
||||
@IsString()
|
||||
@MinLength(6)
|
||||
@ApiProperty()
|
||||
password: string;
|
||||
}
|
||||
|
||||
@ -1,17 +1,24 @@
|
||||
import { IsString, IsEmail, MinLength, IsOptional } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class UpdateUserDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MinLength(3)
|
||||
@ApiProperty()
|
||||
username?: string;
|
||||
|
||||
|
||||
@IsOptional()
|
||||
@IsEmail()
|
||||
@ApiProperty()
|
||||
email?: string;
|
||||
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MinLength(6)
|
||||
@ApiProperty()
|
||||
password?: string;
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user