-
카테고리
-
세부 분야
백엔드
-
해결 여부
미해결
totalPrice
21.08.19 02:38 작성 조회수 253
2
안녕하세요 15:48 보시면
totalPrice 값이 나오는데 이 메소드는 언제 호출이 된건가요? 따로 호출해 준적이없는거 같습니다
==========
@GetMapping("/api/v1/simple-orders")
public List<Order> ordersV1(){
List<Order> all = orderRepository.findAllByString(new OrderSearch());
return all;
}
===========
public int getTotalPrice(){
int totalPrice = 0 ;
for(OrderItem orderItem : orderItems){
totalPrice+=orderItem.getTotalPrice();
}
return totalPrice;
}
답변을 작성해보세요.
답변 2