usuario con dgae y dgp a espera de ver la conexión con degae y dgp
This commit is contained in:
@@ -22,15 +22,40 @@ import { UsuarioDto } from './dto/usuario.dto';
|
||||
export class UsuarioController {
|
||||
constructor(private usuarioService: UsuarioService) {}
|
||||
|
||||
/* Pendiente por conexión */
|
||||
// @Get('dgae')
|
||||
// dgae(@Query() query: UsuarioDgaeDto) {
|
||||
// return this.usuarioService.dgaeDgp(query.usuario);
|
||||
// }
|
||||
// @Get('dgp')
|
||||
// dgp(@Query() query: UsuarioDgpDto) {
|
||||
// return this.usuarioService.dgaeDgp(query.usuario);
|
||||
// }
|
||||
@Get('dgae')
|
||||
@ApiOperation({
|
||||
description: 'Endpoint que retorna información de dgae de un alumno.',
|
||||
})
|
||||
@ApiQuery({
|
||||
description: 'Número de cuenta del alumno.',
|
||||
name: 'usuario',
|
||||
type: 'string',
|
||||
})
|
||||
@ApiQuery({
|
||||
description: 'Id de la carrera institución a la que pertenece el alumno.',
|
||||
name: 'id_institucion_carrera',
|
||||
type: 'string',
|
||||
})
|
||||
dgae(@Query() query: UsuarioDgaeDto) {
|
||||
return this.usuarioService.DGAE(
|
||||
query.usuario,
|
||||
parseInt(query.id_institucion_carrera),
|
||||
);
|
||||
}
|
||||
|
||||
@Get('dgp')
|
||||
@ApiOperation({
|
||||
description: 'Endpoint que retorna información de dgp de un profesor.',
|
||||
})
|
||||
@ApiQuery({
|
||||
description: 'Número de cuenta del profesor.',
|
||||
name: 'usuario',
|
||||
type: 'string',
|
||||
})
|
||||
@ApiQuery({ description: 'RFC del profesor.', name: 'rfc', type: 'string' })
|
||||
dgp(@Query() query: UsuarioDgpDto) {
|
||||
return this.usuarioService.DGP(query.usuario, query.rfc);
|
||||
}
|
||||
|
||||
@Post('registrar')
|
||||
@ApiOperation({
|
||||
|
||||
@@ -75,31 +75,22 @@ export class UsuarioService {
|
||||
<p>Pc Puma Solicita</p>`;
|
||||
}
|
||||
|
||||
dgaeDgp(usuario: string) {
|
||||
// return this.findByUsuario(usuario).then(async (existeUsuario) => {
|
||||
// if (!existeUsuario) {
|
||||
// let esAlumno = false;
|
||||
DGAE(usuario: string, id_institucion_carrera: number) {
|
||||
return this.findByUsuario(usuario).then(async (existeUsuario) => {
|
||||
/* Falta conexión a soap */
|
||||
if (existeUsuario.password)
|
||||
throw new ConflictException('Ya fue regisrado este usuario.');
|
||||
return existeUsuario;
|
||||
});
|
||||
}
|
||||
|
||||
// await this.soapClientService
|
||||
// .dgp(usuario)
|
||||
// .then((res) => {
|
||||
// if (!res) return this.soapClientService.dgp(usuario);
|
||||
// esAlumno = true;
|
||||
// return res;
|
||||
// })
|
||||
// .then((res) => {
|
||||
// if (!res)
|
||||
// throw new ConflictException('No es un número de cuenta válido.');
|
||||
|
||||
// // const data = {usuario,id_institucion:200,};
|
||||
// // return this.create(usuario,, 5);
|
||||
// });
|
||||
// }
|
||||
// if (existeUsuario.password)
|
||||
// throw new ConflictException('Ya fue regisrado este usuario.');
|
||||
// return existeUsuario;
|
||||
// });
|
||||
return { message: 'Pendiente' };
|
||||
DGP(usuario: string, rfc: string) {
|
||||
return this.findByUsuario(usuario).then(async (existeUsuario) => {
|
||||
/* Falta conexión a soap */
|
||||
if (existeUsuario.password)
|
||||
throw new ConflictException('Ya fue regisrado este usuario.');
|
||||
return existeUsuario;
|
||||
});
|
||||
}
|
||||
|
||||
async findAll(filtros: {
|
||||
|
||||
Reference in New Issue
Block a user