forked from Yara724/api
Initial commit after migration to gitea
This commit is contained in:
41
src/auth/dto/actor/login.actor.dto.ts
Normal file
41
src/auth/dto/actor/login.actor.dto.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { RoleEnum } from "src/Types&Enums/role.enum";
|
||||
|
||||
export class LoginActorDto {
|
||||
@ApiProperty({ example: RoleEnum, type: "array", description: "LOGIN_DTO" })
|
||||
role: RoleEnum[];
|
||||
|
||||
@ApiProperty({})
|
||||
username: string;
|
||||
|
||||
@ApiProperty({})
|
||||
password: string;
|
||||
}
|
||||
|
||||
export class LoginActorDtoRs extends LoginActorDto {
|
||||
private readonly userId;
|
||||
constructor(userData) {
|
||||
super();
|
||||
this.userId = userData._id;
|
||||
this.role = userData.role;
|
||||
this.username = userData.email;
|
||||
this.clientKey = userData.clientKey;
|
||||
this.token = userData.token;
|
||||
this.refreshToken = userData.refreshToken;
|
||||
}
|
||||
|
||||
@ApiProperty({ type: "string", description: "LOGIN_DTO_RS" })
|
||||
fullName: string;
|
||||
|
||||
@ApiProperty({ type: "string", description: "LOGIN_DTO_RS" })
|
||||
role: RoleEnum[];
|
||||
|
||||
@ApiProperty({ type: "string", description: "LOGIN_DTO_RS" })
|
||||
token: string;
|
||||
|
||||
@ApiProperty({ type: "string", description: "LOGIN_DTO_RS" })
|
||||
refreshToken: string;
|
||||
|
||||
@ApiProperty({ type: "string", description: "LOGIN_DTO_RS" })
|
||||
clientKey: string;
|
||||
}
|
||||
Reference in New Issue
Block a user