feat: api wrapping
This commit is contained in:
@@ -45,7 +45,7 @@ public class ZooApiController {
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = ZooDto.AddReq.class))),
|
||||
schema = @Schema(implementation = ZooDto.Detail.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.zoo.dto;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.kamco.cd.kamcoback.config.enums.EnumType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -14,6 +15,7 @@ import org.springframework.data.domain.Sort;
|
||||
|
||||
public class AnimalDto {
|
||||
|
||||
@Schema(name = "AnimalAddReq", description = "동물 생성 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -23,9 +25,10 @@ public class AnimalDto {
|
||||
private Category category;
|
||||
private Species species;
|
||||
private String name;
|
||||
private Long zooId; // 동물원 ID (선택)
|
||||
private String zooUuid; // 동물원 UUID (선택)
|
||||
}
|
||||
|
||||
@Schema(name = "AnimalBasic", description = "동물 기본 정보")
|
||||
@Getter
|
||||
public static class Basic {
|
||||
|
||||
@@ -98,6 +101,7 @@ public class AnimalDto {
|
||||
private final String text;
|
||||
}
|
||||
|
||||
@Schema(name = "AnimalSearchReq", description = "동물 검색 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.zoo.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -13,6 +14,7 @@ import org.springframework.data.domain.Sort;
|
||||
|
||||
public class ZooDto {
|
||||
|
||||
@Schema(name = "ZooAddReq", description = "동물원 생성 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -24,6 +26,7 @@ public class ZooDto {
|
||||
private String description;
|
||||
}
|
||||
|
||||
@Schema(name = "ZooBasic", description = "동물원 기본 정보")
|
||||
@Getter
|
||||
public static class Basic {
|
||||
|
||||
@@ -63,6 +66,7 @@ public class ZooDto {
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "ZooDetail", description = "동물원 상세 정보 (동물 개수 포함)")
|
||||
@Getter
|
||||
public static class Detail extends Basic {
|
||||
|
||||
@@ -82,6 +86,7 @@ public class ZooDto {
|
||||
}
|
||||
}
|
||||
|
||||
@Schema(name = "ZooSearchReq", description = "동물원 검색 요청")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
|
||||
Reference in New Issue
Block a user