diff --git a/BE/musicspot/src/journey/controller/journey.controller.ts b/BE/musicspot/src/journey/controller/journey.controller.ts index 3ea730e..f29a917 100644 --- a/BE/musicspot/src/journey/controller/journey.controller.ts +++ b/BE/musicspot/src/journey/controller/journey.controller.ts @@ -8,6 +8,7 @@ import { Query, Param, Delete, + Version, } from '@nestjs/common'; import { JourneyService } from '../service/journey.service'; import { StartJourneyReqDTO } from '../dto/journeyStart/journeyStart.dto'; @@ -36,7 +37,6 @@ import { DeleteJourneyReqDTO } from '../dto/journeyDelete.dto'; import { Journey } from '../entities/journey.entity'; import { LastJourneyResDTO } from '../dto/journeyLast.dto'; - @Controller('journey') @ApiTags('journey 관련 API') export class JourneyController { @@ -54,7 +54,14 @@ export class JourneyController { async create(@Body() startJourneyDTO: StartJourneyReqDTO) { return await this.journeyService.insertJourneyData(startJourneyDTO); } - + @ApiOperation({ + summary: '여정 시작 API', + description: '여정 기록을 시작합니다.', + }) + @ApiCreatedResponse({ + description: '생성된 여정 데이터를 반환', + type: StartJourneyResDTO, + }) @ApiOperation({ summary: '여정 종료 API', description: '여정을 종료합니다.', @@ -83,7 +90,6 @@ export class JourneyController { return returnData; } - @ApiOperation({ summary: '여정 조회 API', description: '해당 범위 내의 여정들을 반환합니다.', @@ -127,7 +133,9 @@ export class JourneyController { minCoordinate, maxCoordinate, }; - return await this.journeyService.getJourneyByCoordinationRange(checkJourneyDTO); + return await this.journeyService.getJourneyByCoordinationRange( + checkJourneyDTO, + ); } @ApiOperation({ @@ -141,7 +149,6 @@ export class JourneyController { @Get('last') async loadLastData(@Body('userId') userId) { return await this.journeyService.getLastJourneyByUserId(userId); - } @ApiOperation({ @@ -170,4 +177,3 @@ export class JourneyController { return await this.journeyService.deleteJourneyById(deleteJourneyDto); } } - diff --git a/BE/musicspot/src/main.ts b/BE/musicspot/src/main.ts index 82fdc4d..5bcbb95 100644 --- a/BE/musicspot/src/main.ts +++ b/BE/musicspot/src/main.ts @@ -1,17 +1,19 @@ import { NestFactory } from '@nestjs/core'; -import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; +import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { AppModule } from './app.module'; -import { ValidationPipe } from '@nestjs/common'; +import { ValidationPipe, VersioningType } from '@nestjs/common'; import { NestExpressApplication } from '@nestjs/platform-express'; import { AllExceptionFilter } from './filters/exception.filter'; -import { winstonLogger } from './common/logger/winston.util'; + async function bootstrap() { const app = await NestFactory.create(AppModule); - + app.enableVersioning({ + type: VersioningType.URI, + }); const config = new DocumentBuilder() .setTitle('Music Spot') // 문서의 제목 .setDescription('iOS01 Music Spot App API') // 문서의 간단한 설명 - .setVersion('1.0') // API의 버전(업데이트 버전) + .setVersion('2.0') // API의 버전(업데이트 버전) .addTag('Music Spot') .build(); const document = SwaggerModule.createDocument(app, config);