tags de swagger
This commit is contained in:
parent
c7a6f6aaeb
commit
3eab1c937b
@ -37,4 +37,3 @@ INSERT INTO institucion_dia (id_institucion, id_dia) VALUES (2, 2);
|
||||
INSERT INTO institucion_dia (id_institucion, id_dia) VALUES (2, 3);
|
||||
INSERT INTO institucion_dia (id_institucion, id_dia) VALUES (2, 4);
|
||||
INSERT INTO institucion_dia (id_institucion, id_dia) VALUES (2, 5);
|
||||
|
||||
|
94
package-lock.json
generated
94
package-lock.json
generated
@ -16,6 +16,7 @@
|
||||
"@nestjs/passport": "^8.2.1",
|
||||
"@nestjs/platform-express": "^8.0.0",
|
||||
"@nestjs/schedule": "^1.1.0",
|
||||
"@nestjs/swagger": "^5.2.1",
|
||||
"@nestjs/typeorm": "^8.0.3",
|
||||
"bcrypt": "^5.0.1",
|
||||
"class-transformer": "^0.5.1",
|
||||
@ -28,6 +29,7 @@
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.2.0",
|
||||
"swagger-ui-express": "^4.3.0",
|
||||
"typeorm": "^0.2.45"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -1510,6 +1512,25 @@
|
||||
"@nestjs/common": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/mapped-types": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-1.0.1.tgz",
|
||||
"integrity": "sha512-NFvofzSinp00j5rzUd4tf+xi9od6383iY0JP7o0Bnu1fuItAUkWBgc4EKuIQ3D+c2QI3i9pG1kDWAeY27EMGtg==",
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^7.0.8 || ^8.0.0",
|
||||
"class-transformer": "^0.2.0 || ^0.3.0 || ^0.4.0 || ^0.5.0",
|
||||
"class-validator": "^0.11.1 || ^0.12.0 || ^0.13.0",
|
||||
"reflect-metadata": "^0.1.12"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"class-transformer": {
|
||||
"optional": true
|
||||
},
|
||||
"class-validator": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/passport": {
|
||||
"version": "8.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/passport/-/passport-8.2.1.tgz",
|
||||
@ -1632,6 +1653,31 @@
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@nestjs/swagger": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-5.2.1.tgz",
|
||||
"integrity": "sha512-7dNa08WCnTsW/oAk3Ujde+z64JMfNm19DhpXasFR8oJp/9pggYAbYU927HpA+GJsSFJX6adjIRZsCKUqaGWznw==",
|
||||
"dependencies": {
|
||||
"@nestjs/mapped-types": "1.0.1",
|
||||
"lodash": "4.17.21",
|
||||
"path-to-regexp": "3.2.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nestjs/common": "^8.0.0",
|
||||
"@nestjs/core": "^8.0.0",
|
||||
"fastify-swagger": "*",
|
||||
"reflect-metadata": "^0.1.12",
|
||||
"swagger-ui-express": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"fastify-swagger": {
|
||||
"optional": true
|
||||
},
|
||||
"swagger-ui-express": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@nestjs/testing": {
|
||||
"version": "8.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-8.4.3.tgz",
|
||||
@ -8455,6 +8501,25 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/swagger-ui-dist": {
|
||||
"version": "4.10.3",
|
||||
"resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.10.3.tgz",
|
||||
"integrity": "sha512-eR4vsd7sYo0Sx7ZKRP5Z04yij7JkNmIlUQfrDQgC+xO5ABYx+waabzN+nDsQTLAJ4Z04bjkRd8xqkJtbxr3G7w=="
|
||||
},
|
||||
"node_modules/swagger-ui-express": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-4.3.0.tgz",
|
||||
"integrity": "sha512-jN46SEEe9EoXa3ZgZoKgnSF6z0w3tnM1yqhO4Y+Q4iZVc8JOQB960EZpIAz6rNROrDApVDwcMHR0mhlnc/5Omw==",
|
||||
"dependencies": {
|
||||
"swagger-ui-dist": ">=4.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= v0.10.32"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"express": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/symbol-observable": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz",
|
||||
@ -10894,6 +10959,12 @@
|
||||
"jsonwebtoken": "8.5.1"
|
||||
}
|
||||
},
|
||||
"@nestjs/mapped-types": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-1.0.1.tgz",
|
||||
"integrity": "sha512-NFvofzSinp00j5rzUd4tf+xi9od6383iY0JP7o0Bnu1fuItAUkWBgc4EKuIQ3D+c2QI3i9pG1kDWAeY27EMGtg==",
|
||||
"requires": {}
|
||||
},
|
||||
"@nestjs/passport": {
|
||||
"version": "8.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/passport/-/passport-8.2.1.tgz",
|
||||
@ -10978,6 +11049,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@nestjs/swagger": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-5.2.1.tgz",
|
||||
"integrity": "sha512-7dNa08WCnTsW/oAk3Ujde+z64JMfNm19DhpXasFR8oJp/9pggYAbYU927HpA+GJsSFJX6adjIRZsCKUqaGWznw==",
|
||||
"requires": {
|
||||
"@nestjs/mapped-types": "1.0.1",
|
||||
"lodash": "4.17.21",
|
||||
"path-to-regexp": "3.2.0"
|
||||
}
|
||||
},
|
||||
"@nestjs/testing": {
|
||||
"version": "8.4.3",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-8.4.3.tgz",
|
||||
@ -16218,6 +16299,19 @@
|
||||
"integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
|
||||
"dev": true
|
||||
},
|
||||
"swagger-ui-dist": {
|
||||
"version": "4.10.3",
|
||||
"resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.10.3.tgz",
|
||||
"integrity": "sha512-eR4vsd7sYo0Sx7ZKRP5Z04yij7JkNmIlUQfrDQgC+xO5ABYx+waabzN+nDsQTLAJ4Z04bjkRd8xqkJtbxr3G7w=="
|
||||
},
|
||||
"swagger-ui-express": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-4.3.0.tgz",
|
||||
"integrity": "sha512-jN46SEEe9EoXa3ZgZoKgnSF6z0w3tnM1yqhO4Y+Q4iZVc8JOQB960EZpIAz6rNROrDApVDwcMHR0mhlnc/5Omw==",
|
||||
"requires": {
|
||||
"swagger-ui-dist": ">=4.1.3"
|
||||
}
|
||||
},
|
||||
"symbol-observable": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz",
|
||||
|
@ -28,6 +28,7 @@
|
||||
"@nestjs/passport": "^8.2.1",
|
||||
"@nestjs/platform-express": "^8.0.0",
|
||||
"@nestjs/schedule": "^1.1.0",
|
||||
"@nestjs/swagger": "^5.2.1",
|
||||
"@nestjs/typeorm": "^8.0.3",
|
||||
"bcrypt": "^5.0.1",
|
||||
"class-transformer": "^0.5.1",
|
||||
@ -40,6 +41,7 @@
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.2.0",
|
||||
"swagger-ui-express": "^4.3.0",
|
||||
"typeorm": "^0.2.45"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -2,8 +2,10 @@ import { Body, Controller, Post } from '@nestjs/common';
|
||||
import { AuthService } from './auth.service';
|
||||
import { AuthLoginOperadorDto } from './dto/auth-login-operador.dto';
|
||||
import { AuthLoginUsuarioDto } from './dto/auth-login-usuario.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('auth')
|
||||
@ApiTags('auth')
|
||||
export class AuthController {
|
||||
constructor(private authService: AuthService) {}
|
||||
|
||||
|
@ -2,8 +2,10 @@ import { Body, Controller, Delete, Get, Param, Post } from '@nestjs/common';
|
||||
import { CarreraProgramaService } from './carrera-programa.service';
|
||||
import { CarreraProgramaCreateDto } from './dto/carrera-programa-create.dto';
|
||||
import { CarreraProgramaUpdateDto } from './dto/carrera-programa-update.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('carrera-programa')
|
||||
@ApiTags('carrera-programa')
|
||||
export class CarreraProgramaController {
|
||||
constructor(private carreraProgramaService: CarreraProgramaService) {}
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { Controller, Get, Query } from '@nestjs/common';
|
||||
import { CarreraService } from './carrera.service';
|
||||
import { CarritoGetDto } from './dto/carrera-get-dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('carrera')
|
||||
@ApiTags('carrera')
|
||||
export class CarreraController {
|
||||
constructor(private carreraService: CarreraService) {}
|
||||
|
||||
|
@ -4,8 +4,10 @@ import { CarritoCreateDto } from './dto/carrito-create.dto';
|
||||
import { CarritoUpdateDto } from './dto/carrito-update.dto';
|
||||
import { CarritoGetDto } from './dto/carrito-get-dto';
|
||||
import { CarritoDto } from './dto/carrito.dto'
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('carrito')
|
||||
@ApiTags('carrito')
|
||||
export class CarritoController {
|
||||
constructor(private carritoService: CarritoService) {}
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { Controller, Get, Post, Put, Query } from '@nestjs/common';
|
||||
import { EquipoService } from './equipo.service';
|
||||
import { EquipoDto } from './dto/equipo.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('equipo')
|
||||
@ApiTags('equipo')
|
||||
export class EquipoController {
|
||||
constructor(private equipoService: EquipoService) {}
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { Body, Controller, Delete, Get, Post, Put, Param } from '@nestjs/common';
|
||||
import { HoraExcepcionService } from './hora-excepcion.service';
|
||||
import { HoraExcepcionDto } from './dto/hora-excepcion-create.dto'
|
||||
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('hora-excepcion')
|
||||
@ApiTags('hora-excepcion')
|
||||
export class HoraExcepcionController {
|
||||
constructor(private horaExcepcionService: HoraExcepcionService) {}
|
||||
|
||||
|
@ -2,8 +2,10 @@ import { Body, Controller, Get, Put, Query } from '@nestjs/common';
|
||||
import { InstitucionDiaService } from './institucion-dia.service';
|
||||
import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import { InstitucionDiaUpdateDto } from './dto/institucion-dia-update.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('institucion-dia')
|
||||
@ApiTags('institucion-dia')
|
||||
export class InstitucionDiaController {
|
||||
constructor(private institucionDiaService: InstitucionDiaService) {}
|
||||
|
||||
|
@ -3,8 +3,10 @@ import { InstitucionInfraccionService } from './institucion-infraccion.service';
|
||||
import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import { InstitucionInfraccionCreateDto } from './dto/institucion-infraccion-create.dto';
|
||||
import { InstitucionInfraccionUpdateDto } from './dto/institucion-infraccion-update.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('institucion-infraccion')
|
||||
@ApiTags('institucion-infraccion')
|
||||
export class InstitucionInfraccionController {
|
||||
constructor(
|
||||
private institucionInfraccionService: InstitucionInfraccionService,
|
||||
|
@ -3,8 +3,10 @@ import { InstitucionTipoCarritoService } from './institucion-tipo-carrito.servic
|
||||
import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import { InstitucionTipoCarritoCreateDto } from './dto/institucion-tipo-carrito-create.dto';
|
||||
import { InstitucionTipoCarritoUpdateDto } from './dto/institucion-tipo-carrito-update.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('institucion-tipo-carrito')
|
||||
@ApiTags('institucion-tipo-carrito')
|
||||
export class InstitucionTipoCarritoController {
|
||||
constructor(
|
||||
private institucionTipoCarritoService: InstitucionTipoCarritoService,
|
||||
|
@ -2,8 +2,11 @@ import { Body, Controller, Get, Put, Query } from '@nestjs/common';
|
||||
import { InstitucionService } from './institucion.service';
|
||||
import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import { InstitucionUpdateDto } from './dto/institucion-update.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
|
||||
@Controller('institucion')
|
||||
@ApiTags('institucion')
|
||||
export class InstitucionController {
|
||||
constructor(private institucionService: InstitucionService) {}
|
||||
|
||||
|
10
src/main.ts
10
src/main.ts
@ -1,9 +1,19 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
||||
import { ValidationPipe } from '@nestjs/common';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('pcpuma_unam_api')
|
||||
.setDescription('Api de Pc puma')
|
||||
.setVersion('1.0')
|
||||
.build();
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
SwaggerModule.setup('api', app, document);
|
||||
|
||||
app.useGlobalPipes(new ValidationPipe({ whitelist: true }));
|
||||
await app.listen(3000);
|
||||
}
|
||||
|
@ -3,8 +3,11 @@ import { ModuloService } from './modulo.service';
|
||||
import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import { ModuloCreateDto } from './dto/modulo-create.dto';
|
||||
import { ModuloUpdateDto } from './dto/modulo-update.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
// import { Serealize } from '../interceptors/serialize.interceptor';
|
||||
|
||||
@Controller('modulo')
|
||||
@ApiTags('modulo')
|
||||
export class ModuloController {
|
||||
constructor(private moduloService: ModuloService) {}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
import { Controller, Get, Query } from '@nestjs/common';
|
||||
import { MotivoService } from './motivo.service';
|
||||
import { MotivoDto } from './dto/motivo.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('motivo')
|
||||
@ApiTags('motivo')
|
||||
export class MotivoController {
|
||||
constructor(private motivoService: MotivoService) {}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { MultaService } from './multa.service';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('multa')
|
||||
@ApiTags('multa')
|
||||
export class MultaController {
|
||||
constructor(private multaService: MultaService) {}
|
||||
|
||||
|
@ -4,7 +4,10 @@ import { OperadorCreateDto } from './dto/operador-create.dto';
|
||||
import { OperadorOperadoresDto } from './dto/operador-operadores.dto';
|
||||
import { OperadorUpdateDto } from './dto/operador-update.dto';
|
||||
import { OperadorDto } from './dto/operador.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('operador')
|
||||
@ApiTags('operador')
|
||||
export class OperadorController {
|
||||
constructor(private operadorService: OperadorService) {}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { Controller, Get, Post, Put } from '@nestjs/common';
|
||||
import { PrestamoService } from './prestamo.service';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('prestamo')
|
||||
@ApiTags('prestamo')
|
||||
export class PrestamoController {
|
||||
constructor(private prestamoService: PrestamoService) {}
|
||||
|
||||
|
@ -2,8 +2,10 @@ import { Body, Controller, Get, Post, Query } from '@nestjs/common';
|
||||
import { ProgramaService } from './programa.service';
|
||||
import { ProgramaCreateDto } from './dto/programa-create.dto';
|
||||
import { ProgramaDto } from './dto/programa.dto'
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('programa')
|
||||
@ApiTags('programa')
|
||||
export class ProgramaController {
|
||||
constructor(private programaService: ProgramaService) {}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { StatusService } from './status.service';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
|
||||
@Controller('status')
|
||||
@ApiTags('status')
|
||||
export class StatusController {
|
||||
constructor(private statusService: StatusService) {}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { TipoEntradaService } from './tipo-entrada.service';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('tipo-entrada')
|
||||
@ApiTags('tipo-entrada')
|
||||
export class TipoEntradaController {
|
||||
constructor(private tipoEntradaService: TipoEntradaService) {}
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
import { Body, Controller, Get, Post } from '@nestjs/common';
|
||||
import { TipoUsuarioService } from './tipo-usuario.service';
|
||||
import { TipoUsuarioUpdateDto } from './dto/tipo-usuario-update.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('tipo-usuario')
|
||||
@ApiTags('tipo-usuario')
|
||||
export class TipoUsuarioController {
|
||||
constructor(private tipoUsuarioService: TipoUsuarioService) {}
|
||||
|
||||
|
@ -10,8 +10,10 @@ import {
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { UploadFileService } from './upload-file.service';
|
||||
import { IdInstitucionDto } from '../dto/id-institucion.dto';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
@Controller('upload-file')
|
||||
@ApiTags('upload-file')
|
||||
export class UploadFileController {
|
||||
constructor(private uploadFileService: UploadFileService) {}
|
||||
|
||||
|
@ -14,8 +14,11 @@ import { UsuarioUpdateDto } from './dto/usuario-update.dto';
|
||||
import { UsuarioUsuariosDto } from './dto/usuario-usuarios.dto';
|
||||
import { UsuarioDto } from './dto/usuario.dto';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import {ApiTags} from '@nestjs/swagger'
|
||||
|
||||
|
||||
@Controller('usuario')
|
||||
@ApiTags('usuario')
|
||||
export class UsuarioController {
|
||||
constructor(private usuarioService: UsuarioService) {}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user