mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
1.0.0
This commit is contained in:
34
src/dto/user.dto.ts
Normal file
34
src/dto/user.dto.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ApiProperty, OmitType } from "@nestjs/swagger";
|
||||
import {
|
||||
IsJWT,
|
||||
IsMongoId,
|
||||
IsString,
|
||||
MaxLength,
|
||||
MinLength,
|
||||
} from "class-validator";
|
||||
|
||||
export class UserDto {
|
||||
@ApiProperty({ description: "Идентификатор (ObjectId)" })
|
||||
@IsMongoId()
|
||||
id: string;
|
||||
@ApiProperty({ example: "n08i40k", description: "Имя" })
|
||||
@IsString()
|
||||
@MinLength(4)
|
||||
@MaxLength(10)
|
||||
username: string;
|
||||
@ApiProperty({ description: "Соль пароля" })
|
||||
@IsString()
|
||||
salt: string;
|
||||
@ApiProperty({ description: "Хеш пароля" })
|
||||
@IsString()
|
||||
password: string;
|
||||
@ApiProperty({ description: "Последний токен доступа" })
|
||||
@IsJWT()
|
||||
access_token: string;
|
||||
}
|
||||
|
||||
export class ClientUserDto extends OmitType(UserDto, [
|
||||
"password",
|
||||
"salt",
|
||||
"access_token",
|
||||
]) {}
|
||||
Reference in New Issue
Block a user