mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 17:47:56 +00:00
get devices
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { ControllerRoute } from '@app/common/constants/controller-route';
|
||||
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { SubspaceDeviceService } from '../services/space-device.service';
|
||||
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
|
||||
import { GetSpaceParam } from '../dtos';
|
||||
import { BaseResponseDto } from '@app/common/dto/base.response.dto';
|
||||
|
||||
@ApiTags('Space Module')
|
||||
@Controller({
|
||||
version: '1',
|
||||
path: ControllerRoute.SPACE_DEVICES.ROUTE,
|
||||
})
|
||||
export class SubSpaceDeviceController {
|
||||
constructor(private readonly spaceDeviceService: SubspaceDeviceService) {}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiOperation({
|
||||
summary: ControllerRoute.SPACE_DEVICES.ACTIONS.LIST_SPACE_DEVICE_SUMMARY,
|
||||
description:
|
||||
ControllerRoute.SPACE_DEVICES.ACTIONS.LIST_SPACE_DEVICE_DESCRIPTION,
|
||||
})
|
||||
@Get()
|
||||
async listDevicesInSpace(
|
||||
@Param() params: GetSpaceParam,
|
||||
): Promise<BaseResponseDto> {
|
||||
return await this.spaceDeviceService.listDevicesInSpace(params);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user