package com.jwipc.order.controller.pc;

import com.jwipc.order.dto.PurchaseOrderBomDTO;

import com.jwipc.order.logic.PurchaseOrderBomLogic;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import static com.jwipc.order.constant.ModuleConst.MODULE_ROOT;


@Controller
@RequestMapping(MODULE_ROOT + "/purchaseOrderBom")
@RequiredArgsConstructor
public class PurchaseOrderBomPageController {
    private final PurchaseOrderBomLogic purchaseOrderBomLogic;
    @GetMapping("/index")
    public String index() {
        return MODULE_ROOT + "/purchaseOrderBom/list";
    }
    @GetMapping("/detail")
    public String detail(Model model, Long id) {
        PurchaseOrderBomDTO purchaseOrderBomDTO;
        purchaseOrderBomDTO = purchaseOrderBomLogic.getById(id);
        model.addAttribute("purchaseOrderBomDTO", purchaseOrderBomDTO);
        return MODULE_ROOT + "/purchaseOrderBom/detail";
    }

}
