diff --git a/server/src/main/java/server/haengdong/application/ActionService.java b/server/src/main/java/server/haengdong/application/ActionService.java index 0eda074ca..bda638756 100644 --- a/server/src/main/java/server/haengdong/application/ActionService.java +++ b/server/src/main/java/server/haengdong/application/ActionService.java @@ -1,6 +1,5 @@ package server.haengdong.application; -import java.util.ArrayList; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -31,10 +30,8 @@ public List getMemberBillReports(String token) { MemberBillReport memberBillReport = MemberBillReport.createByActions(billActions, memberActions); - List memberBillReportResponses = new ArrayList<>(); - memberBillReport.getReports().forEach( - (member, price) -> memberBillReportResponses.add(new MemberBillReportAppResponse(member, price)) - ); - return memberBillReportResponses; + return memberBillReport.getReports().entrySet().stream() + .map(entry -> new MemberBillReportAppResponse(entry.getKey(), entry.getValue())) + .toList(); } }