From a446f08162f61efe846beab8d76639cc7c69dbe4 Mon Sep 17 00:00:00 2001 From: seungryeol Date: Sat, 14 Sep 2024 15:56:42 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[fix]=20SelectMyVeggieListDto.java=20?= =?UTF-8?q?=EC=A3=BC=EC=84=9D=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/SelectMyVeggieListDto.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/SelectMyVeggieListDto.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/SelectMyVeggieListDto.java index cd9e3fff..508cafe5 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/SelectMyVeggieListDto.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/SelectMyVeggieListDto.java @@ -10,13 +10,13 @@ import java.util.List; -@AllArgsConstructor -@Getter -public class SelectMyVeggieListDto { - - public static List processData(List myVeggieList){ - return myVeggieList.stream() - .map(myVeggie -> SelectMyVeggieListResponse.of(myVeggie.getId(),myVeggie.getNickname())) - .toList(); - } -} +//@AllArgsConstructor +//@Getter +//public class SelectMyVeggieListDto { +// +// public static List processData(List myVeggieList){ +// return myVeggieList.stream() +// .map(myVeggie -> SelectMyVeggieListResponse.of(myVeggie.getId(),myVeggie.getNickname())) +// .toList(); +// } +//} From 1130ed1de7756e5530f28cebc1c79453be29e943 Mon Sep 17 00:00:00 2001 From: seungryeol Date: Sat, 14 Sep 2024 15:57:08 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[add]=20byte-buddy=EC=9D=98=EC=A1=B4?= =?UTF-8?q?=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 8678ba5a..52ccd63a 100644 --- a/build.gradle +++ b/build.gradle @@ -64,6 +64,8 @@ dependencies { // 유효성 검사 implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'net.bytebuddy:byte-buddy:1.14.4' + } tasks.named('bootBuildImage') { From 1c64182cf84be8ffac98b53a7c4f2665963a6821 Mon Sep 17 00:00:00 2001 From: seungryeol Date: Sat, 14 Sep 2024 15:57:40 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[fix]=20=EC=8B=AC=ED=94=8C=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20api=EC=9D=98=20userFarmCludId=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/SelectMyVeggieListResponse.java | 1 + .../myveggiegarden/service/MyVeggieGardenService.java | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/SelectMyVeggieListResponse.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/SelectMyVeggieListResponse.java index ed61d014..b893d1b8 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/SelectMyVeggieListResponse.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/dto/response/SelectMyVeggieListResponse.java @@ -15,6 +15,7 @@ public class SelectMyVeggieListResponse { // List simpleMyVeggieList; public Long myVeggieId; public String nickname; + public int userFarmClubId; } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieGardenService.java b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieGardenService.java index 7bd71b03..d999a97e 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieGardenService.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/myveggiegarden/service/MyVeggieGardenService.java @@ -54,10 +54,18 @@ public BaseResponseDto settingMyVeggie(Long userId, SettingMyVeggieRequest se @Transactional public BaseResponseDto> selectMyVeggieList(Long userId) { List myVeggieList = bringMyVeggieData(userId); - List selectMyVeggieLists = SelectMyVeggieListDto.processData(myVeggieList); + List selectMyVeggieLists = processSimpleVeggieData(myVeggieList); return BaseResponseDto.of(SuccessCode.SUCCESS,selectMyVeggieLists); } + public List processSimpleVeggieData(List myVeggieList){ + return myVeggieList.stream() + .map(myVeggie -> SelectMyVeggieListResponse.of(myVeggie.getId(),myVeggie.getNickname(), checkFarmClubAffiliation(myVeggie))) + .toList(); + } + + + @Transactional public BaseResponseDto deleteMyVeggie(DeleteMyVeggieRequest deleteMyVeggieRequest) { deleteMyVeggieById((deleteMyVeggieRequest.getMyVeggieId())); @@ -83,7 +91,6 @@ public BaseResponseDto selectMyVeggieProfile(Long @Transactional public BaseResponseDto> selectDetailMyVeggieList(Long userId) { - List myVeggieList = bringMyVeggieData(userId); List selectMyVeggieList = myDetailMyVeggieDto.processData(myVeggieList); return BaseResponseDto.of(SuccessCode.SUCCESS,selectMyVeggieList);