forked from liweijie/education
登录 权限 放行 功能整理
This commit is contained in:
@@ -19,6 +19,6 @@ public class RoomRootApplication
|
||||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(RoomRootApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 风影随行启动成功 ლ(´ڡ`ლ)゙ \n");
|
||||
System.out.println("(♥◠‿◠)ノ゙ 启动成功 ლ(´ڡ`ლ)゙ \n");
|
||||
}
|
||||
}
|
||||
|
||||
+9
-70
@@ -1,94 +1,33 @@
|
||||
package com.roomroot.web.controller.common;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import jakarta.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.FastByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import com.roomroot.common.config.RoomRootConfig;
|
||||
import com.roomroot.common.constant.CacheConstants;
|
||||
import com.roomroot.common.constant.Constants;
|
||||
import com.roomroot.common.core.domain.AjaxResult;
|
||||
import com.roomroot.common.core.redis.RedisCache;
|
||||
import com.roomroot.common.utils.sign.Base64;
|
||||
import com.roomroot.common.utils.uuid.IdUtils;
|
||||
import com.roomroot.system.service.ISysConfigService;
|
||||
|
||||
/**
|
||||
* 验证码操作处理
|
||||
*
|
||||
* <p>
|
||||
* 已去除验证码登录,本接口仅返回 captchaEnabled=false,
|
||||
* 前端据此隐藏登录页的验证码输入。
|
||||
* </p>
|
||||
*
|
||||
* @author roomroot
|
||||
*/
|
||||
@RestController
|
||||
public class CaptchaController
|
||||
{
|
||||
@Resource(name = "captchaProducer")
|
||||
private Producer captchaProducer;
|
||||
|
||||
@Resource(name = "captchaProducerMath")
|
||||
private Producer captchaProducerMath;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
/**
|
||||
* 生成验证码
|
||||
* <p>已去除验证码登录,接口始终返回 captchaEnabled=false,不再生成验证码。</p>
|
||||
*/
|
||||
@GetMapping("/captchaImage")
|
||||
public AjaxResult getCode(HttpServletResponse response) throws IOException
|
||||
{
|
||||
// 已去除验证码登录:始终返回 captchaEnabled=false,前端据此隐藏验证码输入。
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
ajax.put("captchaEnabled", captchaEnabled);
|
||||
if (!captchaEnabled)
|
||||
{
|
||||
return ajax;
|
||||
}
|
||||
|
||||
// 保存验证码信息
|
||||
String uuid = IdUtils.simpleUUID();
|
||||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
|
||||
|
||||
String capStr = null, code = null;
|
||||
BufferedImage image = null;
|
||||
|
||||
// 生成验证码
|
||||
String captchaType = RoomRootConfig.getCaptchaType();
|
||||
if ("math".equals(captchaType))
|
||||
{
|
||||
String capText = captchaProducerMath.createText();
|
||||
capStr = capText.substring(0, capText.lastIndexOf("@"));
|
||||
code = capText.substring(capText.lastIndexOf("@") + 1);
|
||||
image = captchaProducerMath.createImage(capStr);
|
||||
}
|
||||
else if ("char".equals(captchaType))
|
||||
{
|
||||
capStr = code = captchaProducer.createText();
|
||||
image = captchaProducer.createImage(capStr);
|
||||
}
|
||||
|
||||
redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
|
||||
// 转换流信息写出
|
||||
FastByteArrayOutputStream os = new FastByteArrayOutputStream();
|
||||
try
|
||||
{
|
||||
ImageIO.write(image, "jpg", os);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
ajax.put("uuid", uuid);
|
||||
ajax.put("img", Base64.encode(os.toByteArray()));
|
||||
ajax.put("captchaEnabled", false);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
|
||||
-98
@@ -101,104 +101,6 @@ public class FacultyController {
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
// ======================== 教员管理 ========================
|
||||
|
||||
/**
|
||||
* 新增教员(同时写入教员表和教员属性表)
|
||||
* <p>教员属性中的非空字段由前端一并传入。</p>
|
||||
*/
|
||||
@PostMapping("/teacher/add")
|
||||
public Result<Void> addTeacher(@RequestBody AddTeacherDTO dto) {
|
||||
facultyService.addJYB(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 离职(逻辑删除)教员
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@PostMapping("/teacher/disable")
|
||||
public Result<Void> disableTeacher(@RequestParam("jybh") String jybh) {
|
||||
facultyService.disableJYB(jybh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新教员基本信息
|
||||
* <p>支持教学单位调整(修改教研室代号)、职称调整(修改职称、专业技术职务等级)。</p>
|
||||
*/
|
||||
@PostMapping("/teacher/update")
|
||||
public Result<Void> updateTeacher(@RequestBody JYB entity) {
|
||||
facultyService.updateJYB(entity);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编号查询教员详情
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@GetMapping("/teacher/get")
|
||||
public Result<JYB> getTeacher(@RequestParam("jybh") String jybh) {
|
||||
JYB entity = facultyService.getJYBById(jybh);
|
||||
return Result.success(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页条件查询教员列表
|
||||
* <p>
|
||||
* 支持模糊查询参数:
|
||||
* <ul>
|
||||
* <li>jyxm — 教员姓名(模糊匹配)</li>
|
||||
* <li>jysdh — 教研室代号(精确匹配)</li>
|
||||
* <li>zc — 职称(模糊匹配)</li>
|
||||
* <li>jylb — 教员类别(精确匹配)</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
@GetMapping("/teacher/list")
|
||||
public Result<PageResult<TeacherListVO>> listTeacher(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "20") Integer pageSize,
|
||||
@RequestParam(required = false) String jyxm,
|
||||
@RequestParam(required = false) String jysdh,
|
||||
@RequestParam(required = false) String zc,
|
||||
@RequestParam(required = false) String jylb) {
|
||||
PageQuery query = new PageQuery();
|
||||
query.setPageNum(pageNum);
|
||||
query.setPageSize(pageSize);
|
||||
JYB cond = new JYB();
|
||||
cond.setJyxm(jyxm);
|
||||
cond.setJysdh(jysdh);
|
||||
cond.setZc(zc);
|
||||
cond.setJylb(jylb);
|
||||
PageResult<TeacherListVO> pageResult = facultyService.pageJYBDetail(query, cond);
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
// ======================== 教员属性管理 ========================
|
||||
|
||||
/**
|
||||
* 查询教员属性
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@GetMapping("/teacher/attribute/get")
|
||||
public Result<JYSX> getTeacherAttribute(@RequestParam("jybh") String jybh) {
|
||||
JYSX entity = facultyService.getJYSXByJYBH(jybh);
|
||||
return Result.success(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新教员属性
|
||||
* <p>支持岗位调整(修改职务、职务时间)和技术等级调整(修改技术等级、技术等级时间)。</p>
|
||||
*/
|
||||
@PostMapping("/teacher/attribute/update")
|
||||
public Result<Void> updateTeacherAttribute(@RequestBody JYSX entity) {
|
||||
facultyService.updateJYSX(entity);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
// ======================== 年度综合评定查询 ========================
|
||||
|
||||
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.dto.faculty.AddTeacherDTO;
|
||||
import com.roomroot.jwgl.entity.JYB;
|
||||
import com.roomroot.jwgl.entity.JYSB;
|
||||
import com.roomroot.jwgl.entity.JYSX;
|
||||
import com.roomroot.jwgl.service.FacultyService;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.vo.faculty.TeacherListVO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 教研室管理(教研室管理
|
||||
* 教员管理
|
||||
* 教学任务计划管理
|
||||
* 选修课管理
|
||||
* 班次学期信息管理
|
||||
* 课程科目)
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/jys")
|
||||
public class JYSController {
|
||||
|
||||
@Resource
|
||||
private FacultyService facultyService;
|
||||
// ======================== 教研室管理 ========================
|
||||
|
||||
/**
|
||||
* 新增教研室
|
||||
*/
|
||||
@PostMapping("/office/add")
|
||||
public Result<Void> addOffice(@RequestBody JYSB entity) {
|
||||
facultyService.addJYSB(entity);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用(逻辑删除)教研室
|
||||
*不填,则系统自动创建 必填 必填
|
||||
* 教研室标识号 序号 教研室名称 简称 部系
|
||||
* 001 001 军事基础教研室 军基 基础部
|
||||
* @param jysdh 教研室代号
|
||||
*/
|
||||
@PostMapping("/office/disable")
|
||||
public Result<Void> disableOffice(@RequestParam("jysdh") String jysdh) {
|
||||
facultyService.disableJYSB(jysdh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新教研室
|
||||
*/
|
||||
@PostMapping("/office/update")
|
||||
public Result<Void> updateOffice(@RequestBody JYSB entity) {
|
||||
facultyService.updateJYSB(entity);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据代号查询教研室详情
|
||||
*
|
||||
* @param jysdh 教研室代号
|
||||
*/
|
||||
@GetMapping("/office/get")
|
||||
public Result<JYSB> getOffice(@RequestParam("jysdh") String jysdh) {
|
||||
JYSB entity = facultyService.getJYSBById(jysdh);
|
||||
return Result.success(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页条件查询教研室列表
|
||||
* <p>
|
||||
* 支持模糊查询参数:
|
||||
* <ul>
|
||||
* <li>jysmc — 教研室名称(模糊匹配)</li>
|
||||
* <li>bx — 部系(模糊匹配)</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
@GetMapping("/office/list")
|
||||
public Result<PageResult<JYSB>> listOffice(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "20") Integer pageSize,
|
||||
@RequestParam(required = false) String jysdh,
|
||||
@RequestParam(required = false) String jysmc,
|
||||
@RequestParam(required = false) String bx) {
|
||||
PageQuery query = new PageQuery();
|
||||
query.setPageNum(pageNum);
|
||||
query.setPageSize(pageSize);
|
||||
JYSB cond = new JYSB();
|
||||
cond.setJysdh(jysdh);
|
||||
cond.setJysmc(jysmc);
|
||||
cond.setBx(bx);
|
||||
PageResult<JYSB> pageResult = facultyService.pageJYSB(query, cond);
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教研室数据文件导入
|
||||
* <p>
|
||||
* 文件格式为 .xls,抬头与字段顺序:
|
||||
* 教研室标识号, 序号, 教研室名称, 简称, 部系。
|
||||
* 教研室标识号不填则由系统自动创建;教研室名称和简称为必填字段,
|
||||
* 未填写时返回"XX未填写";序号、停用、虚实类型等非空字段由后台自动填充。
|
||||
* </p>
|
||||
*/
|
||||
@PostMapping("/office/import")
|
||||
public Result<Integer> importOffice(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
int count = facultyService.importJYSBFromExcel(file);
|
||||
return Result.success("导入成功,共" + count + "条记录", count);
|
||||
}
|
||||
// ======================== 教员管理 ========================
|
||||
|
||||
/**
|
||||
* 新增教员(同时写入教员表和教员属性表)
|
||||
* <p>教员属性中的非空字段由前端一并传入。</p>
|
||||
*/
|
||||
@PostMapping("/teacher/add")
|
||||
public Result<Void> addTeacher(@RequestBody AddTeacherDTO dto) {
|
||||
facultyService.addJYB(dto);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 离职(逻辑删除)教员
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@PostMapping("/teacher/disable")
|
||||
public Result<Void> disableTeacher(@RequestParam("jybh") String jybh) {
|
||||
facultyService.disableJYB(jybh);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新教员基本信息
|
||||
* <p>支持教学单位调整(修改教研室代号)、职称调整(修改职称、专业技术职务等级)。</p>
|
||||
*/
|
||||
@PostMapping("/teacher/update")
|
||||
public Result<Void> updateTeacher(@RequestBody JYB entity) {
|
||||
facultyService.updateJYB(entity);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编号查询教员详情
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@GetMapping("/teacher/get")
|
||||
public Result<JYB> getTeacher(@RequestParam("jybh") String jybh) {
|
||||
JYB entity = facultyService.getJYBById(jybh);
|
||||
return Result.success(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页条件查询教员列表
|
||||
* <p>
|
||||
* 支持模糊查询参数:
|
||||
* <ul>
|
||||
* <li>jyxm — 教员姓名(模糊匹配)</li>
|
||||
* <li>jysdh — 教研室代号(精确匹配)</li>
|
||||
* <li>zc — 职称(模糊匹配)</li>
|
||||
* <li>jylb — 教员类别(精确匹配)</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*/
|
||||
@GetMapping("/teacher/list")
|
||||
public Result<PageResult<TeacherListVO>> listTeacher(
|
||||
@RequestParam(defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(defaultValue = "20") Integer pageSize,
|
||||
@RequestParam(required = false) String jyxm,
|
||||
@RequestParam(required = false) String jysdh,
|
||||
@RequestParam(required = false) String zc,
|
||||
@RequestParam(required = false) String jylb) {
|
||||
PageQuery query = new PageQuery();
|
||||
query.setPageNum(pageNum);
|
||||
query.setPageSize(pageSize);
|
||||
JYB cond = new JYB();
|
||||
cond.setJyxm(jyxm);
|
||||
cond.setJysdh(jysdh);
|
||||
cond.setZc(zc);
|
||||
cond.setJylb(jylb);
|
||||
PageResult<TeacherListVO> pageResult = facultyService.pageJYBDetail(query, cond);
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
// ======================== 教员属性管理 ========================
|
||||
|
||||
/**
|
||||
* 查询教员属性
|
||||
*
|
||||
* @param jybh 教员编号
|
||||
*/
|
||||
@GetMapping("/teacher/attribute/get")
|
||||
public Result<JYSX> getTeacherAttribute(@RequestParam("jybh") String jybh) {
|
||||
JYSX entity = facultyService.getJYSXByJYBH(jybh);
|
||||
return Result.success(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新教员属性
|
||||
* <p>支持岗位调整(修改职务、职务时间)和技术等级调整(修改技术等级、技术等级时间)。</p>
|
||||
*/
|
||||
@PostMapping("/teacher/attribute/update")
|
||||
public Result<Void> updateTeacherAttribute(@RequestBody JYSX entity) {
|
||||
facultyService.updateJYSX(entity);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
-132
@@ -1,132 +0,0 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.dto.accountmanagement.AccountLoginDTO;
|
||||
import com.roomroot.jwgl.dto.login.LoginDTO;
|
||||
import com.roomroot.jwgl.entity.SSJG;
|
||||
import com.roomroot.jwgl.mapper.SSJGMapper;
|
||||
import com.roomroot.jwgl.service.AccountManagementService;
|
||||
import com.roomroot.jwgl.unit.Result;
|
||||
import com.roomroot.jwgl.utils.AccountManagementConstants;
|
||||
import com.roomroot.jwgl.vo.accountmanagement.AccountLoginVO;
|
||||
import com.roomroot.jwgl.vo.accountmanagement.AccountRoleVO;
|
||||
import com.roomroot.jwgl.vo.login.LoginResultVO;
|
||||
import com.roomroot.common.annotation.Anonymous;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 登录认证控制器
|
||||
* <p>
|
||||
* 支持行政、教员、学员、管理员四种用户类型登录。
|
||||
* 管理员登录不需要单位(orgId),其余类型需选择单位。
|
||||
* 使用数据表:登录信息表(用户凭证)、教学管理机构/实施_机关(单位信息)。
|
||||
* </p>
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/auth")
|
||||
@Anonymous
|
||||
public class LoginController {
|
||||
|
||||
@Resource
|
||||
private AccountManagementService accountManagementService;
|
||||
|
||||
@Resource
|
||||
private SSJGMapper ssjgMapper;
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
* <p>
|
||||
* 根据登录名和密码验证身份,返回用户信息、角色和单位信息。
|
||||
* </p>
|
||||
*/
|
||||
@PostMapping("/login")
|
||||
public Result<LoginResultVO> login(@RequestBody LoginDTO loginDTO) {
|
||||
// 1. 参数校验
|
||||
if (loginDTO.getLoginName() == null || loginDTO.getLoginName().isEmpty()) {
|
||||
return Result.error(400, "登录名不能为空");
|
||||
}
|
||||
if (loginDTO.getPassword() == null || loginDTO.getPassword().isEmpty()) {
|
||||
return Result.error(400, "密码不能为空");
|
||||
}
|
||||
if (loginDTO.getUserType() == null || loginDTO.getUserType().isEmpty()) {
|
||||
return Result.error(400, "用户类型不能为空");
|
||||
}
|
||||
|
||||
// 管理员登录不需要单位
|
||||
if (!"MANAGER".equals(loginDTO.getUserType()) && (loginDTO.getOrgId() == null || loginDTO.getOrgId().isEmpty())) {
|
||||
return Result.error(400, "单位不能为空");
|
||||
}
|
||||
|
||||
// 2. 参数转换(LoginDTO → AccountLoginDTO)
|
||||
AccountLoginDTO accountLoginDTO = new AccountLoginDTO();
|
||||
accountLoginDTO.setLoginName(loginDTO.getLoginName());
|
||||
accountLoginDTO.setPassword(loginDTO.getPassword());
|
||||
|
||||
// 3. 委托 AccountManagementService 处理登录
|
||||
AccountLoginVO loginVO = accountManagementService.login(accountLoginDTO);
|
||||
|
||||
// 4. 匹配用户类型
|
||||
String roleTypeCode = mapUserTypeToRoleCode(loginDTO.getUserType());
|
||||
List<AccountRoleVO> roles = loginVO.getRoles();
|
||||
boolean hasRole = roles.stream().anyMatch(r -> roleTypeCode.equals(r.getRoleType()));
|
||||
if (!hasRole) {
|
||||
return Result.error(403, "当前用户没有" + loginDTO.getUserType() + "权限");
|
||||
}
|
||||
|
||||
// 5. 查询单位信息
|
||||
String orgName = null;
|
||||
if (!"MANAGER".equals(loginDTO.getUserType())) {
|
||||
for (AccountRoleVO role : roles) {
|
||||
if (roleTypeCode.equals(role.getRoleType())) {
|
||||
SSJG org = ssjgMapper.selectById(role.getTargetId());
|
||||
if (org != null) {
|
||||
orgName = org.getJGMC();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 6. 返回值转换(AccountLoginVO → LoginResultVO)
|
||||
LoginResultVO result = new LoginResultVO();
|
||||
result.setUserId(loginVO.getAccountId());
|
||||
result.setUserName(loginVO.getUserName());
|
||||
result.setLoginName(loginVO.getLoginName());
|
||||
result.setUserType(loginDTO.getUserType());
|
||||
result.setOrgId(loginDTO.getOrgId());
|
||||
result.setOrgName(orgName);
|
||||
|
||||
List<LoginResultVO.RoleInfo> roleInfos = roles.stream().map(r -> {
|
||||
LoginResultVO.RoleInfo ri = new LoginResultVO.RoleInfo();
|
||||
ri.setRoleType(r.getRoleType());
|
||||
ri.setRoleName(r.getRoleName());
|
||||
ri.setTargetId(r.getTargetId());
|
||||
ri.setTargetName(r.getTargetName());
|
||||
return ri;
|
||||
}).collect(Collectors.toList());
|
||||
result.setRoles(roleInfos);
|
||||
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将前端用户类型映射为角色编码
|
||||
*/
|
||||
private String mapUserTypeToRoleCode(String userType) {
|
||||
switch (userType) {
|
||||
case "ADMIN":
|
||||
return AccountManagementConstants.ROLE_DEPARTMENT_PERSONNEL;
|
||||
case "TEACHER":
|
||||
return AccountManagementConstants.ROLE_TEACHER;
|
||||
case "STUDENT":
|
||||
return AccountManagementConstants.ROLE_STUDENT;
|
||||
case "MANAGER":
|
||||
return AccountManagementConstants.ROLE_DEPARTMENT_PERSONNEL;
|
||||
default:
|
||||
return userType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ mybatis-plus:
|
||||
# 搜索指定包别名
|
||||
typeAliasesPackage: com.roomroot.**.domain
|
||||
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
||||
mapperLocations: classpath*:mapper/**/*Mapper.xml,classpath*:com/roomroot/**/mapper/*.xml
|
||||
# 加载全局的配置文件
|
||||
configLocation: classpath:mybatis/mybatis-config.xml
|
||||
|
||||
|
||||
Reference in New Issue
Block a user