package com.jwipc.sys.controller.pc;

import com.jwipc.sys.dto.SupplierEmailDTO;
import com.jwipc.sys.logic.SupplierEmailLogic;
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 Al
 * @since 2024-04-24
 */
@Controller
@RequestMapping(MODULE_ROOT + "/supplierEmail01")
@RequiredArgsConstructor
public class SupplierEmailPageController01 {
    private final SupplierEmailLogic supplierEmailLogic;

    @RequestMapping("index")
    public String index() {
        return MODULE_ROOT + "/supplierEmail01/list";
    }

    @GetMapping("/detail")
    public String detail(Model model, Long id) {
        SupplierEmailDTO supplierEmail;
        supplierEmail = supplierEmailLogic.getById(id);
        model.addAttribute("supplierEmail", supplierEmail);
        return MODULE_ROOT + "/supplierEmail01/detail";
    }
}
