Files
3dp-manager/server/src/nodes/nodes.controller.ts
T
Den Piligrim 5629b43cd0 add: nodes
2026-05-18 15:50:36 +03:00

49 lines
1.1 KiB
TypeScript

import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common';
import { CreateNodeDto, UpdateNodeDto } from './dto/node.dto';
import { NodesService } from './nodes.service';
@Controller('nodes')
export class NodesController {
constructor(private readonly nodesService: NodesService) {}
@Get()
findAll() {
return this.nodesService.findAll();
}
@Post()
create(@Body() dto: CreateNodeDto) {
return this.nodesService.create(dto);
}
@Post('check')
checkPayload(@Body() dto: CreateNodeDto) {
return this.nodesService.checkPayload(dto);
}
@Put(':id')
update(@Param('id') id: string, @Body() dto: UpdateNodeDto) {
return this.nodesService.update(id, dto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.nodesService.remove(id);
}
@Post(':id/main')
setMain(@Param('id') id: string) {
return this.nodesService.setMain(id);
}
@Post(':id/check')
check(@Param('id') id: string) {
return this.nodesService.checkConnection(id);
}
@Post('sync/main')
syncFromMain() {
return this.nodesService.syncFromMain();
}
}