Skip to content

Commit

Permalink
[fix] 심플 데이터 api의 userFarmCludId 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryeolee committed Sep 14, 2024
1 parent 1130ed1 commit 1c64182
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class SelectMyVeggieListResponse {
// List<SelectMyVeggieListDto> simpleMyVeggieList;
public Long myVeggieId;
public String nickname;
public int userFarmClubId;


}
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,18 @@ public BaseResponseDto<?> settingMyVeggie(Long userId, SettingMyVeggieRequest se
@Transactional
public BaseResponseDto<List<SelectMyVeggieListResponse>> selectMyVeggieList(Long userId) {
List<MyVeggie> myVeggieList = bringMyVeggieData(userId);
List<SelectMyVeggieListResponse> selectMyVeggieLists = SelectMyVeggieListDto.processData(myVeggieList);
List<SelectMyVeggieListResponse> selectMyVeggieLists = processSimpleVeggieData(myVeggieList);
return BaseResponseDto.of(SuccessCode.SUCCESS,selectMyVeggieLists);
}

public List<SelectMyVeggieListResponse> processSimpleVeggieData(List<MyVeggie> myVeggieList){
return myVeggieList.stream()
.map(myVeggie -> SelectMyVeggieListResponse.of(myVeggie.getId(),myVeggie.getNickname(), checkFarmClubAffiliation(myVeggie)))
.toList();
}



@Transactional
public BaseResponseDto<Void> deleteMyVeggie(DeleteMyVeggieRequest deleteMyVeggieRequest) {
deleteMyVeggieById((deleteMyVeggieRequest.getMyVeggieId()));
Expand All @@ -83,7 +91,6 @@ public BaseResponseDto<SelectMyVeggieProfileResponse> selectMyVeggieProfile(Long

@Transactional
public BaseResponseDto<List<MyDetailMyVeggie>> selectDetailMyVeggieList(Long userId) {

List<MyVeggie> myVeggieList = bringMyVeggieData(userId);
List<MyDetailMyVeggie> selectMyVeggieList = myDetailMyVeggieDto.processData(myVeggieList);
return BaseResponseDto.of(SuccessCode.SUCCESS,selectMyVeggieList);
Expand Down

0 comments on commit 1c64182

Please sign in to comment.