diff --git a/build.gradle b/build.gradle index 8678ba5..52ccd63 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') { 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 cd9e3ff..508cafe 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(); +// } +//} 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 ed61d01..b893d1b 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 7bd71b0..d999a97 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);