mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-24 19:07:55 +00:00
updated group module
This commit is contained in:
@@ -2,7 +2,6 @@ import { GroupService } from '../services/group.service';
|
||||
import { Controller, Get, UseGuards, Param, Req } from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
|
||||
import { UnitPermissionGuard } from 'src/guards/unit.permission.guard';
|
||||
import { EnableDisableStatusEnum } from '@app/common/constants/days.enum';
|
||||
|
||||
@ApiTags('Group Module')
|
||||
@@ -17,21 +16,21 @@ export class GroupController {
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':spaceUuid')
|
||||
async getGroupsBySpaceUuid(@Param('spaceUuid') spaceUuid: string) {
|
||||
return await this.groupService.getGroupsByUnitUuid(spaceUuid);
|
||||
return await this.groupService.getGroupsBySpaceUuid(spaceUuid);
|
||||
}
|
||||
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get(':unitUuid/devices/:groupName')
|
||||
@Get(':spaceUuid/devices/:groupName')
|
||||
async getUnitDevicesByGroupName(
|
||||
@Param('unitUuid') unitUuid: string,
|
||||
@Param('spaceUuid') spaceUuid: string,
|
||||
@Param('groupName') groupName: string,
|
||||
@Req() req: any,
|
||||
) {
|
||||
const userUuid = req.user.uuid;
|
||||
|
||||
return await this.groupService.getUnitDevicesByGroupName(
|
||||
unitUuid,
|
||||
return await this.groupService.getSpaceDevicesByGroupName(
|
||||
spaceUuid,
|
||||
groupName,
|
||||
userUuid,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user