mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 12:48:58 +08:00
style(格式化): spring 规范代码格式化
This commit is contained in:
parent
a3fe7a7dee
commit
9659b7f200
@ -25,29 +25,29 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ImageCodeEndpoint {
|
public class ImageCodeEndpoint {
|
||||||
|
|
||||||
private static final Integer DEFAULT_IMAGE_WIDTH = 100;
|
private static final Integer DEFAULT_IMAGE_WIDTH = 100;
|
||||||
|
|
||||||
private static final Integer DEFAULT_IMAGE_HEIGHT = 40;
|
private static final Integer DEFAULT_IMAGE_HEIGHT = 40;
|
||||||
|
|
||||||
private final RedisTemplate redisTemplate;
|
private final RedisTemplate redisTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建图形验证码
|
* 创建图形验证码
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@GetMapping("/image")
|
@GetMapping("/image")
|
||||||
public void image(String randomStr, HttpServletResponse response) {
|
public void image(String randomStr, HttpServletResponse response) {
|
||||||
ArithmeticCaptcha captcha = new ArithmeticCaptcha(DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT);
|
ArithmeticCaptcha captcha = new ArithmeticCaptcha(DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT);
|
||||||
|
|
||||||
if (Validator.isMobile(randomStr)) {
|
if (Validator.isMobile(randomStr)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String result = captcha.text();
|
String result = captcha.text();
|
||||||
redisTemplate.opsForValue()
|
redisTemplate.opsForValue()
|
||||||
.set(CacheConstants.DEFAULT_CODE_KEY + randomStr, result, SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
|
.set(CacheConstants.DEFAULT_CODE_KEY + randomStr, result, SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
|
||||||
// 转换流信息写出
|
// 转换流信息写出
|
||||||
captcha.out(response.getOutputStream());
|
captcha.out(response.getOutputStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
// 更新用户角色表
|
// 更新用户角色表
|
||||||
if (Objects.nonNull(userDto.getRole())) {
|
if (Objects.nonNull(userDto.getRole())) {
|
||||||
// 删除用户角色关系
|
// 删除用户角色关系
|
||||||
sysUserRoleMapper.delete(Wrappers.<SysUserRole>lambdaQuery().eq(SysUserRole::getUserId, userDto.getUserId()));
|
sysUserRoleMapper
|
||||||
|
.delete(Wrappers.<SysUserRole>lambdaQuery().eq(SysUserRole::getUserId, userDto.getUserId()));
|
||||||
userDto.getRole().stream().map(roleId -> {
|
userDto.getRole().stream().map(roleId -> {
|
||||||
SysUserRole userRole = new SysUserRole();
|
SysUserRole userRole = new SysUserRole();
|
||||||
userRole.setUserId(sysUser.getUserId());
|
userRole.setUserId(sysUser.getUserId());
|
||||||
@ -240,7 +241,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
|
|
||||||
if (Objects.nonNull(userDto.getPost())) {
|
if (Objects.nonNull(userDto.getPost())) {
|
||||||
// 删除用户岗位关系
|
// 删除用户岗位关系
|
||||||
sysUserPostMapper.delete(Wrappers.<SysUserPost>lambdaQuery().eq(SysUserPost::getUserId, userDto.getUserId()));
|
sysUserPostMapper
|
||||||
|
.delete(Wrappers.<SysUserPost>lambdaQuery().eq(SysUserPost::getUserId, userDto.getUserId()));
|
||||||
userDto.getPost().stream().map(postId -> {
|
userDto.getPost().stream().map(postId -> {
|
||||||
SysUserPost userPost = new SysUserPost();
|
SysUserPost userPost = new SysUserPost();
|
||||||
userPost.setUserId(sysUser.getUserId());
|
userPost.setUserId(sysUser.getUserId());
|
||||||
|
Loading…
Reference in New Issue
Block a user