From af9a0c1703a11c50fbbd941ff2b74c9a5575818e Mon Sep 17 00:00:00 2001 From: lowgiant Date: Mon, 14 Feb 2022 03:34:05 +0900 Subject: [PATCH] fix: Buyer [#353] --- .../domain/sub/buyer/dto/BuyerDistributeResponseDto.java | 3 +++ .../bancow/bancowback/domain/sub/buyer/mapper/BuyerMapper.java | 2 ++ .../domain/sub/buyer/controller/BuyerControllerTest.java | 2 ++ 3 files changed, 7 insertions(+) diff --git a/spring/src/main/java/com/bancow/bancowback/domain/sub/buyer/dto/BuyerDistributeResponseDto.java b/spring/src/main/java/com/bancow/bancowback/domain/sub/buyer/dto/BuyerDistributeResponseDto.java index cfbf37de..4e4b4a53 100644 --- a/spring/src/main/java/com/bancow/bancowback/domain/sub/buyer/dto/BuyerDistributeResponseDto.java +++ b/spring/src/main/java/com/bancow/bancowback/domain/sub/buyer/dto/BuyerDistributeResponseDto.java @@ -26,6 +26,9 @@ public class BuyerDistributeResponseDto { @JsonProperty("farm_ceo_name") private String farmCEOName; + private String content; + private String title; + @JsonProperty("farm_image") private String farmImage; diff --git a/spring/src/main/java/com/bancow/bancowback/domain/sub/buyer/mapper/BuyerMapper.java b/spring/src/main/java/com/bancow/bancowback/domain/sub/buyer/mapper/BuyerMapper.java index fe0bed92..9e3f4042 100644 --- a/spring/src/main/java/com/bancow/bancowback/domain/sub/buyer/mapper/BuyerMapper.java +++ b/spring/src/main/java/com/bancow/bancowback/domain/sub/buyer/mapper/BuyerMapper.java @@ -15,6 +15,8 @@ public BuyerDistributeResponseDto toDistributeResponseDto(Buyer buyer) { .id(buyer.getId()) .buyerName(buyer.getBuyerName()) .farmName(buyer.getFarm().getFarmName()) + .content(buyer.getContent()) + .title(buyer.getTitle()) .farmCEOName(buyer.getFarm().getCeoName()) .farmImage("https://kr.object.ncloudstorage.com/bancowback/" + buyer.getFarm().getFarmImage()) .build(); diff --git a/spring/src/test/java/com/bancow/bancowback/domain/sub/buyer/controller/BuyerControllerTest.java b/spring/src/test/java/com/bancow/bancowback/domain/sub/buyer/controller/BuyerControllerTest.java index a059b19d..83e237fa 100644 --- a/spring/src/test/java/com/bancow/bancowback/domain/sub/buyer/controller/BuyerControllerTest.java +++ b/spring/src/test/java/com/bancow/bancowback/domain/sub/buyer/controller/BuyerControllerTest.java @@ -36,6 +36,8 @@ void getBuyerDistribute() throws Exception { fieldWithPath("data[0].id").description("id"), fieldWithPath("data[0].buyer_name").description("구매자 이름"), fieldWithPath("data[0].farm_name").description("농장 이름"), + fieldWithPath("data[0].title").description("제목"), + fieldWithPath("data[0].content").description("내용"), fieldWithPath("data[0].farm_ceo_name").description("농장 대표님 이름"), fieldWithPath("data[0].farm_image").description("농장 사진"), fieldWithPath("status").description("HTTP Status")