package com.jwipc.sys.controller.pc;

import com.jwipc.sys.dto.FactoryDTO;
import com.jwipc.sys.dto.PurchaseOrgDTO;
import com.jwipc.sys.entity.DigitalSealConfig;
import com.jwipc.sys.logic.DigitalSealConfigLogic;
import com.jwipc.sys.logic.PurchaseOrgLogic;
import com.jwipc.sys.service.IDigitalSealConfigService;
import lombok.RequiredArgsConstructor;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

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

/**
 * <p>
 * 电子印章配置表 前端控制器
 * </p>
 *
 * @author shenyang.ou
 * @since 2024-06-19
 */
@Controller
@RequestMapping(MODULE_ROOT +"/digitalSealConfig")
@RequiredArgsConstructor
public class DigitalSealConfigPageController {

    private final DigitalSealConfigLogic digitalSealConfigLogic;
    private final IDigitalSealConfigService digitalSealConfigService;
    @GetMapping("/index")
    public String index() {
        return MODULE_ROOT + "/digitalSealConfig/list";
    }
    @GetMapping("/detail")
    public String detail(Model model, Long id) {
        DigitalSealConfig digitalSealConfig;
        if (id != null) {
            digitalSealConfig = digitalSealConfigService.getById(id);
        } else {
            digitalSealConfig = new DigitalSealConfig();
        }
        model.addAttribute("digitalSealConfig", digitalSealConfig);
        return MODULE_ROOT + "/digitalSealConfig/detail";
    }

}
