-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* isnotempty 유효성 추가 * UsePipes 추가 * 여정 조회 알고리즘 변경 * 여정 조회 get 요청 추가 * 여정 종료 응답 스웨거 형식 지정, DTO 별도 생성 * 여정 조회 응답 스웨거 작성
- Loading branch information
Showing
6 changed files
with
175 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
|
||
export class JourneyDTO { | ||
@ApiProperty({ description: '여정 ID', example: '65649c91380cafcab8869ed2' }) | ||
readonly _id: string; | ||
|
||
@ApiProperty({ description: '여정 제목', example: '여정 제목' }) | ||
readonly title: string; | ||
|
||
@ApiProperty({ description: 'spot 배열', example: [] }) | ||
readonly spots: string[]; | ||
|
||
@ApiProperty({ | ||
description: '위치 좌표 배열', | ||
example: [ | ||
[37.775, 122.4195], | ||
[37.7752, 122.4197], | ||
[37.7754, 122.4199], | ||
], | ||
}) | ||
readonly coordinates: number[][]; | ||
} | ||
|
||
export class CheckJourneyResponseDTO { | ||
@ApiProperty({ | ||
type: [JourneyDTO], | ||
description: '여정 데이터 배열', | ||
}) | ||
readonly journeys: JourneyDTO[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsString, IsDateString, IsArray, IsNotEmpty } from 'class-validator'; | ||
import { IsCoordinate } from '../../common/decorator/coordinate.decorator'; | ||
export class EndJourneyResponseDTO { | ||
@ApiProperty({ | ||
example: '655efda2fdc81cae36d20650', | ||
description: '여정 id', | ||
required: true, | ||
}) | ||
@IsString() | ||
readonly journeyId: string; | ||
@ApiProperty({ | ||
example: '여정 제목', | ||
description: '여정 제목', | ||
required: true, | ||
}) | ||
@IsString() | ||
readonly title: string; | ||
|
||
@IsString({ each: true }) | ||
@IsNotEmpty() | ||
@ApiProperty({ | ||
example: [ | ||
'655efda2fdc81cae36d20650', | ||
'655efd902908e4514ae5ff9b', | ||
'655efd27a08c7995defc8e91', | ||
], | ||
description: 'spot id 배열', | ||
required: true, | ||
}) | ||
readonly spots: string[]; | ||
|
||
@IsArray() | ||
@IsNotEmpty() | ||
@ApiProperty({ | ||
example: [ | ||
[37.674986, 126.776032], | ||
[37.555946, 126.972384], | ||
], | ||
description: '위치 좌표 배열', | ||
required: true, | ||
}) | ||
readonly coordinates: number[][]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters