This commit is contained in:
2025-08-12 17:33:02 +09:00
parent a33d102393
commit b294df9cf5
14 changed files with 311 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
import { Controller, Get, Param, ParseIntPipe } from '@nestjs/common';
import { SensorsService } from './sensors.service';
import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
import { Sensor } from './entities/sensor.entity';
@ApiTags('센서')
@Controller('sensors')
export class SensorsController {
constructor(private readonly sensorService: SensorsService) {}
@Get()
@ApiOperation({ summary: '센서 목록 조회' })
@ApiOkResponse({ description: '센서 목록', type: [Sensor] })
async findAll(): Promise<Sensor[]> {
return this.findAll();
}
@Get(':id')
@ApiOperation({ summary: '특정 센서 조회' })
@ApiOkResponse({ description: '센서', type: [Sensor] })
async findOne(@Param('id', ParseIntPipe) id: number): Promise<Sensor | null> {
return this.findOne(id);
}
}