Skip to content

Commit eb6bdc5

Browse files
committed
[Feat] Apply Swagger to search DTO
1 parent f03d3e2 commit eb6bdc5

3 files changed

Lines changed: 36 additions & 12 deletions

File tree

src/main/java/boombimapi/domain/search/presentation/dto/res/SearchHistoryRes.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
package boombimapi.domain.search.presentation.dto.res;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
5+
@Schema(description = "검색 내역 조회")
36
public record SearchHistoryRes(
7+
@Schema(description = "검색 ID")
48
Long searchId,
5-
9+
@Schema(description = "검색 장소 이름")
610
String posName
711
) {
812
public static SearchHistoryRes of(Long searchId, String posName){

src/main/java/boombimapi/domain/search/presentation/dto/res/SearchRelatedRes.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
package boombimapi.domain.search.presentation.dto.res;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
4+
5+
@Schema(description = "연관 검색어")
36
public record SearchRelatedRes(
7+
8+
@Schema(description = "검색 장소 이름")
49
String posName
510
) {
611
public static SearchRelatedRes of(String posName){

src/main/java/boombimapi/domain/search/presentation/dto/res/SearchRes.java

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,44 @@
22

33
import java.time.LocalDateTime;
44

5-
import java.time.LocalDateTime;
5+
import io.swagger.v3.oas.annotations.media.Schema;
66

7+
@Schema(description = "검색 결과 응답 모델")
78
public record SearchRes(
9+
10+
@Schema(description = "장소 ID", example = "12345")
811
Long placeId,
12+
13+
@Schema(description = "장소명", example = "스타벅스 강남점")
914
String posName,
10-
LocalDateTime timeAt, // 가장 최신 날짜
15+
16+
@Schema(description = "가장 최신 날짜 그 몇분전 설명", example = "2024-12-01T14:30:00")
17+
LocalDateTime timeAt,
18+
19+
@Schema(description = "최신 답변 유형", example = "여유", allowableValues = {"여유", "보통", "약간 붐빔", "붐빔"})
1120
String answerType,
21+
22+
@Schema(description = "주소", example = "서울특별시 강남구 테헤란로 123")
1223
String address,
13-
String imageUrl
24+
25+
@Schema(description = "이미지 URL // 원래 공식만 주는게 맞는데 나중을 사용자도 올린거 다 주겠음", example = "https://example.com/image.jpg")
26+
String imageUrl,
27+
28+
@Schema(description = "장소 유형", example = "공식 or 사용자가 올린거")
29+
String placeType
30+
1431
) {
15-
public static SearchRes of(Long id,
16-
String posName,
17-
LocalDateTime timeAt,
18-
String answerType,
19-
String address,
20-
String imageUrl) {
32+
@Schema(description = "SearchRes 객체 생성을 위한 팩토리 메서드")
33+
public static SearchRes of(Long id, String posName, LocalDateTime timeAt,
34+
String answerType, String address, String imageUrl, String placeType) {
2135
return new SearchRes(
2236
id,
2337
posName,
2438
timeAt,
2539
answerType,
2640
address,
27-
imageUrl
41+
imageUrl,
42+
placeType
2843
);
2944
}
30-
}
45+
}

0 commit comments

Comments
 (0)