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