Skip to content

Commit

Permalink
[feat] 팜클럽 유저 리스트 조회 API
Browse files Browse the repository at this point in the history
  • Loading branch information
MinchoGreenT committed Aug 24, 2024
1 parent 52fbe1e commit 5b0d065
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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<GetFarmClubUserVo> userList
) {
public static GetFarmClubUserListResponseDto of(List<GetFarmClubUserVo> userList) {
return GetFarmClubUserListResponseDto.builder()
.userList(userList)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -36,6 +37,10 @@ public List<GetMyFarmClubListResponseDto> getUserFarmClubList(Long userId) {
return farmClubRepository.findMyFarmClubList(userId);
}

public GetFarmClubUserListResponseDto getFarmClubUserList(Long farmClubId) {
return GetFarmClubUserListResponseDto.of(farmClubRepository.findFarmClubUserList(farmClubId));
}

public List<FarmClub> getRecommendedFarmClubList(String level) {
return farmClubRepository.getRecommendedFarmClubList(level);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public List<GetMyFarmClubListResponseDto> 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());
Expand Down

0 comments on commit 5b0d065

Please sign in to comment.