import { Body, Controller, Get, Post } from '@nestjs/common'; import { CreateStructureDto } from './dto/create-structure.dto'; import { Structure } from './schemas/structure.schema'; import { StructuresService } from './structures.service'; @Controller('structures') export class StructuresController { constructor(private readonly structureService: StructuresService) {} @Post() async create(@Body() createStructureDto: CreateStructureDto) { await this.structureService.create(createStructureDto); } @Get() async findAll(): Promise<Structure[]> { return this.structureService.findAll(); } }