"inicialización"
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export class CreatePreguntaOpcionDto {}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/mapped-types';
|
||||
import { CreatePreguntaOpcionDto } from './create-pregunta_opcion.dto';
|
||||
|
||||
export class UpdatePreguntaOpcionDto extends PartialType(CreatePreguntaOpcionDto) {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { PreguntaOpcionController } from './pregunta_opcion.controller';
|
||||
import { PreguntaOpcionService } from './pregunta_opcion.service';
|
||||
|
||||
describe('PreguntaOpcionController', () => {
|
||||
let controller: PreguntaOpcionController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [PreguntaOpcionController],
|
||||
providers: [PreguntaOpcionService],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<PreguntaOpcionController>(PreguntaOpcionController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { PreguntaOpcionService } from './pregunta_opcion.service';
|
||||
import { CreatePreguntaOpcionDto } from './dto/create-pregunta_opcion.dto';
|
||||
import { UpdatePreguntaOpcionDto } from './dto/update-pregunta_opcion.dto';
|
||||
|
||||
@Controller('pregunta-opcion')
|
||||
export class PreguntaOpcionController {
|
||||
constructor(private readonly preguntaOpcionService: PreguntaOpcionService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createPreguntaOpcionDto: CreatePreguntaOpcionDto) {
|
||||
return this.preguntaOpcionService.create(createPreguntaOpcionDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.preguntaOpcionService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.preguntaOpcionService.findOne(+id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updatePreguntaOpcionDto: UpdatePreguntaOpcionDto) {
|
||||
return this.preguntaOpcionService.update(+id, updatePreguntaOpcionDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.preguntaOpcionService.remove(+id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { PreguntaOpcionService } from './pregunta_opcion.service';
|
||||
import { PreguntaOpcionController } from './pregunta_opcion.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [PreguntaOpcionController],
|
||||
providers: [PreguntaOpcionService],
|
||||
})
|
||||
export class PreguntaOpcionModule {}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { PreguntaOpcionService } from './pregunta_opcion.service';
|
||||
|
||||
describe('PreguntaOpcionService', () => {
|
||||
let service: PreguntaOpcionService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [PreguntaOpcionService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<PreguntaOpcionService>(PreguntaOpcionService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { CreatePreguntaOpcionDto } from './dto/create-pregunta_opcion.dto';
|
||||
import { UpdatePreguntaOpcionDto } from './dto/update-pregunta_opcion.dto';
|
||||
|
||||
@Injectable()
|
||||
export class PreguntaOpcionService {
|
||||
create(createPreguntaOpcionDto: CreatePreguntaOpcionDto) {
|
||||
return 'This action adds a new preguntaOpcion';
|
||||
}
|
||||
|
||||
findAll() {
|
||||
return `This action returns all preguntaOpcion`;
|
||||
}
|
||||
|
||||
findOne(id: number) {
|
||||
return `This action returns a #${id} preguntaOpcion`;
|
||||
}
|
||||
|
||||
update(id: number, updatePreguntaOpcionDto: UpdatePreguntaOpcionDto) {
|
||||
return `This action updates a #${id} preguntaOpcion`;
|
||||
}
|
||||
|
||||
remove(id: number) {
|
||||
return `This action removes a #${id} preguntaOpcion`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user