mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
Add API operation descriptions to device messages controller
This commit is contained in:
@ -8,17 +8,18 @@ import {
|
|||||||
Post,
|
Post,
|
||||||
UseGuards,
|
UseGuards,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||||
import { DeviceMessagesSubscriptionService } from '../services/device-messages.service';
|
import { DeviceMessagesSubscriptionService } from '../services/device-messages.service';
|
||||||
import { DeviceMessagesAddDto } from '../dtos/device-messages.dto';
|
import { DeviceMessagesAddDto } from '../dtos/device-messages.dto';
|
||||||
|
|
||||||
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
|
import { JwtAuthGuard } from '@app/common/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('Device Messages Status Module')
|
@ApiTags('Device Messages Status Module')
|
||||||
@Controller({
|
@Controller({
|
||||||
version: EnableDisableStatusEnum.ENABLED,
|
version: EnableDisableStatusEnum.ENABLED,
|
||||||
path: 'device-messages/subscription',
|
path: ControllerRoute.DEVICE_MESSAGES_SUBSCRIPTION.ROUTE,
|
||||||
})
|
})
|
||||||
export class DeviceMessagesSubscriptionController {
|
export class DeviceMessagesSubscriptionController {
|
||||||
constructor(
|
constructor(
|
||||||
@ -28,6 +29,14 @@ export class DeviceMessagesSubscriptionController {
|
|||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@UseGuards(JwtAuthGuard)
|
@UseGuards(JwtAuthGuard)
|
||||||
@Post()
|
@Post()
|
||||||
|
@ApiOperation({
|
||||||
|
summary:
|
||||||
|
ControllerRoute.DEVICE_MESSAGES_SUBSCRIPTION.ACTIONS
|
||||||
|
.ADD_DEVICE_MESSAGES_SUBSCRIPTION_SUMMARY,
|
||||||
|
description:
|
||||||
|
ControllerRoute.DEVICE_MESSAGES_SUBSCRIPTION.ACTIONS
|
||||||
|
.ADD_DEVICE_MESSAGES_SUBSCRIPTION_DESCRIPTION,
|
||||||
|
})
|
||||||
async addDeviceMessagesSubscription(
|
async addDeviceMessagesSubscription(
|
||||||
@Body() deviceMessagesAddDto: DeviceMessagesAddDto,
|
@Body() deviceMessagesAddDto: DeviceMessagesAddDto,
|
||||||
) {
|
) {
|
||||||
@ -45,6 +54,14 @@ export class DeviceMessagesSubscriptionController {
|
|||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@UseGuards(JwtAuthGuard)
|
@UseGuards(JwtAuthGuard)
|
||||||
@Get(':deviceUuid/user/:userUuid')
|
@Get(':deviceUuid/user/:userUuid')
|
||||||
|
@ApiOperation({
|
||||||
|
summary:
|
||||||
|
ControllerRoute.DEVICE_MESSAGES_SUBSCRIPTION.ACTIONS
|
||||||
|
.GET_DEVICE_MESSAGES_SUBSCRIPTION_SUMMARY,
|
||||||
|
description:
|
||||||
|
ControllerRoute.DEVICE_MESSAGES_SUBSCRIPTION.ACTIONS
|
||||||
|
.GET_DEVICE_MESSAGES_SUBSCRIPTION_DESCRIPTION,
|
||||||
|
})
|
||||||
async getDeviceMessagesSubscription(
|
async getDeviceMessagesSubscription(
|
||||||
@Param('deviceUuid') deviceUuid: string,
|
@Param('deviceUuid') deviceUuid: string,
|
||||||
@Param('userUuid') userUuid: string,
|
@Param('userUuid') userUuid: string,
|
||||||
@ -60,9 +77,18 @@ export class DeviceMessagesSubscriptionController {
|
|||||||
data: deviceDetails,
|
data: deviceDetails,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiBearerAuth()
|
@ApiBearerAuth()
|
||||||
@UseGuards(JwtAuthGuard)
|
@UseGuards(JwtAuthGuard)
|
||||||
@Delete()
|
@Delete()
|
||||||
|
@ApiOperation({
|
||||||
|
summary:
|
||||||
|
ControllerRoute.DEVICE_MESSAGES_SUBSCRIPTION.ACTIONS
|
||||||
|
.DELETE_DEVICE_MESSAGES_SUBSCRIPTION_SUMMARY,
|
||||||
|
description:
|
||||||
|
ControllerRoute.DEVICE_MESSAGES_SUBSCRIPTION.ACTIONS
|
||||||
|
.DELETE_DEVICE_MESSAGES_SUBSCRIPTION_DESCRIPTION,
|
||||||
|
})
|
||||||
async deleteDeviceMessagesSubscription(
|
async deleteDeviceMessagesSubscription(
|
||||||
@Body() deviceMessagesAddDto: DeviceMessagesAddDto,
|
@Body() deviceMessagesAddDto: DeviceMessagesAddDto,
|
||||||
) {
|
) {
|
||||||
|
Reference in New Issue
Block a user