stand_2026_10_08

This commit is contained in:
marco committed 2026-10-08 09:49:18 +02:00
1 parent 6daff3b8f7
commit d6d9133f4b
6 files changed
+150 -49

No files matched your search

+54 -33
View File
@@ -1,40 +1,61 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common';
import { Body, Controller, Delete, Get, HttpStatus, Param, ParseFilePipeBuilder, Patch, Post, UploadedFile, UseInterceptors } from '@nestjs/common';
import { SignalsService } from './signals.service';
import { SignalCreateDto, SignalUpdateDto } from 'src/_dto/anlagen/signals';
import { FileInterceptor } from '@nestjs/platform-express';
import type { Express } from 'express';
@Controller('rk2/signals')
export class SignalsController {
constructor(private readonly service: SignalsService) { }
@Get()
getAll() {
return this.service.findAll();
}
@Get(':id')
getOne(@Param('id') id: string) {
return this.service.findOne(id);
}
constructor(private readonly service: SignalsService) { }
@Get("byComponent/:id")
getByComponent(@Param('id') id: string) {
return this.service.findByComponent(id);
}
@Post()
create(@Body() dto: SignalCreateDto) {
console.log(dto)
return this.service.create(dto);
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: SignalUpdateDto) {
return this.service.update(id, dto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.service.remove(id);
}
@Get()
getAll() {
return this.service.findAll();
}
@Get(':id')
getOne(@Param('id') id: string) {
return this.service.findOne(id);
}
@Get("byComponent/:id")
getByComponent(@Param('id') id: string) {
return this.service.findByComponent(id);
}
@Post()
create(@Body() dto: SignalCreateDto) {
console.log(dto)
return this.service.create(dto);
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: SignalUpdateDto) {
return this.service.update(id, dto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.service.remove(id);
}
@Post('upload')
@UseInterceptors(FileInterceptor('file'))
uploadExcel(
@UploadedFile(
new ParseFilePipeBuilder().build({
errorHttpStatusCode: HttpStatus.UNPROCESSABLE_ENTITY,
}),
)
file: Express.Multer.File,
) {
return {
message: 'Excel erfolgreich empfangen',
filename: file.originalname,
size: file.size,
};
}
}