Skip to content

Commit af7c028

Browse files
committed
docs: Swagger 필수인자 명시 (#425)
* dosc: swagger 3.1 로 설정 * dosc: Activity 필수 여부 추가 * dosc: bus 응답 추가 * dosc: article 응답 추가 * docs: Dept, Dining Dto 설명 추가 * docs: land * docs: land dto 보완 * docs: Member Dto 구체화 * docs: Owner DTO 구체화 * docs: OwnerShop DTO 구체화 * chore: record 명 변경 * chore: shop record 수정 * chore: timetable record 수정 * chore: user dto 개선 * chore: version dto 개선 * chore: bus dto 개선 * test: 테스트 설정파일 위치 변경
1 parent 85e2a1f commit af7c028

File tree

83 files changed

+950
-574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+950
-574
lines changed

src/main/java/in/koreatech/koin/domain/activity/dto/ActivityResponse.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package in.koreatech.koin.domain.activity.dto;
22

33
import static com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
4+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED;
5+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
46

57
import java.time.LocalDate;
68
import java.time.LocalDateTime;
@@ -14,33 +16,33 @@
1416

1517
@JsonNaming(value = SnakeCaseStrategy.class)
1618
public record ActivityResponse(
17-
@Schema(description = "활동 날짜", example = "2019-07-29")
19+
@Schema(description = "활동 날짜", example = "2019-07-29", requiredMode = REQUIRED)
1820
@JsonFormat(pattern = "yyyy-MM-dd")
1921
LocalDate date,
2022

21-
@Schema(description = "삭제 여부", example = "false")
23+
@Schema(description = "삭제 여부", example = "false", requiredMode = REQUIRED)
2224
Boolean isDeleted,
2325

24-
@Schema(description = "최근 업데이트 일시", example = "2019-08-16 23:01:52")
26+
@Schema(description = "최근 업데이트 일시", example = "2019-08-16 23:01:52", requiredMode = REQUIRED)
2527
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
2628
LocalDateTime updatedAt,
2729

28-
@Schema(description = "초기 생성 일시", example = "2019-08-16 23:01:52")
30+
@Schema(description = "초기 생성 일시", example = "2019-08-16 23:01:52", requiredMode = REQUIRED)
2931
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
3032
LocalDateTime createdAt,
3133

32-
@Schema(description = "활동 설명", example = "더 편리한 서비스 제공을 위해 시간표 기능을 추가했습니다.")
34+
@Schema(description = "활동 설명", example = "더 편리한 서비스 제공을 위해 시간표 기능을 추가했습니다.", requiredMode = REQUIRED)
3335
String description,
3436

3537
@Schema(description = "이미지 URL 목록", example = """
3638
["https://test2.com.png", "https://test3.com.png"]
37-
""")
39+
""", requiredMode = NOT_REQUIRED)
3840
List<String> imageUrls,
3941

40-
@Schema(description = "고유 식별자", example = "1")
42+
@Schema(description = "고유 식별자", example = "1", requiredMode = REQUIRED)
4143
Integer id,
4244

43-
@Schema(description = "제목", example = "코인 시간표 기능 추가")
45+
@Schema(description = "제목", example = "코인 시간표 기능 추가", requiredMode = REQUIRED)
4446
String title
4547
) {
4648

src/main/java/in/koreatech/koin/domain/bus/dto/BusCourseResponse.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
package in.koreatech.koin.domain.bus.dto;
22

33
import static com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
4+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED;
45

56
import com.fasterxml.jackson.databind.annotation.JsonNaming;
67

78
import in.koreatech.koin.domain.bus.model.mongo.BusCourse;
9+
import io.swagger.v3.oas.annotations.media.Schema;
810

911
@JsonNaming(value = SnakeCaseStrategy.class)
1012
public record BusCourseResponse(
13+
@Schema(description = "버스 타입", example = "shuttle", requiredMode = NOT_REQUIRED)
1114
String busType,
15+
@Schema(description = "방향", example = "to", requiredMode = NOT_REQUIRED)
1216
String direction,
17+
@Schema(description = "기준", example = "청주", requiredMode = NOT_REQUIRED)
1318
String region
1419

1520
) {

src/main/java/in/koreatech/koin/domain/bus/dto/BusRemainTimeResponse.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package in.koreatech.koin.domain.bus.dto;
22

33
import static com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
4+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED;
45

56
import java.time.Clock;
67
import java.util.List;
@@ -10,9 +11,11 @@
1011
import in.koreatech.koin.domain.bus.model.BusRemainTime;
1112
import in.koreatech.koin.domain.bus.model.city.CityBusRemainTime;
1213
import in.koreatech.koin.domain.bus.model.enums.BusType;
14+
import io.swagger.v3.oas.annotations.media.Schema;
1315

1416
@JsonNaming(SnakeCaseStrategy.class)
1517
public record BusRemainTimeResponse(
18+
@Schema(description = "버스 타입", example = "shuttle", requiredMode = NOT_REQUIRED)
1619
String busType,
1720
InnerBusResponse nowBus,
1821
InnerBusResponse nextBus
@@ -28,7 +31,10 @@ public static BusRemainTimeResponse of(BusType busType, List<? extends BusRemain
2831

2932
@JsonNaming(SnakeCaseStrategy.class)
3033
private record InnerBusResponse(
34+
@Schema(description = "버스 번호", example = "400", requiredMode = NOT_REQUIRED)
3135
Long busNumber,
36+
37+
@Schema(description = "남은 시간 / 초", example = "10417", requiredMode = NOT_REQUIRED)
3238
Long remainTime
3339
) {
3440

src/main/java/in/koreatech/koin/domain/bus/dto/ExpressBusRemainTime.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
package in.koreatech.koin.domain.bus.dto;
22

3+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
4+
35
import java.time.LocalTime;
46

57
import in.koreatech.koin.domain.bus.model.BusRemainTime;
8+
import io.swagger.v3.oas.annotations.media.Schema;
69
import lombok.Getter;
710

811
@Getter
912
public class ExpressBusRemainTime extends BusRemainTime {
1013

14+
@Schema(description = "버스 타입", example = "express", requiredMode = REQUIRED)
1115
private final String busType;
1216

1317
public ExpressBusRemainTime(LocalTime busArrivalTime, String busType) {

src/main/java/in/koreatech/koin/domain/community/dto/ArticleResponse.java

Lines changed: 54 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package in.koreatech.koin.domain.community.dto;
22

3+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED;
4+
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
5+
36
import java.time.LocalDateTime;
47
import java.util.List;
58

@@ -15,40 +18,40 @@
1518

1619
@JsonNaming(SnakeCaseStrategy.class)
1720
public record ArticleResponse(
18-
@Schema(description = "게시글 고유 ID", example = "1")
21+
@Schema(description = "게시글 고유 ID", example = "1", requiredMode = REQUIRED)
1922
Integer id,
2023

21-
@Schema(description = "게시판 고유 ID", example = "1")
24+
@Schema(description = "게시판 고유 ID", example = "1", requiredMode = REQUIRED)
2225
Integer boardId,
2326

24-
@Schema(description = "제목", example = "제목")
27+
@Schema(description = "제목", example = "제목", requiredMode = REQUIRED)
2528
String title,
2629

27-
@Schema(description = "내용", example = "내용")
30+
@Schema(description = "내용", example = "내용", requiredMode = REQUIRED)
2831
String content,
2932

30-
@Schema(description = "작성자 닉네임", example = "닉네임")
33+
@Schema(description = "작성자 닉네임", example = "닉네임", requiredMode = REQUIRED)
3134
String nickname,
3235

33-
@Schema(description = "해결 여부", example = "false")
34-
Boolean isSolved,
36+
@Schema(description = "해결 여부", example = "false", requiredMode = REQUIRED)
37+
boolean isSolved,
3538

36-
@Schema(description = "공지 여부", example = "false")
37-
Boolean isNotice,
39+
@Schema(description = "공지 여부", example = "false", requiredMode = REQUIRED)
40+
boolean isNotice,
3841

39-
@Schema(description = "내용 요약", example = "내용 요약")
42+
@Schema(description = "내용 요약", example = "내용 요약", requiredMode = NOT_REQUIRED)
4043
@JsonProperty("contentSummary") String contentSummary,
4144

42-
@Schema(description = "조회수", example = "1")
43-
Integer hit,
45+
@Schema(description = "조회수", example = "1", requiredMode = REQUIRED)
46+
int hit,
4447

45-
@Schema(description = "댓글 수", example = "1")
46-
Byte commentCount,
48+
@Schema(description = "댓글 수", example = "1", requiredMode = REQUIRED)
49+
int commentCount,
4750

48-
@Schema(description = "게시판 정보")
51+
@Schema(description = "게시판 정보", requiredMode = REQUIRED)
4952
InnerBoardResponse board,
5053

51-
@Schema(description = "댓글 목록")
54+
@Schema(description = "댓글 목록", requiredMode = NOT_REQUIRED)
5255
List<InnerCommentResponse> comments,
5356

5457
@Schema(description = "생성 일자", example = "2023-01-04 12:00:01")
@@ -79,41 +82,43 @@ public static ArticleResponse of(Article article) {
7982

8083
@JsonNaming(value = SnakeCaseStrategy.class)
8184
private record InnerBoardResponse(
82-
@Schema(description = "게시판 고유 ID", example = "1")
85+
@Schema(description = "게시판 고유 ID", example = "1", requiredMode = REQUIRED)
8386
Integer id,
8487

85-
@Schema(description = "게시판 태그", example = "tag")
88+
@Schema(description = "게시판 태그", example = "tag", requiredMode = REQUIRED)
8689
String tag,
8790

88-
@Schema(description = "게시판 이름", example = "게시판 이름")
91+
@Schema(description = "게시판 이름", example = "게시판 이름", requiredMode = REQUIRED)
8992
String name,
9093

91-
@Schema(description = "익명 여부", example = "false")
94+
@Schema(description = "익명 여부", example = "false", requiredMode = REQUIRED)
9295
boolean isAnonymous,
9396

94-
@Schema(description = "게시글 수", example = "1")
95-
Integer articleCount,
97+
@Schema(description = "게시글 수", example = "1", requiredMode = REQUIRED)
98+
int articleCount,
9699

97-
@Schema(description = "삭제 여부", example = "false")
100+
@Schema(description = "삭제 여부", example = "false", requiredMode = REQUIRED)
98101
boolean isDeleted,
99102

100-
@Schema(description = "공지 여부", example = "false")
103+
@Schema(description = "공지 여부", example = "false", requiredMode = REQUIRED)
101104
boolean isNotice,
102105

103-
@Schema(description = "부모 게시판 고유 ID", example = "1")
106+
@Schema(description = "부모 게시판 고유 ID", example = "1", requiredMode = NOT_REQUIRED)
104107
Integer parentId,
105108

106-
@Schema(description = "순서", example = "1")
107-
Integer seq,
109+
@Schema(description = "순서", example = "1", requiredMode = REQUIRED)
110+
int seq,
108111

109-
@Schema(description = "하위 게시판 목록")
112+
@Schema(description = "하위 게시판 목록", requiredMode = NOT_REQUIRED)
110113
List<InnerBoardResponse> children,
111114

112-
@Schema(description = "생성 일자", example = "2023-01-04 12:00:01")
113-
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime createdAt,
115+
@Schema(description = "생성 일자", example = "2023-01-04 12:00:01", requiredMode = REQUIRED)
116+
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
117+
LocalDateTime createdAt,
114118

115-
@Schema(description = "수정 일자", example = "2023-01-04 12:00:01")
116-
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime updatedAt
119+
@Schema(description = "수정 일자", example = "2023-01-04 12:00:01", requiredMode = REQUIRED)
120+
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
121+
LocalDateTime updatedAt
117122
) {
118123

119124
public static InnerBoardResponse from(Board board) {
@@ -137,34 +142,36 @@ public static InnerBoardResponse from(Board board) {
137142

138143
@JsonNaming(value = SnakeCaseStrategy.class)
139144
private record InnerCommentResponse(
140-
@Schema(description = "댓글 고유 ID", example = "1")
145+
@Schema(description = "댓글 고유 ID", example = "1", requiredMode = NOT_REQUIRED)
141146
Integer id,
142147

143-
@Schema(description = "게시글 고유 ID", example = "1")
148+
@Schema(description = "게시글 고유 ID", example = "1", requiredMode = REQUIRED)
144149
Integer articleId,
145150

146-
@Schema(description = "내용", example = "내용")
151+
@Schema(description = "내용", example = "내용", requiredMode = REQUIRED)
147152
String content,
148153

149-
@Schema(description = "작성자 고유 ID", example = "1")
154+
@Schema(description = "작성자 고유 ID", example = "1", requiredMode = REQUIRED)
150155
Integer userId,
151156

152-
@Schema(description = "작성자 닉네임", example = "닉네임")
157+
@Schema(description = "작성자 닉네임", example = "닉네임", requiredMode = REQUIRED)
153158
String nickname,
154159

155-
@Schema(description = "삭제 여부", example = "false")
156-
Boolean isDeleted,
160+
@Schema(description = "삭제 여부", example = "false", requiredMode = REQUIRED)
161+
boolean isDeleted,
157162

158-
@Schema(description = "수정 권한", example = "false")
159-
@JsonProperty("grantEdit") Boolean grantEdit,
163+
@Schema(description = "수정 권한", example = "false", requiredMode = REQUIRED)
164+
@JsonProperty("grantEdit")
165+
boolean grantEdit,
160166

161-
@Schema(description = "삭제 권한", example = "false")
162-
@JsonProperty("grantDelete") Boolean grantDelete,
167+
@Schema(description = "삭제 권한", example = "false", requiredMode = REQUIRED)
168+
@JsonProperty("grantDelete")
169+
boolean grantDelete,
163170

164-
@Schema(description = "생성 일자", example = "2023-01-04 12:00:01")
171+
@Schema(description = "생성 일자", example = "2023-01-04 12:00:01", requiredMode = REQUIRED)
165172
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime createdAt,
166173

167-
@Schema(description = "수정 일자", example = "2023-01-04 12:00:01")
174+
@Schema(description = "수정 일자", example = "2023-01-04 12:00:01", requiredMode = REQUIRED)
168175
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime updatedAt
169176
) {
170177

@@ -176,8 +183,8 @@ public static InnerCommentResponse from(Comment comment) {
176183
comment.getUserId(),
177184
comment.getNickname(),
178185
comment.getIsDeleted(),
179-
comment.getGrantEdit(),
180-
comment.getGrantDelete(),
186+
comment.isGrantEdit(),
187+
comment.isGrantDelete(),
181188
comment.getCreatedAt(),
182189
comment.getUpdatedAt()
183190
);

0 commit comments

Comments
 (0)