first steps for the generation of the event table together with its services
This commit is contained in:
+4
-2
@@ -1,10 +1,12 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { EventsController } from './events/events.controller';
|
||||
import { EventsService } from './events/events.service';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
controllers: [AppController, EventsController],
|
||||
providers: [AppService, EventsService],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
export class event {
|
||||
//evento_identificador:string
|
||||
id_event: number //id_evento
|
||||
event_name: string //nombre
|
||||
desciption:string //descripcion
|
||||
start_date:Date //fecha_inicio
|
||||
end_date:Date //fecha_fin
|
||||
regitration_deadline:Date //fecha_limite_inscripcionme
|
||||
schedule:Date //horarior
|
||||
requirements: string
|
||||
modality: string //modalidad
|
||||
place: string //lugar
|
||||
registration_fee: string //cuota_inscripcionl
|
||||
sponsor: string //patrocinador
|
||||
type_acreditation: string //tipo_acreditacion
|
||||
event_type: string //tipo_evento
|
||||
state: boolean //estado
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post } from '@nestjs/common';
|
||||
|
||||
@Controller('events')
|
||||
export class EventsController {
|
||||
@Get()
|
||||
getEvents(): string{
|
||||
return "Aqui irán los eventos"
|
||||
}
|
||||
|
||||
/* @Get(':id')
|
||||
getEvent(@Param() params){
|
||||
return `El evento que estamos llamando es: ${params.id}`
|
||||
} */
|
||||
|
||||
@Get(':id')
|
||||
getEvent(@Param('id') id: string): string{
|
||||
return `El evento que estamos llamando es: ${id}`
|
||||
}
|
||||
|
||||
@Post()
|
||||
/* @HttpCode(HttpStatus.NO_CONTENT) esta linea es para no teornar nada*/
|
||||
createEvent(@Body('message') message: string){
|
||||
return `el evento creado es: ${message}`
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
deleteEvent(@Param('id') id:string): string{
|
||||
return `Estamos borrando el evento: ${id}`
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
updateEvent(@Param('id') id:string, @Body() body){
|
||||
return `Actualizando el evento: ${id}`
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class EventsService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user