mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 16:28:12 +00:00
Project Initialization
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { Body, Controller, Get, Param, ParseUUIDPipe, Post } from '@nestjs/common';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { CreateScheduleDto } from './dto/create-schedule.dto';
|
||||
import { SchedulesService } from './schedules.service';
|
||||
|
||||
@ApiTags('schedules')
|
||||
// @UseGuards(JwtAuthGuard) — TODO: integrate @edr/auth
|
||||
@Controller('schedules')
|
||||
export class SchedulesController {
|
||||
constructor(private readonly schedulesService: SchedulesService) {}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Publish a new train schedule' })
|
||||
create(@Body() dto: CreateScheduleDto) {
|
||||
return this.schedulesService.create(dto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'List all schedules' })
|
||||
findAll() {
|
||||
return this.schedulesService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOperation({ summary: 'Get a schedule by ID' })
|
||||
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.schedulesService.findById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user