package com.jwipc.sys.controller.pc;

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 org.springframework.web.bind.annotation.RequestParam;

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

/**
 * @author shenyang.ou
 * @date 2024/2/3 22:50
 * @desc 物料
 */
@Controller
@RequestMapping(MODULE_ROOT + "/product")
@RequiredArgsConstructor
public class ProductPageController {
    @GetMapping("/index")
    public String index() {
        return MODULE_ROOT + "/product/list";
    }

    @GetMapping("/select/dialog")
    public String selectDialog(@RequestParam(defaultValue = "0", required = false) Integer single,
                               @RequestParam(defaultValue = "0", required = false) Integer priceFlag,
                               @RequestParam(defaultValue = "0", required = false) Integer purchaseGroupFlag,Model model) {
        model.addAttribute("single", single);
        model.addAttribute("priceFlag", priceFlag);
        model.addAttribute("purchaseGroupFlag", purchaseGroupFlag);
        return MODULE_ROOT + "/product/product_dialog";
    }
}
