auth documentacion
This commit is contained in:
parent
8ea1b09139
commit
05627b3aa9
@ -1,9 +1,9 @@
|
|||||||
import { Body, Controller, Post } from '@nestjs/common';
|
import { Body, Controller, Post } from '@nestjs/common';
|
||||||
|
import { ApiBody, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
import { AuthLoginAdminDto } from './dto/auth-login-admin.dto';
|
import { AuthLoginAdminDto } from './dto/auth-login-admin.dto';
|
||||||
import { AuthLoginOperadorDto } from './dto/auth-login-operador.dto';
|
import { AuthLoginOperadorDto } from './dto/auth-login-operador.dto';
|
||||||
import { AuthLoginUsuarioDto } from './dto/auth-login-usuario.dto';
|
import { AuthLoginUsuarioDto } from './dto/auth-login-usuario.dto';
|
||||||
import { ApiTags } from '@nestjs/swagger';
|
|
||||||
|
|
||||||
@Controller('auth')
|
@Controller('auth')
|
||||||
@ApiTags('auth')
|
@ApiTags('auth')
|
||||||
@ -11,11 +11,41 @@ export class AuthController {
|
|||||||
constructor(private authService: AuthService) {}
|
constructor(private authService: AuthService) {}
|
||||||
|
|
||||||
@Post('login-admin')
|
@Post('login-admin')
|
||||||
|
@ApiOperation({
|
||||||
|
description: 'Endpoint utilizado para el login del panel admin.',
|
||||||
|
})
|
||||||
|
@ApiBody({
|
||||||
|
description: 'Todas las variables son obligatorias.',
|
||||||
|
examples: {
|
||||||
|
ejemplo: {
|
||||||
|
value: {
|
||||||
|
operador: '',
|
||||||
|
password: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
loginAdmin(@Body() body: AuthLoginAdminDto) {
|
loginAdmin(@Body() body: AuthLoginAdminDto) {
|
||||||
return this.authService.loginAdmin(body.operador, body.password);
|
return this.authService.loginAdmin(body.operador, body.password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post('login-operador')
|
@Post('login-operador')
|
||||||
|
@ApiOperation({
|
||||||
|
description: 'Endpoint utilizado para el login del panel del operador.',
|
||||||
|
})
|
||||||
|
@ApiBody({
|
||||||
|
description: 'Todas las variables son obligatorias.',
|
||||||
|
examples: {
|
||||||
|
ejemplo: {
|
||||||
|
value: {
|
||||||
|
operador: '',
|
||||||
|
password: '',
|
||||||
|
id_institucion: 200,
|
||||||
|
id_modulo: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
loginOperador(@Body() body: AuthLoginOperadorDto) {
|
loginOperador(@Body() body: AuthLoginOperadorDto) {
|
||||||
return this.authService.loginOperador(
|
return this.authService.loginOperador(
|
||||||
body.id_institucion,
|
body.id_institucion,
|
||||||
@ -26,6 +56,11 @@ export class AuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Post('login-usuario')
|
@Post('login-usuario')
|
||||||
|
@ApiOperation({ description: 'Endpoint utilizado para el login del usuario.' })
|
||||||
|
@ApiBody({
|
||||||
|
description: 'Todas las variables son obligatorias.',
|
||||||
|
examples: { ejemplo: { value: { usuario: '', password: '' } } },
|
||||||
|
})
|
||||||
loginUsuario(@Body() body: AuthLoginUsuarioDto) {
|
loginUsuario(@Body() body: AuthLoginUsuarioDto) {
|
||||||
return this.authService.loginUsuario(body.usuario, body.password);
|
return this.authService.loginUsuario(body.usuario, body.password);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user