diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java index 9db1e0b..ab0bb1f 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/controller/FarmClubController.java @@ -120,6 +120,13 @@ public BaseResponseDto getMissionPostList( return BaseResponseDto.of(SuccessCode.SUCCESS, missionPostService.getMissionPostList(user.getUserId(), farmClubId)); } + @GetMapping("/{farmClubId}/user") + public BaseResponseDto getFarmClubUserList( + @PathVariable Long farmClubId + ) { + return BaseResponseDto.of(SuccessCode.SUCCESS, farmClubService.getFarmClubUserList(farmClubId)); + } + @GetMapping("/mission/{missionPostId}") public BaseResponseDto getMissionPostComments( @AuthenticationPrincipal CustomUser user, diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetFarmClubUserListResponseDto.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetFarmClubUserListResponseDto.java new file mode 100644 index 0000000..a43601d --- /dev/null +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/dto/res/GetFarmClubUserListResponseDto.java @@ -0,0 +1,18 @@ +package com.modernfarmer.farmusspring.domain.farmclub.dto.res; + +import com.modernfarmer.farmusspring.domain.farmclub.vo.GetFarmClubUserVo; +import lombok.AccessLevel; +import lombok.Builder; + +import java.util.List; + +@Builder(access = AccessLevel.PRIVATE) +public record GetFarmClubUserListResponseDto( + List userList +) { + public static GetFarmClubUserListResponseDto of(List userList) { + return GetFarmClubUserListResponseDto.builder() + .userList(userList) + .build(); + } +} diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/FarmClubHelper.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/FarmClubHelper.java index f3c21cf..89fd9af 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/FarmClubHelper.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/helper/FarmClubHelper.java @@ -1,5 +1,6 @@ package com.modernfarmer.farmusspring.domain.farmclub.helper; +import com.modernfarmer.farmusspring.domain.farmclub.dto.res.GetFarmClubUserListResponseDto; import com.modernfarmer.farmusspring.domain.farmclub.dto.res.GetMyFarmClubListResponseDto; import com.modernfarmer.farmusspring.domain.farmclub.dto.res.GetRecommendFarmClubResponseDto; import com.modernfarmer.farmusspring.domain.farmclub.dto.res.SearchFarmClubResponseDto; @@ -36,6 +37,10 @@ public List getUserFarmClubList(Long userId) { return farmClubRepository.findMyFarmClubList(userId); } + public GetFarmClubUserListResponseDto getFarmClubUserList(Long farmClubId) { + return GetFarmClubUserListResponseDto.of(farmClubRepository.findFarmClubUserList(farmClubId)); + } + public List getRecommendedFarmClubList(String level) { return farmClubRepository.getRecommendedFarmClubList(level); } diff --git a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/FarmClubService.java b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/FarmClubService.java index a4b3321..5db4cd3 100644 --- a/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/FarmClubService.java +++ b/src/main/java/com/modernfarmer/farmusspring/domain/farmclub/service/FarmClubService.java @@ -143,6 +143,10 @@ public List getMyFarmClubList(Long userId) { return farmClubHelper.getUserFarmClubList(userId); } + public GetFarmClubUserListResponseDto getFarmClubUserList(Long farmClubId) { + return farmClubHelper.getFarmClubUserList(farmClubId); + } + public GetMyVeggieResponseDto getMyVeggieForRegister(Long userId, String veggieInfoId) { MyVeggieVo myVeggie = myVeggieHelper.getMyVeggieInfo(userId, veggieInfoId); return GetMyVeggieResponseDto.of(myVeggie.myVeggieId(), myVeggie.nickname());