mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
Update TimeZoneController with ApiOperation and dynamic route
This commit is contained in:
@ -1,13 +1,14 @@
|
|||||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||||
import { TimeZoneService } from '../services/timezone.service';
|
import { TimeZoneService } from '../services/timezone.service';
|
||||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
import { ApiTags, ApiBearerAuth, ApiOperation } from '@nestjs/swagger';
|
||||||
import { JwtAuthGuard } from '../../../libs/common/src/guards/jwt.auth.guard';
|
import { JwtAuthGuard } from '../../../libs/common/src/guards/jwt.auth.guard';
|
||||||
import { EnableDisableStatusEnum } from '@app/common/constants/days.enum';
|
import { EnableDisableStatusEnum } from '@app/common/constants/days.enum';
|
||||||
|
import { ControllerRoute } from '@app/common/constants/controller-route';
|
||||||
|
|
||||||
@ApiTags('TimeZone Module')
|
@ApiTags('TimeZone Module')
|
||||||
@Controller({
|
@Controller({
|
||||||
version: EnableDisableStatusEnum.ENABLED,
|
version: EnableDisableStatusEnum.ENABLED,
|
||||||
path: 'timezone',
|
path: ControllerRoute.TIMEZONE.ROUTE,
|
||||||
})
|
})
|
||||||
export class TimeZoneController {
|
export class TimeZoneController {
|
||||||
constructor(private readonly timeZoneService: TimeZoneService) {}
|
constructor(private readonly timeZoneService: TimeZoneService) {}
|
||||||
@ -15,6 +16,11 @@ export class TimeZoneController {
|
|||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@UseGuards(JwtAuthGuard)
|
@UseGuards(JwtAuthGuard)
|
||||||
@Get()
|
@Get()
|
||||||
|
@ApiOperation({
|
||||||
|
summary: ControllerRoute.TIMEZONE.ACTIONS.GET_ALL_TIME_ZONES_SUMMARY,
|
||||||
|
description:
|
||||||
|
ControllerRoute.TIMEZONE.ACTIONS.GET_ALL_TIME_ZONES_DESCRIPTION,
|
||||||
|
})
|
||||||
async getAllTimeZones() {
|
async getAllTimeZones() {
|
||||||
return await this.timeZoneService.getAllTimeZones();
|
return await this.timeZoneService.getAllTimeZones();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user