mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 02:15:21 +00:00
Add PowerClamp module with controller and service for energy data retrieval
This commit is contained in:
26
src/power-clamp/controllers/power-clamp.controller.ts
Normal file
26
src/power-clamp/controllers/power-clamp.controller.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { Controller, Get, 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';
|
||||
|
||||
@ApiTags('Power Clamp Module')
|
||||
@Controller({
|
||||
version: EnableDisableStatusEnum.ENABLED,
|
||||
path: ControllerRoute.PowerClamp.ROUTE,
|
||||
})
|
||||
export class PowerClampController {
|
||||
constructor(private readonly powerClampService: PowerClampService) {}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
@ApiOperation({
|
||||
summary: ControllerRoute.PowerClamp.ACTIONS.GET_ENERGY_SUMMARY,
|
||||
description: ControllerRoute.PowerClamp.ACTIONS.GET_ENERGY_DESCRIPTION,
|
||||
})
|
||||
async getPowerClampData() {
|
||||
return await this.powerClampService.getPowerClampData();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user