package ink.wgink.service.role.controller.route;

import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.properties.AccessControlProperties;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: RoleRouteController
 * @Description: 角色路由
 * @Author: WangGeng
 * @Date: 2021/2/17 22:47
 * @Version: 1.0
 **/
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "职位路由接口")
@Controller
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/role")
public class RoleRouteController {

    @Autowired
    private AccessControlProperties accessControlProperties;

    @GetMapping("save")
    public ModelAndView save() {
        return new ModelAndView("role/save");
    }

    @GetMapping("update")
    public ModelAndView update() {
        return new ModelAndView("role/update");
    }

    @GetMapping("list-tree")
    public ModelAndView listTree() {
        return new ModelAndView("role/list-tree");
    }

    @GetMapping("list-tree-check")
    public ModelAndView listTreeCheck() {
        return new ModelAndView("role/list-tree-check");
    }

    @GetMapping("list")
    public ModelAndView list() {
        ModelAndView mv = new ModelAndView("role/list");
        mv.addObject("rolePermission", accessControlProperties.getRolePermission());
        return mv;
    }

    @GetMapping("data-authority")
    public ModelAndView dataAuthority() {
        return new ModelAndView("role/data-authority");
    }

}
