Skip to content

Commit

Permalink
docs: Swagger 필수인자 명시 (#425)
Browse files Browse the repository at this point in the history
* 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: 테스트 설정파일 위치 변경
  • Loading branch information
Choi-JJunho authored Apr 16, 2024
1 parent 24fae5f commit 6452e4b
Show file tree
Hide file tree
Showing 83 changed files with 950 additions and 574 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package in.koreatech.koin.domain.activity.dto;

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

import java.time.LocalDate;
import java.time.LocalDateTime;
Expand All @@ -14,33 +16,33 @@

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

@Schema(description = "삭제 여부", example = "false")
@Schema(description = "삭제 여부", example = "false", requiredMode = REQUIRED)
Boolean isDeleted,

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

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

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

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

@Schema(description = "고유 식별자", example = "1")
@Schema(description = "고유 식별자", example = "1", requiredMode = REQUIRED)
Integer id,

@Schema(description = "제목", example = "코인 시간표 기능 추가")
@Schema(description = "제목", example = "코인 시간표 기능 추가", requiredMode = REQUIRED)
String title
) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package in.koreatech.koin.domain.bus.dto;

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

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

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

@JsonNaming(value = SnakeCaseStrategy.class)
public record BusCourseResponse(
@Schema(description = "버스 타입", example = "shuttle", requiredMode = NOT_REQUIRED)
String busType,
@Schema(description = "방향", example = "to", requiredMode = NOT_REQUIRED)
String direction,
@Schema(description = "기준", example = "청주", requiredMode = NOT_REQUIRED)
String region

) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package in.koreatech.koin.domain.bus.dto;

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

import java.time.Clock;
import java.util.List;
Expand All @@ -10,9 +11,11 @@
import in.koreatech.koin.domain.bus.model.BusRemainTime;
import in.koreatech.koin.domain.bus.model.city.CityBusRemainTime;
import in.koreatech.koin.domain.bus.model.enums.BusType;
import io.swagger.v3.oas.annotations.media.Schema;

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

@JsonNaming(SnakeCaseStrategy.class)
private record InnerBusResponse(
@Schema(description = "버스 번호", example = "400", requiredMode = NOT_REQUIRED)
Long busNumber,

@Schema(description = "남은 시간 / 초", example = "10417", requiredMode = NOT_REQUIRED)
Long remainTime
) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package in.koreatech.koin.domain.bus.dto;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

import java.time.LocalTime;

import in.koreatech.koin.domain.bus.model.BusRemainTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

@Getter
public class ExpressBusRemainTime extends BusRemainTime {

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

public ExpressBusRemainTime(LocalTime busArrivalTime, String busType) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package in.koreatech.koin.domain.community.dto;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;

import java.time.LocalDateTime;
import java.util.List;

Expand All @@ -15,40 +18,40 @@

@JsonNaming(SnakeCaseStrategy.class)
public record ArticleResponse(
@Schema(description = "게시글 고유 ID", example = "1")
@Schema(description = "게시글 고유 ID", example = "1", requiredMode = REQUIRED)
Integer id,

@Schema(description = "게시판 고유 ID", example = "1")
@Schema(description = "게시판 고유 ID", example = "1", requiredMode = REQUIRED)
Integer boardId,

@Schema(description = "제목", example = "제목")
@Schema(description = "제목", example = "제목", requiredMode = REQUIRED)
String title,

@Schema(description = "내용", example = "내용")
@Schema(description = "내용", example = "내용", requiredMode = REQUIRED)
String content,

@Schema(description = "작성자 닉네임", example = "닉네임")
@Schema(description = "작성자 닉네임", example = "닉네임", requiredMode = REQUIRED)
String nickname,

@Schema(description = "해결 여부", example = "false")
Boolean isSolved,
@Schema(description = "해결 여부", example = "false", requiredMode = REQUIRED)
boolean isSolved,

@Schema(description = "공지 여부", example = "false")
Boolean isNotice,
@Schema(description = "공지 여부", example = "false", requiredMode = REQUIRED)
boolean isNotice,

@Schema(description = "내용 요약", example = "내용 요약")
@Schema(description = "내용 요약", example = "내용 요약", requiredMode = NOT_REQUIRED)
@JsonProperty("contentSummary") String contentSummary,

@Schema(description = "조회수", example = "1")
Integer hit,
@Schema(description = "조회수", example = "1", requiredMode = REQUIRED)
int hit,

@Schema(description = "댓글 수", example = "1")
Byte commentCount,
@Schema(description = "댓글 수", example = "1", requiredMode = REQUIRED)
int commentCount,

@Schema(description = "게시판 정보")
@Schema(description = "게시판 정보", requiredMode = REQUIRED)
InnerBoardResponse board,

@Schema(description = "댓글 목록")
@Schema(description = "댓글 목록", requiredMode = NOT_REQUIRED)
List<InnerCommentResponse> comments,

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

@JsonNaming(value = SnakeCaseStrategy.class)
private record InnerBoardResponse(
@Schema(description = "게시판 고유 ID", example = "1")
@Schema(description = "게시판 고유 ID", example = "1", requiredMode = REQUIRED)
Integer id,

@Schema(description = "게시판 태그", example = "tag")
@Schema(description = "게시판 태그", example = "tag", requiredMode = REQUIRED)
String tag,

@Schema(description = "게시판 이름", example = "게시판 이름")
@Schema(description = "게시판 이름", example = "게시판 이름", requiredMode = REQUIRED)
String name,

@Schema(description = "익명 여부", example = "false")
@Schema(description = "익명 여부", example = "false", requiredMode = REQUIRED)
boolean isAnonymous,

@Schema(description = "게시글 수", example = "1")
Integer articleCount,
@Schema(description = "게시글 수", example = "1", requiredMode = REQUIRED)
int articleCount,

@Schema(description = "삭제 여부", example = "false")
@Schema(description = "삭제 여부", example = "false", requiredMode = REQUIRED)
boolean isDeleted,

@Schema(description = "공지 여부", example = "false")
@Schema(description = "공지 여부", example = "false", requiredMode = REQUIRED)
boolean isNotice,

@Schema(description = "부모 게시판 고유 ID", example = "1")
@Schema(description = "부모 게시판 고유 ID", example = "1", requiredMode = NOT_REQUIRED)
Integer parentId,

@Schema(description = "순서", example = "1")
Integer seq,
@Schema(description = "순서", example = "1", requiredMode = REQUIRED)
int seq,

@Schema(description = "하위 게시판 목록")
@Schema(description = "하위 게시판 목록", requiredMode = NOT_REQUIRED)
List<InnerBoardResponse> children,

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

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

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

@JsonNaming(value = SnakeCaseStrategy.class)
private record InnerCommentResponse(
@Schema(description = "댓글 고유 ID", example = "1")
@Schema(description = "댓글 고유 ID", example = "1", requiredMode = NOT_REQUIRED)
Integer id,

@Schema(description = "게시글 고유 ID", example = "1")
@Schema(description = "게시글 고유 ID", example = "1", requiredMode = REQUIRED)
Integer articleId,

@Schema(description = "내용", example = "내용")
@Schema(description = "내용", example = "내용", requiredMode = REQUIRED)
String content,

@Schema(description = "작성자 고유 ID", example = "1")
@Schema(description = "작성자 고유 ID", example = "1", requiredMode = REQUIRED)
Integer userId,

@Schema(description = "작성자 닉네임", example = "닉네임")
@Schema(description = "작성자 닉네임", example = "닉네임", requiredMode = REQUIRED)
String nickname,

@Schema(description = "삭제 여부", example = "false")
Boolean isDeleted,
@Schema(description = "삭제 여부", example = "false", requiredMode = REQUIRED)
boolean isDeleted,

@Schema(description = "수정 권한", example = "false")
@JsonProperty("grantEdit") Boolean grantEdit,
@Schema(description = "수정 권한", example = "false", requiredMode = REQUIRED)
@JsonProperty("grantEdit")
boolean grantEdit,

@Schema(description = "삭제 권한", example = "false")
@JsonProperty("grantDelete") Boolean grantDelete,
@Schema(description = "삭제 권한", example = "false", requiredMode = REQUIRED)
@JsonProperty("grantDelete")
boolean grantDelete,

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

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

Expand All @@ -176,8 +183,8 @@ public static InnerCommentResponse from(Comment comment) {
comment.getUserId(),
comment.getNickname(),
comment.getIsDeleted(),
comment.getGrantEdit(),
comment.getGrantDelete(),
comment.isGrantEdit(),
comment.isGrantDelete(),
comment.getCreatedAt(),
comment.getUpdatedAt()
);
Expand Down
Loading

0 comments on commit 6452e4b

Please sign in to comment.