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 { return this.findAll(); } @Get(':id') @ApiOperation({ summary: '특정 센서 조회' }) @ApiOkResponse({ description: '센서', type: [Sensor] }) async findOne(@Param('id', ParseIntPipe) id: number): Promise { return this.findOne(id); } }