mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-26 01:07:55 +00:00
added space model controller for create
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export * from './space-model.controller';
|
||||
@@ -0,0 +1,35 @@
|
||||
import { ControllerRoute } from '@app/common/constants/controller-route';
|
||||
import { Body, Controller, Param, Post, UseGuards } from '@nestjs/common';
|
||||
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { SpaceModelService } from '../services';
|
||||
import { CreateSpaceModelDto } from '../dtos';
|
||||
import { ProjectParam } from 'src/community/dtos';
|
||||
import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard';
|
||||
import { BaseResponseDto } from '@app/common/dto/base.response.dto';
|
||||
|
||||
@ApiTags('Space Model Module')
|
||||
@Controller({
|
||||
version: '1',
|
||||
path: ControllerRoute.SPACE_MODEL.ROUTE,
|
||||
})
|
||||
export class SpaceModelController {
|
||||
constructor(private readonly spaceModelService: SpaceModelService) {}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@ApiOperation({
|
||||
summary: ControllerRoute.SPACE_MODEL.ACTIONS.CREATE_SPACE_MODEL_SUMMARY,
|
||||
description:
|
||||
ControllerRoute.SPACE_MODEL.ACTIONS.CREATE_SPACE_MODEL_DESCRIPTION,
|
||||
})
|
||||
@Post()
|
||||
async createSpaceModel(
|
||||
@Body() createSpaceModelDto: CreateSpaceModelDto,
|
||||
@Param() projectParam: ProjectParam,
|
||||
): Promise<BaseResponseDto> {
|
||||
return await this.spaceModelService.createSpaceModel(
|
||||
createSpaceModelDto,
|
||||
projectParam,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user