listo login operador, falta prueba, y admin
This commit is contained in:
@@ -1,25 +1,31 @@
|
||||
import { Body, Controller, Post } from '@nestjs/common';
|
||||
import { AuthService } from './auth.service';
|
||||
import { AuthLoginAdminDto } from './dto/auth-login-admin.dto';
|
||||
import { AuthLoginOperadorDto } from './dto/auth-login-operador.dto';
|
||||
import { AuthLoginUsuarioDto } from './dto/auth-login-usuario.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('auth')
|
||||
@ApiTags('auth')
|
||||
export class AuthController {
|
||||
constructor(private authService: AuthService) {}
|
||||
|
||||
@Post('login_operador')
|
||||
@Post('login-admin')
|
||||
loginAdmin(@Body() body: AuthLoginAdminDto) {
|
||||
return this.authService.loginAdmin(body.operador, body.password);
|
||||
}
|
||||
|
||||
@Post('login-operador')
|
||||
loginOperador(@Body() body: AuthLoginOperadorDto) {
|
||||
return this.authService.loginOperador(
|
||||
Number(body.id_institucion),
|
||||
Number(body.id_modulo),
|
||||
body.id_institucion,
|
||||
body.id_modulo,
|
||||
body.operador,
|
||||
body.password,
|
||||
);
|
||||
}
|
||||
|
||||
@Post('login_usuario')
|
||||
@Post('login-usuario')
|
||||
loginUsuario(@Body() body: AuthLoginUsuarioDto) {
|
||||
return this.authService.loginUsuario(body.usuario, body.password);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user