Skip to content

Commit 87e72d8

Browse files
committed
docs: #52 트랙 스웨거 설명 및 기본값 추가
1 parent 6716f67 commit 87e72d8

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

src/main/java/com/cabin/plat/domain/track/controller/TrackController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.cabin.plat.domain.track.service.TrackService;
88
import com.cabin.plat.global.common.BaseResponse;
99
import io.swagger.v3.oas.annotations.Operation;
10+
import io.swagger.v3.oas.annotations.Parameter;
1011
import io.swagger.v3.oas.annotations.tags.Tag;
1112
import lombok.RequiredArgsConstructor;
1213
import org.springframework.web.bind.annotation.*;
@@ -22,9 +23,13 @@ public class TrackController {
2223
@GetMapping("/map")
2324
public BaseResponse<TrackResponse.TrackMapList> getTracksByLocation(
2425
@AuthMember Member member,
26+
@Parameter(description = "시작 위도 값", example = "36.016512")
2527
@RequestParam double startLatitude,
28+
@Parameter(description = "시작 경도 값", example = "129.321285")
2629
@RequestParam double startLongitude,
30+
@Parameter(description = "끝 위도 값", example = "36.012527")
2731
@RequestParam double endLatitude,
32+
@Parameter(description = "끝 경도 값", example = "129.328229")
2833
@RequestParam double endLongitude) {
2934
return BaseResponse.onSuccess(trackService.getTracksByLocation(
3035
member,

src/main/java/com/cabin/plat/domain/track/dto/TrackRequest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.cabin.plat.domain.track.dto;
22

3+
import io.swagger.v3.oas.annotations.Parameter;
4+
import io.swagger.v3.oas.annotations.media.Schema;
35
import lombok.*;
46

57
public class TrackRequest {
@@ -17,10 +19,19 @@ public static class TrackLike {
1719
@AllArgsConstructor
1820
@NoArgsConstructor
1921
public static class TrackUpload {
22+
@Schema(description = "isrc", defaultValue = "BRBMG0300729")
2023
private String isrc;
24+
25+
@Schema(description = "트랙 이미지 URL", defaultValue = "https://example.com/track.png")
2126
private String imageUrl;
27+
28+
@Schema(description = "트랙 게시물 본문", defaultValue = "트랙 게시물 본문입니다.")
2229
private String content;
30+
31+
@Schema(description = "트랙 위도 값", defaultValue = "36.014188")
2332
private double latitude;
33+
34+
@Schema(description = "트랙 경도 값", defaultValue = "129.325802")
2435
private double longitude;
2536
}
2637
}

src/main/java/com/cabin/plat/domain/track/dto/TrackResponse.java

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
package com.cabin.plat.domain.track.dto;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
34
import java.time.LocalDateTime;
45
import java.util.List;
56
import lombok.*;
67

7-
public class TrackResponse {
8+
public class TrackResponse {
89

910
@Getter
1011
@Builder
1112
@AllArgsConstructor
1213
@NoArgsConstructor
1314
public static class TrackMapList {
15+
@Schema(description = "트랙 리스트")
1416
private List<TrackMap> tracks;
1517
}
1618

@@ -19,6 +21,7 @@ public static class TrackMapList {
1921
@AllArgsConstructor
2022
@NoArgsConstructor
2123
public static class TrackDetailList {
24+
@Schema(description = "트랙 디테일 리스트")
2225
private List<TrackDetail> trackDetails;
2326
}
2427

@@ -28,10 +31,19 @@ public static class TrackDetailList {
2831
@NoArgsConstructor
2932
@EqualsAndHashCode
3033
public static class TrackMap {
34+
@Schema(description = "트랙 고유 ID", example = "1")
3135
private Long trackId;
36+
37+
@Schema(description = "트랙 ISRC 코드", example = "isrc2")
3238
private String isrc;
39+
40+
@Schema(description = "트랙의 위도", example = "36.015733")
3341
private Double latitude;
42+
43+
@Schema(description = "트랙의 경도", example = "129.322700")
3444
private Double longitude;
45+
46+
@Schema(description = "좋아요 여부", example = "false")
3547
private Boolean isLiked;
3648
}
3749

@@ -40,17 +52,40 @@ public static class TrackMap {
4052
@AllArgsConstructor
4153
@NoArgsConstructor
4254
public static class TrackDetail {
55+
@Schema(description = "트랙 고유 ID", example = "1")
4356
private Long trackId;
57+
58+
@Schema(description = "트랙 ISRC 코드", example = "BRBMG0300729")
4459
private String isrc;
60+
61+
@Schema(description = "트랙 생성일", example = "2024-09-07T17:40:43.049879")
4562
private LocalDateTime createdAt;
63+
64+
@Schema(description = "트랙의 위도", example = "36.014188")
4665
private Double latitude;
66+
67+
@Schema(description = "트랙의 경도", example = "129.325802")
4768
private Double longitude;
69+
70+
@Schema(description = "건물 이름", example = "포항공대제1융합관")
4871
private String buildingName;
72+
73+
@Schema(description = "주소", example = "경상북도 포항시 남구 지곡동")
4974
private String address;
75+
76+
@Schema(description = "트랙 이미지 URL", example = "https://example.com/track.png")
5077
private String imageUrl;
78+
79+
@Schema(description = "트랙 내용", example = "트랙 게시물 본문입니다.")
5180
private String content;
81+
82+
@Schema(description = "좋아요 수", example = "12")
5283
private int likeCount;
84+
85+
@Schema(description = "좋아요 여부", example = "false")
5386
private Boolean isLiked;
87+
88+
@Schema(description = "작성자 정보")
5489
private MemberInfo member;
5590
}
5691

@@ -59,8 +94,13 @@ public static class TrackDetail {
5994
@AllArgsConstructor
6095
@NoArgsConstructor
6196
public static class MemberInfo {
97+
@Schema(description = "회원 고유 ID", example = "1")
6298
private Long memberId;
99+
100+
@Schema(description = "회원 닉네임", example = "plat")
63101
private String memberNickname;
102+
103+
@Schema(description = "회원 아바타 이미지 URL", example = "https://example.com/avatar.png")
64104
private String avatar;
65105
}
66106

@@ -69,6 +109,7 @@ public static class MemberInfo {
69109
@AllArgsConstructor
70110
@NoArgsConstructor
71111
public static class TrackId {
112+
@Schema(description = "트랙 고유 ID", example = "1")
72113
private Long trackId;
73114
}
74115

@@ -77,6 +118,7 @@ public static class TrackId {
77118
@AllArgsConstructor
78119
@NoArgsConstructor
79120
public static class ReportId {
121+
@Schema(description = "리포트 고유 ID", example = "100")
80122
private Long reportId;
81123
}
82124
}

0 commit comments

Comments
 (0)