package com.jwipc.sys.controller.pc;

import com.jwipc.sys.dto.TaxDTO;
import com.jwipc.sys.logic.TaxLogic;
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;

/**
 * @author Al
 * @create 2024-02-22 11:04
 */
@Controller
@RequestMapping(MODULE_ROOT + "/tax")
@RequiredArgsConstructor
public class TaxPageController {
    private final TaxLogic taxLogic;
    @GetMapping("/index")
    public String index() {
        return MODULE_ROOT + "/tax/list";
    }
    @GetMapping("/detail")
    public String detail(Model model, Long id) {
        TaxDTO taxInfo;
        taxInfo = taxLogic.getById(id);
        model.addAttribute("taxInfo", taxInfo);
        return MODULE_ROOT + "/tax/detail";
    }
}
