This commit is contained in:
Bastian Wagner
2024-10-25 12:32:26 +02:00
parent d4f1fbbf39
commit b4e264eda9
40 changed files with 538 additions and 66 deletions

View File

@@ -0,0 +1,50 @@
import {
Controller,
Get,
Post,
Body,
Patch,
Param,
Delete,
Req,
UseGuards,
} from '@nestjs/common';
import { SystemService } from './system.service';
import { CreateSystemDto } from './dto/create-system.dto';
import { UpdateSystemDto } from './dto/update-system.dto';
import { AuthenticatedRequest } from 'src/model/interface/authenticated-request.interface';
import { AuthGuard } from 'src/core/guards/auth.guard';
@UseGuards(AuthGuard)
@Controller('system')
export class SystemController {
constructor(private readonly systemService: SystemService) {}
@Post()
create(
@Req() req: AuthenticatedRequest,
@Body() createSystemDto: CreateSystemDto,
) {
return this.systemService.create(req.user, createSystemDto);
}
@Get()
findAll(@Req() req: AuthenticatedRequest) {
return this.systemService.findAll(req.user);
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.systemService.findOne(id);
}
@Patch(':id')
update(@Param('id') id: string, @Body() updateSystemDto: UpdateSystemDto) {
return this.systemService.update(id, updateSystemDto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.systemService.remove(id);
}
}