package com.jwipc.sys.controller.pc;

import com.jwipc.sys.dto.DealtWithTargetTypeDTO;
import com.jwipc.sys.logic.DealtTypeLogic;
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 shenyang.ou
 * @date 2024/1/30 12:55
 * @desc 指标分类
 */
@Controller
@RequestMapping(MODULE_ROOT + "/dealt/type")
@RequiredArgsConstructor
public class DealtTypePageController {
    private final DealtTypeLogic dealtTypeLogic;
    @GetMapping("/index")
    public String index() {
        return MODULE_ROOT + "/dealt/type/list";
    }

    @GetMapping("/detail")
    public String detail(Model model, Long id) {
        DealtWithTargetTypeDTO dto = dealtTypeLogic.getById(id);
        model.addAttribute("dtt", dto);
        return MODULE_ROOT + "/dealt/type/detail";
    }
}
