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

import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.interfaces.role.IRoleBaseService;
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: DepartmentUserRouteController
 * @Description: 组织部门用户
 * @Author: wanggeng
 * @Date: 2021/2/13 12:03 下午
 * @Version: 1.0
 */
@Api(tags = ISystemConstant.ROUTE_TAGS_PREFIX + "组织部门接口")
@Controller
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/department/user")
public class DepartmentUserRouteController {

    @Autowired(required = false)
    private IRoleBaseService roleBaseService;

    @GetMapping("list")
    public ModelAndView list() {
        return new ModelAndView("department/user/list");
    }

    @GetMapping("save-exclude")
    public ModelAndView saveExclude() {
        return new ModelAndView("department/user/save-exclude");
    }

    @GetMapping("select-user")
    public ModelAndView selectUser() {
        ModelAndView modelAndView = new ModelAndView("department/user/select-user");
        modelAndView.addObject("hasRoleService", (roleBaseService != null));
        return modelAndView;
    }

    @GetMapping("select-user-v2")
    public ModelAndView selectUserV2() {
        ModelAndView modelAndView = new ModelAndView("department/user/select-user-v2");
        return modelAndView;
    }

}
