mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
feat: enhance PowerClamp service and controller to support filtering by date, month, and year
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
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({
|
||||
@ -15,12 +17,18 @@ export class PowerClampController {
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
@Get(':powerClampUuid')
|
||||
@ApiOperation({
|
||||
summary: ControllerRoute.PowerClamp.ACTIONS.GET_ENERGY_SUMMARY,
|
||||
description: ControllerRoute.PowerClamp.ACTIONS.GET_ENERGY_DESCRIPTION,
|
||||
})
|
||||
async getPowerClampData() {
|
||||
return await this.powerClampService.getPowerClampData();
|
||||
async getPowerClampData(
|
||||
@Param('powerClampUuid') powerClampUuid: string,
|
||||
@Query() params: GetPowerClampDto,
|
||||
): Promise<BaseResponseDto> {
|
||||
return await this.powerClampService.getPowerClampData(
|
||||
powerClampUuid,
|
||||
params,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user