9oj0e / pathorder_server

3 stars 4 forks source link

StoreOwnerController 매핑 및 기능 구현 #41

Closed Hyeonjeong-JANG closed 2 months ago

Hyeonjeong-JANG commented 2 months ago

🐯 머스태치는 마지막에 한 번에 볼 수 있게 되어있음

✔️ 주문 상태별 리스트 화면 랜더링

StoreService

StoreOwnerController

@GetMapping("/stores/{storeId}/orders") // TODO: 매장 관리자 - 현재 접수된 주문
private String orders(@PathVariable int storeId, Model model) { // index
    /*
    // TODO: 권한 처리
    SessionStore sessionStore = (SessionStore) session.getAttribute("sessionStore");
    if (sessionStore != null) {
        return "orders";
    } else {
        return "login-form";
    }
    */

    HashMap<String, Object> currentOrderListDTO = storeService.getCurrentOrders(storeId);

    model.addAttribute("orderList", currentOrderListDTO);
    System.out.println(currentOrderListDTO);

    return "orders";
}

✔️ 주문 상태 변경

🐯 화면 랜더링

orders.mustache