diff --git a/src/main/java/com/example/WebOrder/controller/ItemController.java b/src/main/java/com/example/WebOrder/controller/ItemController.java index 00dfc20830..00fd06bf64 100644 --- a/src/main/java/com/example/WebOrder/controller/ItemController.java +++ b/src/main/java/com/example/WebOrder/controller/ItemController.java @@ -4,6 +4,8 @@ import com.example.WebOrder.dto.ItemDto; import com.example.WebOrder.service.*; import lombok.extern.slf4j.Slf4j; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; @@ -43,6 +45,7 @@ public String getWholeMenuByOwner(Model model){ @GetMapping("/admin/item/detail/{itemId}") public String getMenuByOwner(@PathVariable("itemId") Long itemId, Model model) { model.addAttribute("itemInfo", itemService.getItemInfoById(itemId)); + model.addAttribute("reviewList", reviewService.getReviewsOfItem(itemId, PageRequest.of(0, 10, Sort.Direction.DESC, "id"))); return "item/itemDetail"; }