forked from fga-eps-mds/2024.1-CALCULUS-UserService
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from fga-eps-mds/feat#95/conf-swagger
[FEAT] Adiciona Swagger à API (fga-eps-mds/2024.2-ARANDU-DOC#95)
- Loading branch information
Showing
31 changed files
with
235 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { SetMetadata } from '@nestjs/common'; | ||
import { UserRole } from 'src/users/dtos/user-role.enum'; | ||
import { UserRole } from 'src/dtos/user-role.enum'; | ||
|
||
export const Roles = (...roles: UserRole[]) => SetMetadata('roles', roles); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsString, MinLength } from 'class-validator'; | ||
|
||
export class ChangePasswordDto { | ||
|
||
@ApiProperty({ | ||
example: 'SenhaAntiga123', | ||
required: true | ||
}) | ||
@IsString() | ||
oldPassword: string; | ||
|
||
@ApiProperty({ | ||
example: 'SenhaNova123', | ||
required: true | ||
}) | ||
@IsString() | ||
@MinLength(6) | ||
newPassword: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsEmail, IsNotEmpty } from 'class-validator'; | ||
|
||
export class CreateUserDtoFederated { | ||
|
||
@ApiProperty({ | ||
example: 'Nome', | ||
required: true | ||
}) | ||
@IsNotEmpty() | ||
name: string; | ||
|
||
@ApiProperty({ | ||
example: '[email protected]', | ||
required: true | ||
}) | ||
@IsEmail() | ||
@IsNotEmpty() | ||
email: string; | ||
|
||
@ApiProperty({ | ||
example: 'Username', | ||
required: true | ||
}) | ||
@IsNotEmpty() | ||
username: string; | ||
|
||
@ApiProperty({ | ||
example: 'Senha123', | ||
required: false | ||
}) | ||
password?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsEmail, IsEnum, IsNotEmpty, IsOptional } from 'class-validator'; | ||
import { UserRole } from './user-role.enum'; | ||
|
||
export class CreateUserDto { | ||
@ApiProperty({ | ||
example: 'Nome', | ||
required: true | ||
}) | ||
@IsNotEmpty() | ||
name: string; | ||
|
||
@ApiProperty({ | ||
example: '[email protected]', | ||
required: true | ||
}) | ||
@IsEmail() | ||
@IsNotEmpty() | ||
email: string; | ||
|
||
@ApiProperty({ | ||
example: 'Username', | ||
required: true | ||
}) | ||
@IsNotEmpty() | ||
username: string; | ||
|
||
@ApiProperty({ | ||
example: 'Senha123', | ||
required: true | ||
}) | ||
@IsNotEmpty() | ||
password: string; | ||
|
||
@ApiProperty({ | ||
example: 'aluno', | ||
required: false | ||
}) | ||
@IsOptional() | ||
@IsEnum(UserRole) | ||
role?: UserRole; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsEmail } from 'class-validator'; | ||
|
||
export class ForgotPasswordDto { | ||
@ApiProperty({ | ||
example: '[email protected]', | ||
required: true | ||
}) | ||
@IsEmail() | ||
email: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
|
||
export class LoginDto { | ||
@ApiProperty({ | ||
example: '[email protected]', | ||
required: true | ||
}) | ||
readonly email: string; | ||
|
||
@ApiProperty({ | ||
example: 'Senha123', | ||
required: true | ||
}) | ||
readonly password: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsString } from 'class-validator'; | ||
|
||
export class RefreshTokenDto { | ||
|
||
@ApiProperty({ | ||
example: 'jwt_refresh_token', | ||
required: true | ||
}) | ||
@IsString() | ||
refreshToken: string; | ||
} |
9 changes: 9 additions & 0 deletions
9
src/users/dtos/reset-password.dto.ts → src/dtos/reset-password.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/users/dtos/update-role.dto.ts → src/dtos/update-role.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsEnum } from 'class-validator'; | ||
import { UserRole } from './user-role.enum'; | ||
|
||
export class UpdateRoleDto { | ||
@ApiProperty({ | ||
example: 'professor', | ||
required: true | ||
}) | ||
@IsEnum(UserRole) | ||
role: UserRole; | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.