added space model controller for create

This commit is contained in:
hannathkadher
2024-12-11 11:06:41 +04:00
parent b2a422f71b
commit 02faca3397
7 changed files with 92 additions and 2 deletions
+1
View File
@@ -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,
);
}
}