Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 124/채소 리스트 #125

Merged
merged 3 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ dependencies {
// 유효성 검사
implementation 'org.springframework.boot:spring-boot-starter-validation'

implementation 'net.bytebuddy:byte-buddy:1.14.4'

}

tasks.named('bootBuildImage') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import java.util.List;


@AllArgsConstructor
@Getter
public class SelectMyVeggieListDto {

public static List<SelectMyVeggieListResponse> processData(List<MyVeggie> myVeggieList){
return myVeggieList.stream()
.map(myVeggie -> SelectMyVeggieListResponse.of(myVeggie.getId(),myVeggie.getNickname()))
.toList();
}
}
//@AllArgsConstructor
//@Getter
//public class SelectMyVeggieListDto {
//
// public static List<SelectMyVeggieListResponse> processData(List<MyVeggie> myVeggieList){
// return myVeggieList.stream()
// .map(myVeggie -> SelectMyVeggieListResponse.of(myVeggie.getId(),myVeggie.getNickname()))
// .toList();
// }
//}
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
Loading