update 格式化代码结构 统一编码格式
This commit is contained in:
parent
3fef2b68dc
commit
868942e202
@ -7,8 +7,8 @@ import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.CaptchaType;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.reflect.ReflectUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.framework.config.properties.CaptchaProperties;
|
||||
@ -16,7 +16,6 @@ import com.ruoyi.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -30,7 +29,7 @@ import java.util.concurrent.TimeUnit;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "验证码操作处理", tags = {"验证码管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class CaptchaController {
|
||||
|
||||
|
@ -6,7 +6,6 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.connection.RedisServerCommands;
|
||||
import org.springframework.data.redis.core.RedisCallback;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
@ -22,7 +21,7 @@ import java.util.*;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "缓存监控", tags = {"缓存监控管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/cache")
|
||||
public class CacheController {
|
||||
|
@ -13,7 +13,6 @@ import com.ruoyi.system.service.ISysLogininforService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -27,7 +26,7 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "系统访问记录", tags = {"系统访问记录管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/logininfor")
|
||||
public class SysLogininforController extends BaseController {
|
||||
|
@ -13,7 +13,6 @@ import com.ruoyi.system.service.ISysOperLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -27,7 +26,7 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "操作日志记录", tags = {"操作日志记录管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/operlog")
|
||||
public class SysOperlogController extends BaseController {
|
||||
|
@ -2,7 +2,6 @@ package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import cn.dev33.satoken.stp.StpLogic;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
@ -12,13 +11,12 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.dto.UserOnlineDTO;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -32,7 +30,7 @@ import java.util.stream.Collectors;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "在线用户监控", tags = {"在线用户监控管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/online")
|
||||
public class SysUserOnlineController extends BaseController {
|
||||
@ -59,7 +57,7 @@ public class SysUserOnlineController extends BaseController {
|
||||
).collect(Collectors.toList());
|
||||
} else if (StringUtils.isNotEmpty(ipaddr)) {
|
||||
userOnlineDTOList = userOnlineDTOList.stream().filter(userOnline ->
|
||||
StringUtils.equals(ipaddr, userOnline.getIpaddr()))
|
||||
StringUtils.equals(ipaddr, userOnline.getIpaddr()))
|
||||
.collect(Collectors.toList());
|
||||
} else if (StringUtils.isNotEmpty(userName)) {
|
||||
userOnlineDTOList = userOnlineDTOList.stream().filter(userOnline ->
|
||||
|
@ -15,7 +15,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -29,7 +28,7 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "参数配置控制器", tags = {"参数配置管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/config")
|
||||
public class SysConfigController extends BaseController {
|
||||
|
@ -15,7 +15,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -30,7 +29,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "部门控制器", tags = {"部门管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/dept")
|
||||
public class SysDeptController extends BaseController {
|
||||
@ -57,7 +56,7 @@ public class SysDeptController extends BaseController {
|
||||
public AjaxResult<List<SysDept>> excludeChild(@ApiParam("部门ID") @PathVariable(value = "deptId", required = false) Long deptId) {
|
||||
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
||||
depts.removeIf(d -> d.getDeptId().equals(deptId)
|
||||
|| ArrayUtil.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||
|| ArrayUtil.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
||||
return AjaxResult.success(depts);
|
||||
}
|
||||
|
||||
@ -122,7 +121,7 @@ public class SysDeptController extends BaseController {
|
||||
} else if (dept.getParentId().equals(dept.getDeptId())) {
|
||||
return AjaxResult.error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
|
||||
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) {
|
||||
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0) {
|
||||
return AjaxResult.error("该部门包含未停用的子部门!");
|
||||
}
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
|
@ -16,7 +16,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -31,7 +30,7 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "数据字典信息控制器", tags = {"数据字典信息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/data")
|
||||
public class SysDictDataController extends BaseController {
|
||||
|
@ -15,7 +15,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -29,7 +28,7 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "数据字典信息控制器", tags = {"数据字典信息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/dict/type")
|
||||
public class SysDictTypeController extends BaseController {
|
||||
|
@ -5,7 +5,6 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -15,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "首页控制器", tags = {"首页管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class SysIndexController {
|
||||
|
||||
|
@ -17,7 +17,6 @@ import com.ruoyi.system.service.SysPermissionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -36,7 +35,7 @@ import java.util.Set;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "登录验证控制器", tags = {"登录验证管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class SysLoginController {
|
||||
|
||||
@ -56,14 +55,14 @@ public class SysLoginController {
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return AjaxResult.success(ajax);
|
||||
}
|
||||
|
||||
@ApiOperation("登出方法")
|
||||
@PostMapping("/logout")
|
||||
public AjaxResult<Void> logout(){
|
||||
public AjaxResult<Void> logout() {
|
||||
try {
|
||||
StpUtil.logout();
|
||||
} catch (NotLoginException e) {
|
||||
|
@ -14,7 +14,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -29,7 +28,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "菜单信息控制器", tags = {"菜单信息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/menu")
|
||||
public class SysMenuController extends BaseController {
|
||||
|
@ -9,13 +9,12 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 公告 信息操作处理
|
||||
@ -24,7 +23,7 @@ import lombok.RequiredArgsConstructor;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "公告信息控制器", tags = {"公告信息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/notice")
|
||||
public class SysNoticeController extends BaseController {
|
||||
|
@ -18,7 +18,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -35,7 +34,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "对象存储配置控制器", tags = {"对象存储配置管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/oss/config")
|
||||
public class SysOssConfigController extends BaseController {
|
||||
|
@ -26,7 +26,6 @@ import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysOssService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -47,7 +46,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "OSS对象存储控制器", tags = {"OSS对象存储管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/oss")
|
||||
public class SysOssController extends BaseController {
|
||||
|
@ -15,7 +15,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -29,7 +28,7 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "岗位信息控制器", tags = {"岗位信息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/post")
|
||||
public class SysPostController extends BaseController {
|
||||
|
@ -19,7 +19,6 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -35,7 +34,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "个人信息控制器", tags = {"个人信息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/user/profile")
|
||||
public class SysProfileController extends BaseController {
|
||||
@ -65,11 +64,11 @@ public class SysProfileController extends BaseController {
|
||||
@PutMapping
|
||||
public AjaxResult<Void> updateProfile(@RequestBody SysUser user) {
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(user.getEmail())
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUserId(getUserId());
|
||||
@ -117,7 +116,7 @@ public class SysProfileController extends BaseController {
|
||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/avatar")
|
||||
public AjaxResult<Map<String, Object>> avatar(@RequestPart("avatarfile") MultipartFile file) {
|
||||
Map<String,Object> ajax = new HashMap<>();
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
if (!file.isEmpty()) {
|
||||
SysOss oss = iSysOssService.upload(file);
|
||||
String avatar = oss.getUrl();
|
||||
|
@ -9,7 +9,6 @@ import com.ruoyi.system.service.SysRegisterService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -22,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "注册验证控制器", tags = {"注册验证管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
public class SysRegisterController extends BaseController {
|
||||
|
||||
|
@ -20,7 +20,6 @@ import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.system.service.SysPermissionService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -34,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "角色信息控制器", tags = {"角色信息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/role")
|
||||
public class SysRoleController extends BaseController {
|
||||
|
@ -26,7 +26,6 @@ import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -45,7 +44,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "用户信息控制器", tags = {"用户信息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/user")
|
||||
public class SysUserController extends BaseController {
|
||||
@ -84,7 +83,7 @@ public class SysUserController extends BaseController {
|
||||
|
||||
@ApiOperation("导入用户列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "导入文件", dataType = "java.io.File", required = true),
|
||||
@ApiImplicitParam(name = "file", value = "导入文件", dataType = "java.io.File", required = true),
|
||||
})
|
||||
@Log(title = "用户管理", businessType = BusinessType.IMPORT)
|
||||
@SaCheckPermission("system:user:import")
|
||||
@ -105,7 +104,7 @@ public class SysUserController extends BaseController {
|
||||
*/
|
||||
@ApiOperation("根据用户编号获取详细信息")
|
||||
@SaCheckPermission("system:user:query")
|
||||
@GetMapping(value = {"/", "/{userId}" })
|
||||
@GetMapping(value = {"/", "/{userId}"})
|
||||
public AjaxResult<Map<String, Object>> getInfo(@ApiParam("用户ID") @PathVariable(value = "userId", required = false) Long userId) {
|
||||
userService.checkUserDataScope(userId);
|
||||
Map<String, Object> ajax = new HashMap<>();
|
||||
@ -132,10 +131,10 @@ public class SysUserController extends BaseController {
|
||||
if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) {
|
||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail())
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
@ -152,10 +151,10 @@ public class SysUserController extends BaseController {
|
||||
public AjaxResult<Void> edit(@Validated @RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
|
||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||
} else if (StringUtils.isNotEmpty(user.getEmail())
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
|
||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
return toAjax(userService.updateUser(user));
|
||||
|
@ -12,6 +12,7 @@ import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 数据脱敏注解
|
||||
*
|
||||
* @author zhujie
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
@ -15,7 +15,7 @@ public class UnsignedMathGenerator implements CodeGenerator {
|
||||
|
||||
private static final long serialVersionUID = -5514819971774091076L;
|
||||
|
||||
private static final String operators = "+-*";
|
||||
private static final String OPERATORS = "+-*";
|
||||
|
||||
/**
|
||||
* 参与计算数字最大长度
|
||||
@ -48,7 +48,7 @@ public class UnsignedMathGenerator implements CodeGenerator {
|
||||
number1 = StringUtils.rightPad(number1, this.numberLength, CharUtil.SPACE);
|
||||
number2 = StringUtils.rightPad(number2, this.numberLength, CharUtil.SPACE);
|
||||
|
||||
return number1 + RandomUtil.randomChar(operators) + number2 + '=';
|
||||
return number1 + RandomUtil.randomChar(OPERATORS) + number2 + '=';
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,9 +6,9 @@ import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 数据权限类型
|
||||
*
|
||||
* <p>
|
||||
* 语法支持 spel 模板表达式
|
||||
*
|
||||
* <p>
|
||||
* 内置数据 user 当前用户 内容参考 SysUser
|
||||
* 如需扩展数据 可使用 {@link com.ruoyi.common.helper.DataPermissionHelper} 操作
|
||||
* 内置服务 sdss 系统数据权限服务 内容参考 SysDataScopeService
|
||||
@ -44,7 +44,7 @@ public enum DataScopeType {
|
||||
/**
|
||||
* 仅本人数据权限
|
||||
*/
|
||||
SELF("5", " #{#userName} = #{#user.userId} " , " 1 = 0 ");
|
||||
SELF("5", " #{#userName} = #{#user.userId} ", " 1 = 0 ");
|
||||
|
||||
private final String code;
|
||||
|
||||
|
@ -2,7 +2,9 @@ package com.ruoyi.common.exception.base;
|
||||
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 基础异常
|
||||
|
@ -20,10 +20,10 @@ public class RepeatableFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
ServletRequest requestWrapper = null;
|
||||
if (request instanceof HttpServletRequest
|
||||
&& StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) {
|
||||
&& StringUtils.startsWithIgnoreCase(request.getContentType(), MediaType.APPLICATION_JSON_VALUE)) {
|
||||
requestWrapper = new RepeatedlyRequestWrapper((HttpServletRequest) request, response);
|
||||
}
|
||||
if (null == requestWrapper) {
|
||||
|
@ -33,7 +33,7 @@ public class XssFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
throws IOException, ServletException {
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
HttpServletResponse resp = (HttpServletResponse) response;
|
||||
if (handleExcludeURL(req, resp)) {
|
||||
|
@ -24,7 +24,6 @@ public class DataPermissionHelper {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void setVariable(String key, Object value) {
|
||||
Map<String, Object> context = getContext();
|
||||
context.put(key, value);
|
||||
|
@ -16,6 +16,7 @@ import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 数据脱敏json序列化工具
|
||||
*
|
||||
* @author Yjoioooo
|
||||
*/
|
||||
public class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer {
|
||||
@ -25,7 +26,7 @@ public class SensitiveJsonSerializer extends JsonSerializer<String> implements C
|
||||
@Override
|
||||
public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
|
||||
SensitiveService sensitiveService = SpringUtils.getBean(SensitiveService.class);
|
||||
if (sensitiveService.isSensitive()){
|
||||
if (sensitiveService.isSensitive()) {
|
||||
gen.writeString(value);
|
||||
} else {
|
||||
gen.writeString(strategy.desensitizer().apply(value));
|
||||
@ -36,7 +37,7 @@ public class SensitiveJsonSerializer extends JsonSerializer<String> implements C
|
||||
@Override
|
||||
public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property) throws JsonMappingException {
|
||||
Sensitive annotation = property.getAnnotation(Sensitive.class);
|
||||
if (Objects.nonNull(annotation)&&Objects.equals(String.class, property.getType().getRawClass())) {
|
||||
if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass())) {
|
||||
this.strategy = annotation.strategy();
|
||||
return this;
|
||||
}
|
||||
|
@ -28,9 +28,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
private static String[] parsePatterns = {
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
|
||||
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
|
||||
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
|
||||
|
||||
/**
|
||||
* 获取当前Date型日期
|
||||
|
@ -6,6 +6,8 @@ import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.enums.DeviceType;
|
||||
import com.ruoyi.common.enums.UserType;
|
||||
import com.ruoyi.common.exception.UtilException;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 登录鉴权工具
|
||||
@ -13,13 +15,15 @@ import com.ruoyi.common.exception.UtilException;
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class LoginUtils {
|
||||
|
||||
private final static String LOGIN_USER_KEY = "loginUser";
|
||||
private static final String LOGIN_USER_KEY = "loginUser";
|
||||
|
||||
/**
|
||||
* 登录系统
|
||||
* 针对两套用户体系
|
||||
*
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
public static void login(LoginUser loginUser, UserType userType) {
|
||||
@ -30,6 +34,7 @@ public class LoginUtils {
|
||||
/**
|
||||
* 登录系统 基于 设备类型
|
||||
* 针对一套用户体系
|
||||
*
|
||||
* @param loginUser 登录用户信息
|
||||
*/
|
||||
public static void loginByDevice(LoginUser loginUser, UserType userType, DeviceType deviceType) {
|
||||
@ -62,7 +67,7 @@ public class LoginUtils {
|
||||
String replace = "";
|
||||
if (StringUtils.contains(loginId, UserType.SYS_USER.getUserType())) {
|
||||
userId = StringUtils.replace(loginId, UserType.SYS_USER.getUserType(), replace);
|
||||
} else if (StringUtils.contains(loginId, UserType.APP_USER.getUserType())){
|
||||
} else if (StringUtils.contains(loginId, UserType.APP_USER.getUserType())) {
|
||||
userId = StringUtils.replace(loginId, UserType.APP_USER.getUserType(), replace);
|
||||
} else {
|
||||
throw new UtilException("登录用户: LoginId异常 => " + loginId);
|
||||
@ -97,7 +102,7 @@ public class LoginUtils {
|
||||
public static UserType getUserType(Object loginId) {
|
||||
if (StringUtils.contains(loginId.toString(), UserType.SYS_USER.getUserType())) {
|
||||
return UserType.SYS_USER;
|
||||
} else if (StringUtils.contains(loginId.toString(), UserType.APP_USER.getUserType())){
|
||||
} else if (StringUtils.contains(loginId.toString(), UserType.APP_USER.getUserType())) {
|
||||
return UserType.APP_USER;
|
||||
} else {
|
||||
throw new UtilException("登录用户: LoginId异常 => " + loginId);
|
||||
|
@ -29,11 +29,11 @@ public class FileUtils extends FileUtil {
|
||||
|
||||
StringBuilder contentDispositionValue = new StringBuilder();
|
||||
contentDispositionValue.append("attachment; filename=")
|
||||
.append(percentEncodedFileName)
|
||||
.append(";")
|
||||
.append("filename*=")
|
||||
.append("utf-8''")
|
||||
.append(percentEncodedFileName);
|
||||
.append(percentEncodedFileName)
|
||||
.append(";")
|
||||
.append("filename*=")
|
||||
.append("utf-8''")
|
||||
.append(percentEncodedFileName);
|
||||
|
||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename");
|
||||
|
@ -41,9 +41,9 @@ public class AddressUtils {
|
||||
if (RuoYiConfig.isAddressEnabled()) {
|
||||
try {
|
||||
String rspStr = HttpUtil.createGet(IP_URL)
|
||||
.body("ip=" + ip + "&json=true", Constants.GBK)
|
||||
.execute()
|
||||
.body();
|
||||
.body("ip=" + ip + "&json=true", Constants.GBK)
|
||||
.execute()
|
||||
.body();
|
||||
if (StringUtils.isEmpty(rspStr)) {
|
||||
log.error("获取地理位置异常 {}", ip);
|
||||
return UNKNOWN;
|
||||
|
@ -130,7 +130,7 @@ public class RedisUtils {
|
||||
|
||||
/**
|
||||
* 注册对象监听器
|
||||
*
|
||||
* <p>
|
||||
* key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置
|
||||
*
|
||||
* @param key 缓存的键值
|
||||
@ -223,7 +223,7 @@ public class RedisUtils {
|
||||
|
||||
/**
|
||||
* 注册List监听器
|
||||
*
|
||||
* <p>
|
||||
* key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置
|
||||
*
|
||||
* @param key 缓存的键值
|
||||
@ -259,7 +259,7 @@ public class RedisUtils {
|
||||
|
||||
/**
|
||||
* 注册Set监听器
|
||||
*
|
||||
* <p>
|
||||
* key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置
|
||||
*
|
||||
* @param key 缓存的键值
|
||||
@ -296,7 +296,7 @@ public class RedisUtils {
|
||||
|
||||
/**
|
||||
* 注册Map监听器
|
||||
*
|
||||
* <p>
|
||||
* key 监听器需开启 `notify-keyspace-events` 等 redis 相关配置
|
||||
*
|
||||
* @param key 缓存的键值
|
||||
|
@ -16,7 +16,7 @@ public class SqlUtil {
|
||||
/**
|
||||
* 定义常用的 sql关键字
|
||||
*/
|
||||
public static String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare ";
|
||||
public static final String SQL_REGEX = "select |insert |delete |update |drop |count |exec |chr |mid |master |truncate |char |and |declare ";
|
||||
|
||||
/**
|
||||
* 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序)
|
||||
|
@ -5,7 +5,6 @@ import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@ -23,7 +22,7 @@ import java.util.concurrent.TimeUnit;
|
||||
// 类级别 缓存统一配置
|
||||
//@CacheConfig(cacheNames = "redissonCacheMap")
|
||||
@Api(value = "spring-cache 演示案例", tags = {"spring-cache 演示案例"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/cache")
|
||||
public class RedisCacheController {
|
||||
|
@ -6,7 +6,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -17,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Api(value = "Redis发布订阅 演示案例", tags = {"Redis发布订阅"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/redis/pubsub")
|
||||
public class RedisPubSubController {
|
||||
|
@ -8,7 +8,6 @@ import com.ruoyi.demo.mapper.TestDemoMapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -24,7 +23,7 @@ import java.util.List;
|
||||
* @date 2021-05-30
|
||||
*/
|
||||
@Api(value = "测试批量方法", tags = {"测试批量方法"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/batch")
|
||||
public class TestBatchController extends BaseController {
|
||||
@ -36,7 +35,7 @@ public class TestBatchController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新增批量方法 可完美替代 saveBatch 秒级插入上万数据 (对mysql负荷较大)
|
||||
*
|
||||
* <p>
|
||||
* 3.5.0 版本 增加 rewriteBatchedStatements=true 批处理参数 使 MP 原生批处理可以达到同样的速度
|
||||
*/
|
||||
@ApiOperation(value = "新增批量方法")
|
||||
@ -52,7 +51,7 @@ public class TestBatchController extends BaseController {
|
||||
|
||||
/**
|
||||
* 新增或更新 可完美替代 saveOrUpdateBatch 高性能
|
||||
*
|
||||
* <p>
|
||||
* 3.5.0 版本 增加 rewriteBatchedStatements=true 批处理参数 使 MP 原生批处理可以达到同样的速度
|
||||
*/
|
||||
@ApiOperation(value = "新增或更新批量方法")
|
||||
|
@ -12,8 +12,8 @@ import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ValidatorUtils;
|
||||
import com.ruoyi.common.excel.ExcelResult;
|
||||
import com.ruoyi.common.utils.ValidatorUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.demo.domain.TestDemo;
|
||||
import com.ruoyi.demo.domain.bo.TestDemoBo;
|
||||
@ -22,7 +22,6 @@ import com.ruoyi.demo.domain.vo.TestDemoVo;
|
||||
import com.ruoyi.demo.service.ITestDemoService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -42,7 +41,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "测试单表控制器", tags = {"测试单表管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/demo")
|
||||
public class TestDemoController extends BaseController {
|
||||
@ -144,7 +143,7 @@ public class TestDemoController extends BaseController {
|
||||
*/
|
||||
@ApiOperation("删除测试单表")
|
||||
@SaCheckPermission("demo:demo:remove")
|
||||
@Log(title = "测试单表" , businessType = BusinessType.DELETE)
|
||||
@Log(title = "测试单表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult<Void> remove(@ApiParam("测试ID串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
|
@ -14,13 +14,13 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 测试数据脱敏控制器
|
||||
*
|
||||
* <p>
|
||||
* 默认管理员不过滤
|
||||
* 需自行根据业务重写实现
|
||||
*
|
||||
* @see com.ruoyi.common.core.service.SensitiveService
|
||||
* @author Lion Li
|
||||
* @version 3.6.0
|
||||
* @see com.ruoyi.common.core.service.SensitiveService
|
||||
*/
|
||||
@Api(value = "测试数据脱敏控制器", tags = {"测试数据脱敏管理"})
|
||||
@RestController
|
||||
|
@ -17,7 +17,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -35,7 +34,7 @@ import java.util.List;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "测试树表控制器", tags = {"测试树表管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/tree")
|
||||
public class TestTreeController extends BaseController {
|
||||
@ -106,7 +105,7 @@ public class TestTreeController extends BaseController {
|
||||
*/
|
||||
@ApiOperation("删除测试树表")
|
||||
@SaCheckPermission("demo:tree:remove")
|
||||
@Log(title = "测试树表" , businessType = BusinessType.DELETE)
|
||||
@Log(title = "测试树表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult<Void> remove(@ApiParam("测试树ID串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
|
@ -7,7 +7,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -25,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(value = "有界队列 演示案例", tags = {"有界队列"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/queue/bounded")
|
||||
public class BoundedQueueController {
|
||||
|
@ -7,7 +7,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -28,7 +27,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(value = "延迟队列 演示案例", tags = {"延迟队列"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/queue/delayed")
|
||||
public class DelayedQueueController {
|
||||
|
@ -8,7 +8,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -26,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(value = "优先队列 演示案例", tags = {"优先队列"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/demo/queue/priority")
|
||||
public class PriorityQueueController {
|
||||
|
@ -175,6 +175,6 @@ public class LogAspect {
|
||||
}
|
||||
}
|
||||
return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse
|
||||
|| o instanceof BindingResult;
|
||||
|| o instanceof BindingResult;
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ package com.ruoyi.framework.aspectj;
|
||||
import com.ruoyi.common.annotation.RateLimiter;
|
||||
import com.ruoyi.common.enums.LimitType;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
@ -52,7 +52,7 @@ public class RateLimiterAspect {
|
||||
if (rateLimiter.limitType() == LimitType.IP) {
|
||||
// 获取请求ip
|
||||
stringBuffer.append(ServletUtils.getClientIP()).append("-");
|
||||
} else if (rateLimiter.limitType() == LimitType.CLUSTER){
|
||||
} else if (rateLimiter.limitType() == LimitType.CLUSTER) {
|
||||
// 获取客户端实例id
|
||||
stringBuffer.append(RedisUtils.getClient().getId()).append("-");
|
||||
}
|
||||
|
@ -6,16 +6,15 @@ import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.JsonUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.framework.config.properties.RepeatSubmitProperties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -32,7 +31,7 @@ import java.util.concurrent.TimeUnit;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@Aspect
|
||||
@Component
|
||||
public class RepeatSubmitAspect {
|
||||
|
@ -132,7 +132,7 @@ public class SwaggerConfig {
|
||||
* 默认的安全上引用
|
||||
*/
|
||||
private List<SecurityReference> defaultAuth() {
|
||||
AuthorizationScope authorizationScope = new AuthorizationScope("global" , "accessEverything");
|
||||
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||
authorizationScopes[0] = authorizationScope;
|
||||
List<SecurityReference> securityReferences = new ArrayList<>();
|
||||
|
@ -44,7 +44,7 @@ public class ThreadPoolConfig {
|
||||
@Bean(name = "scheduledExecutorService")
|
||||
protected ScheduledExecutorService scheduledExecutorService() {
|
||||
return new ScheduledThreadPoolExecutor(threadPoolProperties.getCorePoolSize(),
|
||||
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) {
|
||||
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build()) {
|
||||
@Override
|
||||
protected void afterExecute(Runnable r, Throwable t) {
|
||||
super.afterExecute(r, t);
|
||||
|
@ -56,7 +56,7 @@ public class UserActionListener implements SaTokenListener {
|
||||
userOnlineDTO.setDeptName(user.getDept().getDeptName());
|
||||
}
|
||||
RedisUtils.setCacheObject(Constants.ONLINE_TOKEN_KEY + tokenValue, userOnlineDTO, saTokenConfig.getTimeout(), TimeUnit.SECONDS);
|
||||
log.info("user doLogin, useId:{}, token:{}" , loginId, tokenValue);
|
||||
log.info("user doLogin, useId:{}, token:{}", loginId, tokenValue);
|
||||
} else if (userType == UserType.APP_USER) {
|
||||
// app端 自行根据业务编写
|
||||
}
|
||||
@ -68,7 +68,7 @@ public class UserActionListener implements SaTokenListener {
|
||||
@Override
|
||||
public void doLogout(String loginType, Object loginId, String tokenValue) {
|
||||
RedisUtils.deleteObject(Constants.ONLINE_TOKEN_KEY + tokenValue);
|
||||
log.info("user doLogout, useId:{}, token:{}" , loginId, tokenValue);
|
||||
log.info("user doLogout, useId:{}, token:{}", loginId, tokenValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -77,7 +77,7 @@ public class UserActionListener implements SaTokenListener {
|
||||
@Override
|
||||
public void doKickout(String loginType, Object loginId, String tokenValue) {
|
||||
RedisUtils.deleteObject(Constants.ONLINE_TOKEN_KEY + tokenValue);
|
||||
log.info("user doLogoutByLoginId, useId:{}, token:{}" , loginId, tokenValue);
|
||||
log.info("user doLogoutByLoginId, useId:{}, token:{}", loginId, tokenValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,7 +86,7 @@ public class UserActionListener implements SaTokenListener {
|
||||
@Override
|
||||
public void doReplaced(String loginType, Object loginId, String tokenValue) {
|
||||
RedisUtils.deleteObject(Constants.ONLINE_TOKEN_KEY + tokenValue);
|
||||
log.info("user doReplaced, useId:{}, token:{}" , loginId, tokenValue);
|
||||
log.info("user doReplaced, useId:{}, token:{}", loginId, tokenValue);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,11 +31,11 @@ public class PlusSaTokenDao implements SaTokenDao {
|
||||
*/
|
||||
@Override
|
||||
public void set(String key, String value, long timeout) {
|
||||
if(timeout == 0 || timeout <= SaTokenDao.NOT_VALUE_EXPIRE) {
|
||||
if (timeout == 0 || timeout <= SaTokenDao.NOT_VALUE_EXPIRE) {
|
||||
return;
|
||||
}
|
||||
// 判断是否为永不过期
|
||||
if(timeout == SaTokenDao.NEVER_EXPIRE) {
|
||||
if (timeout == SaTokenDao.NEVER_EXPIRE) {
|
||||
RedisUtils.setCacheObject(key, value);
|
||||
} else {
|
||||
RedisUtils.setCacheObject(key, value, timeout, TimeUnit.SECONDS);
|
||||
@ -49,7 +49,7 @@ public class PlusSaTokenDao implements SaTokenDao {
|
||||
public void update(String key, String value) {
|
||||
long expire = getTimeout(key);
|
||||
// -2 = 无此键
|
||||
if(expire == SaTokenDao.NOT_VALUE_EXPIRE) {
|
||||
if (expire == SaTokenDao.NOT_VALUE_EXPIRE) {
|
||||
return;
|
||||
}
|
||||
this.set(key, value, expire);
|
||||
@ -77,9 +77,9 @@ public class PlusSaTokenDao implements SaTokenDao {
|
||||
@Override
|
||||
public void updateTimeout(String key, long timeout) {
|
||||
// 判断是否想要设置为永久
|
||||
if(timeout == SaTokenDao.NEVER_EXPIRE) {
|
||||
if (timeout == SaTokenDao.NEVER_EXPIRE) {
|
||||
long expire = getTimeout(key);
|
||||
if(expire == SaTokenDao.NEVER_EXPIRE) {
|
||||
if (expire == SaTokenDao.NEVER_EXPIRE) {
|
||||
// 如果其已经被设置为永久,则不作任何处理
|
||||
} else {
|
||||
// 如果尚未被设置为永久,那么再次set一次
|
||||
@ -91,7 +91,6 @@ public class PlusSaTokenDao implements SaTokenDao {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取Object,如无返空
|
||||
*/
|
||||
@ -105,11 +104,11 @@ public class PlusSaTokenDao implements SaTokenDao {
|
||||
*/
|
||||
@Override
|
||||
public void setObject(String key, Object object, long timeout) {
|
||||
if(timeout == 0 || timeout <= SaTokenDao.NOT_VALUE_EXPIRE) {
|
||||
if (timeout == 0 || timeout <= SaTokenDao.NOT_VALUE_EXPIRE) {
|
||||
return;
|
||||
}
|
||||
// 判断是否为永不过期
|
||||
if(timeout == SaTokenDao.NEVER_EXPIRE) {
|
||||
if (timeout == SaTokenDao.NEVER_EXPIRE) {
|
||||
RedisUtils.setCacheObject(key, object);
|
||||
} else {
|
||||
RedisUtils.setCacheObject(key, object, timeout, TimeUnit.SECONDS);
|
||||
@ -123,7 +122,7 @@ public class PlusSaTokenDao implements SaTokenDao {
|
||||
public void updateObject(String key, Object object) {
|
||||
long expire = getObjectTimeout(key);
|
||||
// -2 = 无此键
|
||||
if(expire == SaTokenDao.NOT_VALUE_EXPIRE) {
|
||||
if (expire == SaTokenDao.NOT_VALUE_EXPIRE) {
|
||||
return;
|
||||
}
|
||||
this.setObject(key, object, expire);
|
||||
@ -151,9 +150,9 @@ public class PlusSaTokenDao implements SaTokenDao {
|
||||
@Override
|
||||
public void updateObjectTimeout(String key, long timeout) {
|
||||
// 判断是否想要设置为永久
|
||||
if(timeout == SaTokenDao.NEVER_EXPIRE) {
|
||||
if (timeout == SaTokenDao.NEVER_EXPIRE) {
|
||||
long expire = getObjectTimeout(key);
|
||||
if(expire == SaTokenDao.NEVER_EXPIRE) {
|
||||
if (expire == SaTokenDao.NEVER_EXPIRE) {
|
||||
// 如果其已经被设置为永久,则不作任何处理
|
||||
} else {
|
||||
// 如果尚未被设置为永久,那么再次set一次
|
||||
|
@ -65,7 +65,7 @@ public class GlobalExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler(HttpRequestMethodNotSupportedException.class)
|
||||
public AjaxResult<Void> handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e,
|
||||
HttpServletRequest request) {
|
||||
HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod());
|
||||
return AjaxResult.error(e.getMessage());
|
||||
|
@ -16,7 +16,6 @@ import com.ruoyi.generator.service.IGenTableService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -33,7 +32,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "代码生成", tags = {"代码生成管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/tool/gen")
|
||||
public class GenController extends BaseController {
|
||||
|
@ -196,7 +196,7 @@ public class GenTable extends BaseEntity {
|
||||
public static boolean isSuperColumn(String tplCategory, String javaField) {
|
||||
if (isTree(tplCategory)) {
|
||||
return StringUtils.equalsAnyIgnoreCase(javaField,
|
||||
ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY));
|
||||
ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY));
|
||||
}
|
||||
return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY);
|
||||
}
|
||||
|
@ -190,10 +190,10 @@ public class GenTableColumn extends BaseEntity {
|
||||
|
||||
public static boolean isSuperColumn(String javaField) {
|
||||
return StringUtils.equalsAnyIgnoreCase(javaField,
|
||||
// BaseEntity
|
||||
"createBy", "createTime", "updateBy", "updateTime",
|
||||
// TreeEntity
|
||||
"parentName", "parentId");
|
||||
// BaseEntity
|
||||
"createBy", "createTime", "updateBy", "updateTime",
|
||||
// TreeEntity
|
||||
"parentName", "parentId");
|
||||
}
|
||||
|
||||
public boolean isUsableColumn() {
|
||||
|
@ -29,8 +29,8 @@ public class GenTableColumnServiceImpl implements IGenTableColumnService {
|
||||
@Override
|
||||
public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<GenTableColumn>()
|
||||
.eq(GenTableColumn::getTableId, tableId)
|
||||
.orderByAsc(GenTableColumn::getSort));
|
||||
.eq(GenTableColumn::getTableId, tableId)
|
||||
.orderByAsc(GenTableColumn::getSort));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,9 @@ import com.ruoyi.common.constant.GenConstants;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.*;
|
||||
import com.ruoyi.common.utils.JsonUtils;
|
||||
import com.ruoyi.common.utils.LoginUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.generator.domain.GenTable;
|
||||
import com.ruoyi.generator.domain.GenTableColumn;
|
||||
|
@ -99,7 +99,7 @@ public class GenUtils {
|
||||
}
|
||||
// 类型&性别字段设置下拉框
|
||||
else if (StringUtils.endsWithIgnoreCase(columnName, "type")
|
||||
|| StringUtils.endsWithIgnoreCase(columnName, "sex")) {
|
||||
|| StringUtils.endsWithIgnoreCase(columnName, "sex")) {
|
||||
column.setHtmlType(GenConstants.HTML_SELECT);
|
||||
}
|
||||
// 图片字段设置图片上传控件
|
||||
|
@ -244,8 +244,8 @@ public class VelocityUtils {
|
||||
Set<String> dicts = new HashSet<String>();
|
||||
for (GenTableColumn column : columns) {
|
||||
if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny(
|
||||
column.getHtmlType(),
|
||||
new String[] { GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX })) {
|
||||
column.getHtmlType(),
|
||||
new String[]{GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX})) {
|
||||
dicts.add("'" + column.getDictType() + "'");
|
||||
}
|
||||
}
|
||||
@ -271,7 +271,7 @@ public class VelocityUtils {
|
||||
*/
|
||||
public static String getParentMenuId(Map<String, Object> paramsObj) {
|
||||
if (StringUtils.isNotEmpty(paramsObj) && paramsObj.containsKey(GenConstants.PARENT_MENU_ID)
|
||||
&& StringUtils.isNotEmpty(Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID)))) {
|
||||
&& StringUtils.isNotEmpty(Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID)))) {
|
||||
return Convert.toStr(paramsObj.get(GenConstants.PARENT_MENU_ID));
|
||||
}
|
||||
return DEFAULT_PARENT_MENU_ID;
|
||||
|
@ -8,7 +8,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
@ -40,7 +39,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
*/
|
||||
@Validated
|
||||
@Api(value = "${functionName}控制器", tags = {"${functionName}管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/${moduleName}/${businessName}")
|
||||
public class ${ClassName}Controller extends BaseController {
|
||||
@ -117,7 +116,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||
*/
|
||||
@ApiOperation("删除${functionName}")
|
||||
@SaCheckPermission("${permissionPrefix}:remove")
|
||||
@Log(title = "${functionName}" , businessType = BusinessType.DELETE)
|
||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
||||
public AjaxResult<Void> remove(@ApiParam("主键串")
|
||||
@NotEmpty(message = "主键不能为空")
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.ruoyi.oss.factory;
|
||||
|
||||
import com.ruoyi.common.utils.JsonUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import com.ruoyi.common.utils.reflect.ReflectUtils;
|
||||
import com.ruoyi.oss.constant.OssConstant;
|
||||
import com.ruoyi.oss.enumd.OssEnumd;
|
||||
@ -74,7 +74,7 @@ public class OssFactory {
|
||||
}
|
||||
// 获取redis配置信息 创建对象 并缓存
|
||||
IOssStrategy service = (IOssStrategy) ReflectUtils.newInstance(OssEnumd.getServiceClass(type));
|
||||
((AbstractOssStrategy)service).init(properties);
|
||||
((AbstractOssStrategy) service).init(properties);
|
||||
SERVICES.put(type, service);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class AliyunOssStrategy extends AbstractOssStrategy {
|
||||
|
||||
@Override
|
||||
public void delete(String path) {
|
||||
path = path.replace(getEndpointLink() + "/" , "");
|
||||
path = path.replace(getEndpointLink() + "/", "");
|
||||
try {
|
||||
client.deleteObject(properties.getBucketName(), path);
|
||||
} catch (Exception e) {
|
||||
|
@ -15,9 +15,9 @@ public interface SysDictDataMapper extends BaseMapperPlus<SysDictDataMapper, Sys
|
||||
|
||||
default List<SysDictData> selectDictDataByType(String dictType) {
|
||||
return selectList(
|
||||
new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(SysDictData::getStatus, "0")
|
||||
.eq(SysDictData::getDictType, dictType)
|
||||
.orderByAsc(SysDictData::getDictSort));
|
||||
new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(SysDictData::getStatus, "0")
|
||||
.eq(SysDictData::getDictType, dictType)
|
||||
.orderByAsc(SysDictData::getDictSort));
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import com.ruoyi.system.service.ISysOssConfigService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -17,7 +16,7 @@ import org.springframework.stereotype.Component;
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
public class SystemApplicationRunner implements ApplicationRunner {
|
||||
|
||||
@ -30,7 +29,7 @@ public class SystemApplicationRunner implements ApplicationRunner {
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
ossConfigService.init();
|
||||
log.info("初始化OSS配置成功");
|
||||
if (ruoyiConfig.isCacheLazy()){
|
||||
if (ruoyiConfig.isCacheLazy()) {
|
||||
return;
|
||||
}
|
||||
configService.loadingConfigCache();
|
||||
|
@ -9,6 +9,7 @@ public interface ISysDataScopeService {
|
||||
|
||||
/**
|
||||
* 获取角色自定义权限
|
||||
*
|
||||
* @param roleId 角色id
|
||||
* @return 部门id组
|
||||
*/
|
||||
@ -16,6 +17,7 @@ public interface ISysDataScopeService {
|
||||
|
||||
/**
|
||||
* 获取部门及以下权限
|
||||
*
|
||||
* @param deptId 部门id
|
||||
* @return 部门id组
|
||||
*/
|
||||
|
@ -45,10 +45,10 @@ public class SysRegisterService {
|
||||
} else if (StringUtils.isEmpty(password)) {
|
||||
msg = "用户密码不能为空";
|
||||
} else if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
msg = "账户长度必须在2到20个字符之间";
|
||||
} else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||
msg = "密码长度必须在5到20个字符之间";
|
||||
} else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(username))) {
|
||||
msg = "保存用户'" + username + "'失败,注册账号已存在";
|
||||
@ -62,7 +62,7 @@ public class SysRegisterService {
|
||||
msg = "注册失败,请联系系统管理人员";
|
||||
} else {
|
||||
asyncService.recordLogininfor(username, Constants.REGISTER,
|
||||
MessageUtils.message("user.register.success"), ServletUtils.getRequest());
|
||||
MessageUtils.message("user.register.success"), ServletUtils.getRequest());
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
|
@ -29,10 +29,10 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
@Override
|
||||
public TableDataInfo<SysDictData> selectPageDictDataList(SysDictData dictData, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysDictData> lqw = new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType())
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort);
|
||||
.eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType())
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort);
|
||||
Page<SysDictData> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
@ -46,10 +46,10 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SysDictData>()
|
||||
.eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType())
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort));
|
||||
.eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType())
|
||||
.like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel())
|
||||
.eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus())
|
||||
.orderByAsc(SysDictData::getDictSort));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,7 +65,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
.select(SysDictData::getDictLabel)
|
||||
.eq(SysDictData::getDictType, dictType)
|
||||
.eq(SysDictData::getDictValue, dictValue))
|
||||
.getDictLabel();
|
||||
.getDictLabel();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService, Logininf
|
||||
.like(StringUtils.isNotBlank(logininfor.getUserName()), SysLogininfor::getUserName, logininfor.getUserName())
|
||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
SysLogininfor::getLoginTime, params.get("beginTime"), params.get("endTime"));
|
||||
if(StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
||||
if (StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
||||
pageQuery.setOrderByColumn("info_id").setIsAsc("desc");
|
||||
}
|
||||
Page<SysLogininfor> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
|
@ -28,9 +28,9 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||
@Override
|
||||
public TableDataInfo<SysNotice> selectPageNoticeList(SysNotice notice, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysNotice> lqw = new LambdaQueryWrapper<SysNotice>()
|
||||
.like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle())
|
||||
.eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType())
|
||||
.like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy());
|
||||
.like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle())
|
||||
.eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType())
|
||||
.like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy());
|
||||
Page<SysNotice> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
@ -55,9 +55,9 @@ public class SysNoticeServiceImpl implements ISysNoticeService {
|
||||
@Override
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SysNotice>()
|
||||
.like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle())
|
||||
.eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType())
|
||||
.like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy()));
|
||||
.like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle())
|
||||
.eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType())
|
||||
.like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,7 +64,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService, OperLogService
|
||||
.like(StringUtils.isNotBlank(operLog.getOperName()), SysOperLog::getOperName, operLog.getOperName())
|
||||
.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
SysOperLog::getOperTime, params.get("beginTime"), params.get("endTime"));
|
||||
if(StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
||||
if (StringUtils.isBlank(pageQuery.getOrderByColumn())) {
|
||||
pageQuery.setOrderByColumn("oper_id").setIsAsc("desc");
|
||||
}
|
||||
Page<SysOperLog> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
|
@ -106,7 +106,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
*/
|
||||
private void validEntityBeforeSave(SysOssConfig entity) {
|
||||
if (StringUtils.isNotEmpty(entity.getConfigKey())
|
||||
&& UserConstants.NOT_UNIQUE.equals(checkConfigKeyUnique(entity))) {
|
||||
&& UserConstants.NOT_UNIQUE.equals(checkConfigKeyUnique(entity))) {
|
||||
throw new ServiceException("操作配置'" + entity.getConfigKey() + "'失败, 配置key已存在!");
|
||||
}
|
||||
}
|
||||
@ -138,8 +138,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
private String checkConfigKeyUnique(SysOssConfig sysOssConfig) {
|
||||
long ossConfigId = StringUtils.isNull(sysOssConfig.getOssConfigId()) ? -1L : sysOssConfig.getOssConfigId();
|
||||
SysOssConfig info = baseMapper.selectOne(new LambdaQueryWrapper<SysOssConfig>()
|
||||
.select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey)
|
||||
.eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey()));
|
||||
.select(SysOssConfig::getOssConfigId, SysOssConfig::getConfigKey)
|
||||
.eq(SysOssConfig::getConfigKey, sysOssConfig.getConfigKey()));
|
||||
if (StringUtils.isNotNull(info) && info.getOssConfigId() != ossConfigId) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -154,7 +154,7 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
public int updateOssConfigStatus(SysOssConfigBo bo) {
|
||||
SysOssConfig sysOssConfig = BeanUtil.toBean(bo, SysOssConfig.class);
|
||||
int row = baseMapper.update(null, new LambdaUpdateWrapper<SysOssConfig>()
|
||||
.set(SysOssConfig::getStatus, "1"));
|
||||
.set(SysOssConfig::getStatus, "1"));
|
||||
row += baseMapper.updateById(sysOssConfig);
|
||||
if (row > 0) {
|
||||
RedisUtils.setCacheObject(OssConstant.CACHE_CONFIG_KEY, sysOssConfig.getConfigKey());
|
||||
@ -182,8 +182,8 @@ public class SysOssConfigServiceImpl implements ISysOssConfigService {
|
||||
private boolean setConfigCache(boolean flag, SysOssConfig config) {
|
||||
if (flag) {
|
||||
RedisUtils.setCacheObject(
|
||||
getCacheKey(config.getConfigKey()),
|
||||
JsonUtils.toJsonString(config));
|
||||
getCacheKey(config.getConfigKey()),
|
||||
JsonUtils.toJsonString(config));
|
||||
RedisUtils.publish(OssConstant.CACHE_CONFIG_KEY, config.getConfigKey(), msg -> {
|
||||
log.info("发布刷新OSS配置 => " + msg);
|
||||
});
|
||||
|
@ -50,7 +50,7 @@ public class SysOssServiceImpl implements ISysOssService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
SysOss::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getService()), SysOss::getService, bo.getService());
|
||||
return lqw;
|
||||
@ -74,11 +74,11 @@ public class SysOssServiceImpl implements ISysOssService {
|
||||
}
|
||||
// 保存文件信息
|
||||
SysOss oss = new SysOss()
|
||||
.setUrl(uploadResult.getUrl())
|
||||
.setFileSuffix(suffix)
|
||||
.setFileName(uploadResult.getFilename())
|
||||
.setOriginalName(originalfileName)
|
||||
.setService(storage.getServiceType());
|
||||
.setUrl(uploadResult.getUrl())
|
||||
.setFileSuffix(suffix)
|
||||
.setFileName(uploadResult.getFilename())
|
||||
.setOriginalName(originalfileName)
|
||||
.setService(storage.getServiceType());
|
||||
baseMapper.insert(oss);
|
||||
return oss;
|
||||
}
|
||||
|
@ -33,9 +33,9 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||
@Override
|
||||
public TableDataInfo<SysPost> selectPagePostList(SysPost post, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysPost> lqw = new LambdaQueryWrapper<SysPost>()
|
||||
.like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode())
|
||||
.eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus())
|
||||
.like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName());
|
||||
.like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode())
|
||||
.eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus())
|
||||
.like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName());
|
||||
Page<SysPost> page = baseMapper.selectPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
@ -49,9 +49,9 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||
@Override
|
||||
public List<SysPost> selectPostList(SysPost post) {
|
||||
return baseMapper.selectList(new LambdaQueryWrapper<SysPost>()
|
||||
.like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode())
|
||||
.eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus())
|
||||
.like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName()));
|
||||
.like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode())
|
||||
.eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus())
|
||||
.like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,8 +96,8 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||
public String checkPostNameUnique(SysPost post) {
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysPost>()
|
||||
.eq(SysPost::getPostName, post.getPostName())
|
||||
.ne(SysPost::getPostId, postId));
|
||||
.eq(SysPost::getPostName, post.getPostName())
|
||||
.ne(SysPost::getPostId, postId));
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -114,8 +114,8 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||
public String checkPostCodeUnique(SysPost post) {
|
||||
Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysPost>()
|
||||
.eq(SysPost::getPostCode, post.getPostCode())
|
||||
.ne(SysPost::getPostId, postId));
|
||||
.eq(SysPost::getPostCode, post.getPostCode())
|
||||
.ne(SysPost::getPostId, postId));
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
|
@ -137,8 +137,8 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||
public String checkRoleNameUnique(SysRole role) {
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysRole>()
|
||||
.eq(SysRole::getRoleName, role.getRoleName())
|
||||
.ne(SysRole::getRoleId, roleId));
|
||||
.eq(SysRole::getRoleName, role.getRoleName())
|
||||
.ne(SysRole::getRoleId, roleId));
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -155,8 +155,8 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||
public String checkRoleKeyUnique(SysRole role) {
|
||||
Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId();
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysRole>()
|
||||
.eq(SysRole::getRoleKey, role.getRoleKey())
|
||||
.ne(SysRole::getRoleId, roleId));
|
||||
.eq(SysRole::getRoleKey, role.getRoleKey())
|
||||
.ne(SysRole::getRoleId, roleId));
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -352,8 +352,8 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||
@Override
|
||||
public int deleteAuthUser(SysUserRole userRole) {
|
||||
return userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>()
|
||||
.eq(SysUserRole::getRoleId, userRole.getRoleId())
|
||||
.eq(SysUserRole::getUserId, userRole.getUserId()));
|
||||
.eq(SysUserRole::getRoleId, userRole.getRoleId())
|
||||
.eq(SysUserRole::getUserId, userRole.getUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -366,8 +366,8 @@ public class SysRoleServiceImpl implements ISysRoleService {
|
||||
@Override
|
||||
public int deleteAuthUsers(Long roleId, Long[] userIds) {
|
||||
return userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>()
|
||||
.eq(SysUserRole::getRoleId, roleId)
|
||||
.in(SysUserRole::getUserId, Arrays.asList(userIds)));
|
||||
.eq(SysUserRole::getRoleId, roleId)
|
||||
.in(SysUserRole::getUserId, Arrays.asList(userIds)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,6 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.service.UserService;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.LoginUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
@ -164,8 +163,8 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
public String checkPhoneUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysUser>()
|
||||
.eq(SysUser::getPhonenumber, user.getPhonenumber())
|
||||
.ne(SysUser::getUserId, userId));
|
||||
.eq(SysUser::getPhonenumber, user.getPhonenumber())
|
||||
.ne(SysUser::getUserId, userId));
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -182,8 +181,8 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
public String checkEmailUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
boolean count = baseMapper.exists(new LambdaQueryWrapper<SysUser>()
|
||||
.eq(SysUser::getEmail, user.getEmail())
|
||||
.ne(SysUser::getUserId, userId));
|
||||
.eq(SysUser::getEmail, user.getEmail())
|
||||
.ne(SysUser::getUserId, userId));
|
||||
if (count) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
@ -279,7 +278,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void insertUserAuth(Long userId, Long[] roleIds) {
|
||||
userRoleMapper.delete(new LambdaQueryWrapper<SysUserRole>()
|
||||
.eq(SysUserRole::getUserId, userId));
|
||||
.eq(SysUserRole::getUserId, userId));
|
||||
insertUserRole(userId, roleIds);
|
||||
}
|
||||
|
||||
@ -315,9 +314,9 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
@Override
|
||||
public boolean updateUserAvatar(String userName, String avatar) {
|
||||
return baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SysUser>()
|
||||
.set(SysUser::getAvatar, avatar)
|
||||
.eq(SysUser::getUserName, userName)) > 0;
|
||||
new LambdaUpdateWrapper<SysUser>()
|
||||
.set(SysUser::getAvatar, avatar)
|
||||
.eq(SysUser::getUserName, userName)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -341,9 +340,9 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
@Override
|
||||
public int resetUserPwd(String userName, String password) {
|
||||
return baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SysUser>()
|
||||
.set(SysUser::getPassword, password)
|
||||
.eq(SysUser::getUserName, userName));
|
||||
new LambdaUpdateWrapper<SysUser>()
|
||||
.set(SysUser::getPassword, password)
|
||||
.eq(SysUser::getUserName, userName));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user