mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 15:27:54 +00:00
Merge branch 'dev' of https://github.com/SyncrowIOT/backend into feature/space-management
This commit is contained in:
@@ -8,10 +8,16 @@ import {
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import { AddSceneTapToRunDto, UpdateSceneTapToRunDto } from '../dtos/scene.dto';
|
||||
import {
|
||||
AddSceneIconDto,
|
||||
AddSceneTapToRunDto,
|
||||
GetSceneDto,
|
||||
UpdateSceneTapToRunDto,
|
||||
} from '../dtos/scene.dto';
|
||||
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
|
||||
import { EnableDisableStatusEnum } from '@app/common/constants/days.enum';
|
||||
import { DeleteSceneParamDto, SceneParamDto, SpaceParamDto } from '../dtos';
|
||||
@@ -41,9 +47,13 @@ export class SceneController {
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('tap-to-run/:spaceUuid')
|
||||
async getTapToRunSceneByUnit(@Param() param: SpaceParamDto) {
|
||||
async getTapToRunSceneByUnit(
|
||||
@Param() param: SpaceParamDto,
|
||||
@Query() inHomePage: GetSceneDto,
|
||||
) {
|
||||
const tapToRunScenes = await this.sceneService.getTapToRunSceneByUnit(
|
||||
param.spaceUuid,
|
||||
inHomePage,
|
||||
);
|
||||
return tapToRunScenes;
|
||||
}
|
||||
@@ -98,4 +108,23 @@ export class SceneController {
|
||||
data: tapToRunScene,
|
||||
};
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('icon')
|
||||
async addSceneIcon(@Body() addSceneIconDto: AddSceneIconDto) {
|
||||
const tapToRunScene = await this.sceneService.addSceneIcon(addSceneIconDto);
|
||||
return {
|
||||
statusCode: HttpStatus.CREATED,
|
||||
success: true,
|
||||
message: 'Icon added successfully',
|
||||
data: tapToRunScene,
|
||||
};
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('icon')
|
||||
async getAllIcons() {
|
||||
const icons = await this.sceneService.getAllIcons();
|
||||
return icons;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user