Skip to content

Commit

Permalink
[Chore] #268 - Cafe DTO 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kimahhh committed Jun 15, 2023
1 parent 52ccc90 commit 333775e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@Schema(description = "카페 등록 및 수정 Request : 카페 등록 및 수정 시 필요한 정보")
@Data
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class PostCafeReq {
public class CafeCreateInDTO {

@Schema(description = "이름", example = "롬곡")
@NotBlank(message = "카페 이름을 입력해주세요.")
Expand All @@ -18,7 +18,7 @@ public class PostCafeReq {
private String address;

@Builder
public PostCafeReq(String name, String address) {
public CafeCreateInDTO(String name, String address) {
this.name = name;
this.address = address;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import lombok.AccessLevel;
import lombok.Builder;
import shop.cazait.domain.cafe.entity.Cafe;
import shop.cazait.domain.cafeimage.dto.GetCafeImageRes;
import shop.cazait.domain.cafeimage.dto.CafeImageGetOutDTO;
import shop.cazait.domain.congestion.entity.CongestionStatus;

import java.util.List;

@Schema(description = "특정 카페 정보 조회 Response : 카페 조회 시 얻을 수 있는 정보")
@Builder(access = AccessLevel.PRIVATE)
public class GetCafeRes {
public class CafeGetOutDTO {
@JsonProperty
@Schema(description = "카페 ID", example = "1")
private Long cafeId;
Expand All @@ -33,20 +33,20 @@ public class GetCafeRes {
private String latitude;
@JsonProperty
@Schema(description = "이미지 url")
private List<GetCafeImageRes> getCafeImageRes;
private List<CafeImageGetOutDTO> cafeImageRes;
@JsonProperty
@Schema(description = "방문 기록 등록 여부", example = "36.987561")
private String logResult;

public static GetCafeRes of(Cafe cafe, List<GetCafeImageRes> getCafeImageRes, String logResult) {
return GetCafeRes.builder()
public static CafeGetOutDTO of(Cafe cafe, List<CafeImageGetOutDTO> cafeImageRes, String logResult) {
return CafeGetOutDTO.builder()
.cafeId(cafe.getId())
.congestionStatus(cafe.getCongestion().getCongestionStatus())
.name(cafe.getName())
.address(cafe.getAddress())
.longitude(cafe.getCoordinate().getLongitude())
.latitude(cafe.getCoordinate().getLatitude())
.getCafeImageRes(getCafeImageRes)
.cafeImageRes(cafeImageRes)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Schema(description = "모든 카페 정보 조회 Response : 카페 조회 시 얻을 수 있는 정보")
@Builder(access = AccessLevel.PRIVATE)
@Getter
public class GetCafesRes {
public class CafeListOutDTO {
@JsonProperty
@Schema(description = "카페 ID", example = "1")
private Long cafeId;
Expand Down Expand Up @@ -42,8 +42,8 @@ public class GetCafesRes {
@Schema(description = "관심 카페 여부", example = "true")
private boolean favorite;

public static GetCafesRes of(Cafe cafe, List<String> cafeImages, int distance, boolean favorite) {
return GetCafesRes.builder()
public static CafeListOutDTO of(Cafe cafe, List<String> cafeImages, int distance, boolean favorite) {
return CafeListOutDTO.builder()
.cafeId(cafe.getId())
.congestionStatus(cafe.getCongestion().getCongestionStatus())
.name(cafe.getName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import lombok.Builder;
import lombok.Getter;
import shop.cazait.domain.cafe.entity.Cafe;
import shop.cazait.domain.cafeimage.dto.GetCafeImageRes;
import shop.cazait.domain.cafeimage.dto.CafeImageGetOutDTO;
import shop.cazait.domain.congestion.entity.CongestionStatus;

import java.util.List;
@Schema(description = "카페 등록 및 수정 Response : 카페 등록 및 수정 후 받는 응답")
@Builder(access = AccessLevel.PRIVATE)
@Getter
public class PostCafeRes {
public class CafeUpdateOutDTO {
@Schema(description = "카페 ID", example = "1")
private Long cafeId;
@Schema(description = "혼잡도 상태", example = "FREE")
Expand All @@ -22,15 +22,15 @@ public class PostCafeRes {
@Schema(description = "위치", example = "서울특별시 광진구 군자동 광나루로17길 18")
private String address;
@Schema(description = "이미지 url")
private List<GetCafeImageRes> getCafeImageRes;
private List<CafeImageGetOutDTO> cafeImageRes;

public static PostCafeRes of(Cafe cafe, List<GetCafeImageRes> getCafeImageResList) {
return PostCafeRes.builder()
public static CafeUpdateOutDTO of(Cafe cafe, List<CafeImageGetOutDTO> cafeImageGetOutDTOList) {
return CafeUpdateOutDTO.builder()
.cafeId(cafe.getId())
.congestionStatus(cafe.getCongestion().getCongestionStatus())
.name(cafe.getName())
.address(cafe.getAddress())
.getCafeImageRes(getCafeImageResList)
.cafeImageRes(cafeImageGetOutDTOList)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
@Schema(description = "카페 이미지 조회 Response : 카페 이미지 정보")
@Builder(access = AccessLevel.PRIVATE)
@Getter
public class GetCafeImageRes {
public class CafeImageGetOutDTO {
@JsonProperty
@Schema(description = "카페 이미지 ID", example = "1")
private Long cafeImageId;
@JsonProperty
@Schema(description = "카페 이미지 url", example = "https://cazait-bucket.s3.ap-northeast-2.amazonaws.com/cafe-image/abcdefghijklmnopqrstuvwxyz")
private String imageUrl;

public static GetCafeImageRes of(CafeImage cafeImage) {
return GetCafeImageRes.builder()
public static CafeImageGetOutDTO of(CafeImage cafeImage) {
return CafeImageGetOutDTO.builder()
.cafeImageId(cafeImage.getId())
.imageUrl(cafeImage.getImageUrl())
.build();
Expand Down

0 comments on commit 333775e

Please sign in to comment.