import { Controller, Get, Param, Query, UseGuards } from '@nestjs/common'; import { ApiTags, ApiBearerAuth, ApiOperation } from '@nestjs/swagger'; import { EnableDisableStatusEnum } from '@app/common/constants/days.enum'; import { ControllerRoute } from '@app/common/constants/controller-route'; import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard'; import { PowerClampService } from '../services/power-clamp.service'; import { GetPowerClampDto } from '../dto/get-power-clamp.dto'; import { BaseResponseDto } from '@app/common/dto/base.response.dto'; @ApiTags('Power Clamp Module') @Controller({ version: EnableDisableStatusEnum.ENABLED, path: ControllerRoute.PowerClamp.ROUTE, }) export class PowerClampController { constructor(private readonly powerClampService: PowerClampService) {} @ApiBearerAuth() @UseGuards(JwtAuthGuard) @Get(':powerClampUuid') @ApiOperation({ summary: ControllerRoute.PowerClamp.ACTIONS.GET_ENERGY_SUMMARY, description: ControllerRoute.PowerClamp.ACTIONS.GET_ENERGY_DESCRIPTION, }) async getPowerClampData( @Param('powerClampUuid') powerClampUuid: string, @Query() params: GetPowerClampDto, ): Promise { return await this.powerClampService.getPowerClampData( powerClampUuid, params, ); } }