package com.jwipc.sys.controller.pc;

import com.jwipc.sys.dto.SupplierOrderFileSettingDTO;
import com.jwipc.sys.logic.SupplierOrderFileSettingLogic;
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.sys.constant.ModuleConst.MODULE_ROOT;

/**
 * <p>
 * 出货检验报告必填设置-页面
 * </p>
 *
 * @author Chen Tianshi
 * @since 2025-08-05
 */
@Controller
@RequestMapping(MODULE_ROOT + "/supplierOrderFileSetting")
@RequiredArgsConstructor
public class SupplierOrderFileSettingPageController {
    private final SupplierOrderFileSettingLogic supplierOrderFileSettingLogic;

    /**
     * 出货检验报告必填设置查询界面
     * @return 页面
     */
    @RequestMapping("index")
    public String index() {
        return MODULE_ROOT + "/supplierOrderFileSetting/list";
    }

    /**
     * 出货检验报告必填设置新增、编辑界面
     * @param model 传给画面的参数
     * @param id 出货检验报告必填设置数据主键
     * @return 页面
     */
    @GetMapping("/detail")
    public String detail(Model model, Long id) {
        SupplierOrderFileSettingDTO supplierOrderFileSetting= supplierOrderFileSettingLogic.getById(id);
        model.addAttribute("supplierOrderFileSetting", supplierOrderFileSetting);
        return MODULE_ROOT + "/supplierOrderFileSetting/detail";
    }
}
