Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c64fb7a16a | |||
| 9e21304dbf | |||
| 9888150523 | |||
| 02cf3546fb | |||
| 2d4d7b6fb1 | |||
| e08160afb6 | |||
| f52bb99419 | |||
| d20e03ea61 | |||
| 8c36b41072 | |||
| 94d7cd3489 |
@@ -0,0 +1,13 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="ruoyi-snailai-server" type="docker-deploy" factoryName="dockerfile"
|
||||||
|
server-name="Docker">
|
||||||
|
<deployment type="dockerfile">
|
||||||
|
<settings>
|
||||||
|
<option name="imageTag" value="ruoyi/ruoyi-snailai-server:5.5.3"/>
|
||||||
|
<option name="buildOnly" value="true"/>
|
||||||
|
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-snailai-server/Dockerfile"/>
|
||||||
|
</settings>
|
||||||
|
</deployment>
|
||||||
|
<method v="2"/>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
@@ -22,8 +22,7 @@
|
|||||||
|
|
||||||
> 系统演示: [传送门](https://plus-doc.dromara.org/#/common/demo_system)
|
> 系统演示: [传送门](https://plus-doc.dromara.org/#/common/demo_system)
|
||||||
|
|
||||||
>
|
> 官方前端项目地址: [gitee](https://gitee.com/JavaLionLi/plus-ui) - [github](https://github.com/CrazyLionCat/plus-ui) - [gitcode](https://gitcode.com/dromara/plus-ui)<br>
|
||||||
官方前端项目地址: [gitee](https://gitee.com/JavaLionLi/plus-ui) - [github](https://github.com/CrazyLionCat/plus-ui) - [gitcode](https://gitcode.com/dromara/plus-ui)<br>
|
|
||||||
> 成员前端项目地址: 基于vben5 [ruoyi-plus-vben5](https://github.com/imdap/ruoyi-plus-vben5)<br>
|
> 成员前端项目地址: 基于vben5 [ruoyi-plus-vben5](https://github.com/imdap/ruoyi-plus-vben5)<br>
|
||||||
> 成员前端项目地址: 基于soybean [ruoyi-plus-soybean](https://gitee.com/xlsea/ruoyi-plus-soybean)<br>
|
> 成员前端项目地址: 基于soybean [ruoyi-plus-soybean](https://gitee.com/xlsea/ruoyi-plus-soybean)<br>
|
||||||
> 成员项目地址: 删除多租户与工作流 [RuoYi-Vue-Plus-Single](https://gitee.com/ColorDreams/RuoYi-Vue-Plus-Single)<br>
|
> 成员项目地址: 删除多租户与工作流 [RuoYi-Vue-Plus-Single](https://gitee.com/ColorDreams/RuoYi-Vue-Plus-Single)<br>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<name>RuoYi-Vue-Plus</name>
|
<name>RuoYi-Vue-Plus</name>
|
||||||
<url>https://gitee.com/dromara/RuoYi-Vue-Plus</url>
|
<url>https://gitee.com/dromara/RuoYi-Vue-Plus</url>
|
||||||
<description>Dromara RuoYi-Vue-Plus管理系统</description>
|
<description>Dromara RuoYi-Vue-Plus后台管理系统</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>5.5.3</revision>
|
<revision>5.5.3</revision>
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ springdoc:
|
|||||||
enabled: true
|
enabled: true
|
||||||
info:
|
info:
|
||||||
# 标题
|
# 标题
|
||||||
title: '标题:RuoYi-Vue-Plus管理系统_接口文档'
|
title: '标题:RuoYi-Vue-Plus后台管理系统_接口文档'
|
||||||
# 描述
|
# 描述
|
||||||
description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...'
|
description: '描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...'
|
||||||
# 版本
|
# 版本
|
||||||
@@ -191,6 +191,7 @@ xss:
|
|||||||
# 排除链接
|
# 排除链接
|
||||||
excludeUrls:
|
excludeUrls:
|
||||||
- /system/notice
|
- /system/notice
|
||||||
|
- /warm-flow/save-json
|
||||||
|
|
||||||
--- # 分布式锁 lock4j 全局配置
|
--- # 分布式锁 lock4j 全局配置
|
||||||
lock4j:
|
lock4j:
|
||||||
|
|||||||
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
package org.dromara.common.core.exception.base;
|
package org.dromara.common.core.exception.base;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.dromara.common.core.utils.MessageUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.dromara.common.core.utils.MessageUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
|
||||||
|
|||||||
+5
-8
@@ -2,6 +2,8 @@ package org.dromara.common.core.utils;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||||
import org.dromara.common.core.enums.FormatsType;
|
import org.dromara.common.core.enums.FormatsType;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
@@ -19,6 +21,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||||
/**
|
/**
|
||||||
* 日期解析格式集合。
|
* 日期解析格式集合。
|
||||||
@@ -26,14 +29,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
|||||||
private static final String[] PARSE_PATTERNS = {
|
private static final String[] PARSE_PATTERNS = {
|
||||||
"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"
|
||||||
|
};
|
||||||
/**
|
|
||||||
* 工具类不允许实例化。
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
private DateUtils() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前日期和时间
|
* 获取当前日期和时间
|
||||||
|
|||||||
-1
@@ -14,7 +14,6 @@ import java.util.Map;
|
|||||||
* Mapstruct 工具类
|
* Mapstruct 工具类
|
||||||
* <p>参考文档:<a href="https://mapstruct.plus/introduction/quick-start.html">mapstruct-plus</a></p>
|
* <p>参考文档:<a href="https://mapstruct.plus/introduction/quick-start.html">mapstruct-plus</a></p>
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @author Michelle.Chung
|
* @author Michelle.Chung
|
||||||
*/
|
*/
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
|
|||||||
+1
@@ -179,6 +179,7 @@ public class StreamUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 map 中的数据作为新 Map 的 value ,key 不变
|
* 获取 map 中的数据作为新 Map 的 value ,key 不变
|
||||||
|
*
|
||||||
* @param map 需要处理的map
|
* @param map 需要处理的map
|
||||||
* @param take 取值函数
|
* @param take 取值函数
|
||||||
* @param <K> map中的key类型
|
* @param <K> map中的key类型
|
||||||
|
|||||||
+3
@@ -23,6 +23,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
|
|
||||||
public static final String SLASH = "/";
|
public static final String SLASH = "/";
|
||||||
|
|
||||||
|
public static final String COLON = ":";
|
||||||
|
|
||||||
private static final AntPathMatcher ANT_PATH_MATCHER = new AntPathMatcher();
|
private static final AntPathMatcher ANT_PATH_MATCHER = new AntPathMatcher();
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@@ -363,6 +365,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将可迭代对象中的元素使用逗号拼接成字符串
|
* 将可迭代对象中的元素使用逗号拼接成字符串
|
||||||
*
|
*
|
||||||
|
|||||||
+4
-1
@@ -6,7 +6,10 @@ import lombok.NoArgsConstructor;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+61
-16
@@ -1,60 +1,64 @@
|
|||||||
package org.dromara.common.core.utils.file;
|
package org.dromara.common.core.utils.file;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 媒体类型工具类
|
* 媒体类型工具类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class MimeTypeUtils {
|
public class MimeTypeUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PNG 图片 MIME 类型。
|
* PNG 图片 MIME 类型
|
||||||
*/
|
*/
|
||||||
public static final String IMAGE_PNG = "image/png";
|
public static final String IMAGE_PNG = "image/png";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JPG 图片 MIME 类型。
|
* JPG 图片 MIME 类型
|
||||||
*/
|
*/
|
||||||
public static final String IMAGE_JPG = "image/jpg";
|
public static final String IMAGE_JPG = "image/jpg";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JPEG 图片 MIME 类型。
|
* JPEG 图片 MIME 类型
|
||||||
*/
|
*/
|
||||||
public static final String IMAGE_JPEG = "image/jpeg";
|
public static final String IMAGE_JPEG = "image/jpeg";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BMP 图片 MIME 类型。
|
* BMP 图片 MIME 类型
|
||||||
*/
|
*/
|
||||||
public static final String IMAGE_BMP = "image/bmp";
|
public static final String IMAGE_BMP = "image/bmp";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GIF 图片 MIME 类型。
|
* GIF 图片 MIME 类型
|
||||||
*/
|
*/
|
||||||
public static final String IMAGE_GIF = "image/gif";
|
public static final String IMAGE_GIF = "image/gif";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片扩展名集合。
|
* 图片扩展名数组
|
||||||
*/
|
*/
|
||||||
public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};
|
public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flash 扩展名集合。
|
* Flash 文件扩展名数组
|
||||||
*/
|
*/
|
||||||
public static final String[] FLASH_EXTENSION = {"swf", "flv"};
|
public static final String[] FLASH_EXTENSION = {"swf", "flv"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 媒体扩展名集合。
|
* 视频文件扩展名数组
|
||||||
*/
|
|
||||||
public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg",
|
|
||||||
"asf", "rm", "rmvb"};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 视频扩展名集合。
|
|
||||||
*/
|
*/
|
||||||
public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"};
|
public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认允许上传扩展名集合。
|
* 媒体文件扩展名数组(音频+视频+Flash)
|
||||||
|
*/
|
||||||
|
public static final String[] MEDIA_EXTENSION = {"swf", "flv", "mp3", "wav", "wma", "wmv", "mid", "avi", "mpg", "asf", "rm", "rmvb"};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认允许上传的文件扩展名数组
|
||||||
*/
|
*/
|
||||||
public static final String[] DEFAULT_ALLOWED_EXTENSION = {
|
public static final String[] DEFAULT_ALLOWED_EXTENSION = {
|
||||||
// 图片
|
// 图片
|
||||||
@@ -66,6 +70,47 @@ public class MimeTypeUtils {
|
|||||||
// 视频格式
|
// 视频格式
|
||||||
"mp4", "avi", "rmvb",
|
"mp4", "avi", "rmvb",
|
||||||
// pdf
|
// pdf
|
||||||
"pdf"};
|
"pdf"
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文件扩展名是否为图片格式(忽略大小写)
|
||||||
|
*
|
||||||
|
* @param extension 文件扩展名
|
||||||
|
* @return 是图片返回 true,否则返回 false
|
||||||
|
*/
|
||||||
|
public static boolean isImage(String extension) {
|
||||||
|
return StrUtil.equalsAnyIgnoreCase(extension, IMAGE_EXTENSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文件扩展名是否为视频格式(忽略大小写)
|
||||||
|
*
|
||||||
|
* @param extension 文件扩展名
|
||||||
|
* @return 是视频返回 true,否则返回 false
|
||||||
|
*/
|
||||||
|
public static boolean isVideo(String extension) {
|
||||||
|
return StrUtil.equalsAnyIgnoreCase(extension, VIDEO_EXTENSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文件扩展名是否为媒体格式(忽略大小写)
|
||||||
|
*
|
||||||
|
* @param extension 文件扩展名
|
||||||
|
* @return 是媒体返回 true,否则返回 false
|
||||||
|
*/
|
||||||
|
public static boolean isMedia(String extension) {
|
||||||
|
return StrUtil.equalsAnyIgnoreCase(extension, MEDIA_EXTENSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断文件扩展名是否在默认允许上传范围内(忽略大小写)
|
||||||
|
*
|
||||||
|
* @param extension 文件扩展名
|
||||||
|
* @return 允许返回 true,不允许返回 false
|
||||||
|
*/
|
||||||
|
public static boolean isDefaultAllowed(String extension) {
|
||||||
|
return StrUtil.equalsAnyIgnoreCase(extension, DEFAULT_ALLOWED_EXTENSION);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -1,6 +1,8 @@
|
|||||||
package org.dromara.common.core.utils.ip;
|
package org.dromara.common.core.utils.ip;
|
||||||
|
|
||||||
import cn.hutool.core.io.resource.ResourceUtil;
|
import cn.hutool.core.io.resource.ResourceUtil;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
@@ -19,6 +21,7 @@ import java.time.Duration;
|
|||||||
* @author 秋辞未寒
|
* @author 秋辞未寒
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class RegionUtils {
|
public class RegionUtils {
|
||||||
|
|
||||||
// 默认IPv4地址库文件路径
|
// 默认IPv4地址库文件路径
|
||||||
|
|||||||
+1
-1
@@ -1,9 +1,9 @@
|
|||||||
package org.dromara.common.core.utils.reflect;
|
package org.dromara.common.core.utils.reflect;
|
||||||
|
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
|||||||
+3
@@ -2,6 +2,8 @@ package org.dromara.common.core.utils.regex;
|
|||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.dromara.common.core.constant.RegexConstants;
|
import org.dromara.common.core.constant.RegexConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9,6 +11,7 @@ import org.dromara.common.core.constant.RegexConstants;
|
|||||||
*
|
*
|
||||||
* @author AprilWind
|
* @author AprilWind
|
||||||
*/
|
*/
|
||||||
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public final class RegexUtils extends ReUtil {
|
public final class RegexUtils extends ReUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
@@ -2,6 +2,8 @@ package org.dromara.common.core.utils.regex;
|
|||||||
|
|
||||||
import cn.hutool.core.exceptions.ValidateException;
|
import cn.hutool.core.exceptions.ValidateException;
|
||||||
import cn.hutool.core.lang.Validator;
|
import cn.hutool.core.lang.Validator;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.dromara.common.core.factory.RegexPatternPoolFactory;
|
import org.dromara.common.core.factory.RegexPatternPoolFactory;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -12,6 +14,7 @@ import java.util.regex.Pattern;
|
|||||||
*
|
*
|
||||||
* @author AprilWind
|
* @author AprilWind
|
||||||
*/
|
*/
|
||||||
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class RegexValidator extends Validator {
|
public class RegexValidator extends Validator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+4
-1
@@ -3,7 +3,10 @@ package org.dromara.common.core.validate.enums;
|
|||||||
import jakarta.validation.Constraint;
|
import jakarta.validation.Constraint;
|
||||||
import jakarta.validation.Payload;
|
import jakarta.validation.Payload;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.Documented;
|
||||||
|
import java.lang.annotation.Repeatable;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
import static java.lang.annotation.ElementType.*;
|
import static java.lang.annotation.ElementType.*;
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.dromara.common.core.xss;
|
|||||||
|
|
||||||
import jakarta.validation.Constraint;
|
import jakarta.validation.Constraint;
|
||||||
import jakarta.validation.Payload;
|
import jakarta.validation.Payload;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|||||||
+1
-1
@@ -6,9 +6,9 @@ import io.swagger.v3.oas.models.info.Info;
|
|||||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.doc.config.properties.SpringDocProperties;
|
||||||
import org.dromara.common.doc.core.customizer.ClassTagOperationCustomizer;
|
import org.dromara.common.doc.core.customizer.ClassTagOperationCustomizer;
|
||||||
import org.dromara.common.doc.core.customizer.JavadocOperationCustomizer;
|
import org.dromara.common.doc.core.customizer.JavadocOperationCustomizer;
|
||||||
import org.dromara.common.doc.config.properties.SpringDocProperties;
|
|
||||||
import org.dromara.common.doc.core.resolver.JavadocResolver;
|
import org.dromara.common.doc.core.resolver.JavadocResolver;
|
||||||
import org.dromara.common.doc.core.resolver.SaTokenAnnotationMetadataJavadocResolver;
|
import org.dromara.common.doc.core.resolver.SaTokenAnnotationMetadataJavadocResolver;
|
||||||
import org.springdoc.core.configuration.SpringDocConfiguration;
|
import org.springdoc.core.configuration.SpringDocConfiguration;
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ public class SpringDocProperties {
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @see io.swagger.v3.oas.models.info.Info
|
* @see io.swagger.v3.oas.models.info.Info
|
||||||
*
|
* <p>
|
||||||
* 为了 springboot 自动生产配置提示信息,所以这里复制一个类出来
|
* 为了 springboot 自动生产配置提示信息,所以这里复制一个类出来
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
+1
-7
@@ -18,13 +18,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
|
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|||||||
+11
@@ -82,6 +82,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行解析并返回解析到的 Javadoc 内容
|
* 执行解析并返回解析到的 Javadoc 内容
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param operation Swagger Operation实例
|
* @param operation Swagger Operation实例
|
||||||
* @param metadata 元信息
|
* @param metadata 元信息
|
||||||
@@ -91,6 +92,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查处理器方法所属的类上是否存在注解
|
* 检查处理器方法所属的类上是否存在注解
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationClass 注解类
|
* @param annotationClass 注解类
|
||||||
* @return 是否存在注解
|
* @return 是否存在注解
|
||||||
@@ -101,6 +103,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查处理器方法所属的类上是否存在注解
|
* 检查处理器方法所属的类上是否存在注解
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationTypeName 注解类名称
|
* @param annotationTypeName 注解类名称
|
||||||
* @return 是否存在注解
|
* @return 是否存在注解
|
||||||
@@ -111,6 +114,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查处理器方法上是否存在注解
|
* 检查处理器方法上是否存在注解
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationClass 注解类
|
* @param annotationClass 注解类
|
||||||
* @return 是否存在注解
|
* @return 是否存在注解
|
||||||
@@ -121,6 +125,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查处理器方法上是否存在注解
|
* 检查处理器方法上是否存在注解
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationTypeName 注解类名称
|
* @param annotationTypeName 注解类名称
|
||||||
* @return 是否存在注解
|
* @return 是否存在注解
|
||||||
@@ -131,6 +136,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查处理器方法上是否存在注解
|
* 检查处理器方法上是否存在注解
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationClass 注解类
|
* @param annotationClass 注解类
|
||||||
* @return 是否存在注解
|
* @return 是否存在注解
|
||||||
@@ -141,6 +147,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查处理器方法上是否存在注解
|
* 检查处理器方法上是否存在注解
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationTypeName 注解类名称
|
* @param annotationTypeName 注解类名称
|
||||||
* @return 是否存在注解
|
* @return 是否存在注解
|
||||||
@@ -151,6 +158,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取处理器方法所属类上的注解的值
|
* 获取处理器方法所属类上的注解的值
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationClass 注解类
|
* @param annotationClass 注解类
|
||||||
* @return 注解的值
|
* @return 注解的值
|
||||||
@@ -161,6 +169,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取处理器方法所属类上的注解的值
|
* 获取处理器方法所属类上的注解的值
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationClassName 注解类名称
|
* @param annotationClassName 注解类名称
|
||||||
* @return 注解的值
|
* @return 注解的值
|
||||||
@@ -173,6 +182,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取处理器方法上的注解的值
|
* 获取处理器方法上的注解的值
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationClass 注解类
|
* @param annotationClass 注解类
|
||||||
* @return 注解的值
|
* @return 注解的值
|
||||||
@@ -183,6 +193,7 @@ public abstract class AbstractMetadataJavadocResolver<M> implements JavadocResol
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取处理器方法所属类上的注解的值
|
* 获取处理器方法所属类上的注解的值
|
||||||
|
*
|
||||||
* @param handlerMethod 处理器方法
|
* @param handlerMethod 处理器方法
|
||||||
* @param annotationClassName 注解类名称
|
* @param annotationClassName 注解类名称
|
||||||
* @return 注解的值
|
* @return 注解的值
|
||||||
|
|||||||
+1
-1
@@ -1,8 +1,8 @@
|
|||||||
package org.dromara.common.encrypt.core;
|
package org.dromara.common.encrypt.core;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||||
import org.dromara.common.encrypt.enums.EncodeType;
|
import org.dromara.common.encrypt.enums.EncodeType;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密上下文 用于encryptor传递必要的参数。
|
* 加密上下文 用于encryptor传递必要的参数。
|
||||||
|
|||||||
+1
@@ -5,6 +5,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* api解密属性配置类
|
* api解密属性配置类
|
||||||
|
*
|
||||||
* @author wdhcr
|
* @author wdhcr
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
+1
-1
@@ -1,8 +1,8 @@
|
|||||||
package org.dromara.common.encrypt.properties;
|
package org.dromara.common.encrypt.properties;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||||
import org.dromara.common.encrypt.enums.EncodeType;
|
import org.dromara.common.encrypt.enums.EncodeType;
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import java.lang.annotation.*;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* excel 列单元格合并(合并列相同项)
|
* excel 列单元格合并(合并列相同项)
|
||||||
*
|
* <p>
|
||||||
* 需搭配 {@link CellMergeStrategy} 策略使用
|
* 需搭配 {@link CellMergeStrategy} 策略使用
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
|
|||||||
+1
@@ -7,6 +7,7 @@ import java.lang.annotation.Target;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批注 此注解仅用于单表头 不支持多层级表头
|
* 批注 此注解仅用于单表头 不支持多层级表头
|
||||||
|
*
|
||||||
* @author guzhouyanyu
|
* @author guzhouyanyu
|
||||||
*/
|
*/
|
||||||
@Target({ElementType.FIELD})
|
@Target({ElementType.FIELD})
|
||||||
|
|||||||
+1
@@ -9,6 +9,7 @@ import java.lang.annotation.Target;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否必填 此注解仅用于单表头 不支持多层级表头
|
* 是否必填 此注解仅用于单表头 不支持多层级表头
|
||||||
|
*
|
||||||
* @author guzhouyanyu
|
* @author guzhouyanyu
|
||||||
*/
|
*/
|
||||||
@Target({ElementType.FIELD})
|
@Target({ElementType.FIELD})
|
||||||
|
|||||||
+1
-1
@@ -3,6 +3,7 @@ package org.dromara.common.excel.convert;
|
|||||||
import cn.hutool.core.annotation.AnnotationUtil;
|
import cn.hutool.core.annotation.AnnotationUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.fesod.sheet.converters.Converter;
|
import org.apache.fesod.sheet.converters.Converter;
|
||||||
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
|
import org.apache.fesod.sheet.enums.CellDataTypeEnum;
|
||||||
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
|
import org.apache.fesod.sheet.metadata.GlobalConfiguration;
|
||||||
@@ -11,7 +12,6 @@ import org.apache.fesod.sheet.metadata.data.WriteCellData;
|
|||||||
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
|
import org.apache.fesod.sheet.metadata.property.ExcelContentProperty;
|
||||||
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
||||||
import org.dromara.common.excel.annotation.ExcelEnumFormat;
|
import org.dromara.common.excel.annotation.ExcelEnumFormat;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|||||||
+1
-1
@@ -3,10 +3,10 @@ package org.dromara.common.excel.core;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnore;
|
import org.apache.fesod.sheet.annotation.ExcelIgnore;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import lombok.SneakyThrows;
|
|
||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
import org.dromara.common.core.utils.reflect.ReflectUtils;
|
||||||
import org.dromara.common.excel.annotation.CellMerge;
|
import org.dromara.common.excel.annotation.CellMerge;
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,10 @@
|
|||||||
package org.dromara.common.excel.core;
|
package org.dromara.common.excel.core;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import jakarta.validation.ConstraintViolation;
|
||||||
|
import jakarta.validation.ConstraintViolationException;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.fesod.sheet.context.AnalysisContext;
|
import org.apache.fesod.sheet.context.AnalysisContext;
|
||||||
import org.apache.fesod.sheet.event.AnalysisEventListener;
|
import org.apache.fesod.sheet.event.AnalysisEventListener;
|
||||||
import org.apache.fesod.sheet.exception.ExcelAnalysisException;
|
import org.apache.fesod.sheet.exception.ExcelAnalysisException;
|
||||||
@@ -8,10 +12,6 @@ import org.apache.fesod.sheet.exception.ExcelDataConvertException;
|
|||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.ValidatorUtils;
|
import org.dromara.common.core.utils.ValidatorUtils;
|
||||||
import org.dromara.common.json.utils.JsonUtils;
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import jakarta.validation.ConstraintViolation;
|
|
||||||
import jakarta.validation.ConstraintViolationException;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|||||||
+5
@@ -25,23 +25,28 @@ import java.util.stream.Collectors;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public class DropDownOptions {
|
public class DropDownOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一级下拉所在列index,从0开始算
|
* 一级下拉所在列index,从0开始算
|
||||||
*/
|
*/
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 二级下拉所在的index,从0开始算,不能与一级相同
|
* 二级下拉所在的index,从0开始算,不能与一级相同
|
||||||
*/
|
*/
|
||||||
private int nextIndex = 0;
|
private int nextIndex = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一级下拉所包含的数据
|
* 一级下拉所包含的数据
|
||||||
*/
|
*/
|
||||||
private List<String> options = new ArrayList<>();
|
private List<String> options = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 二级下拉所包含的数据Map
|
* 二级下拉所包含的数据Map
|
||||||
* <p>以每一个一级选项值为Key,每个一级选项对应的二级数据为Value</p>
|
* <p>以每一个一级选项值为Key,每个一级选项对应的二级数据为Value</p>
|
||||||
*/
|
*/
|
||||||
private Map<String, List<String>> nextOptions = new HashMap<>();
|
private Map<String, List<String>> nextOptions = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分隔符
|
* 分隔符
|
||||||
*/
|
*/
|
||||||
|
|||||||
+2
-11
@@ -25,19 +25,10 @@ import org.apache.fesod.sheet.write.style.row.SimpleRowHeightStyleStrategy;
|
|||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.FileUtils;
|
import org.dromara.common.core.utils.file.FileUtils;
|
||||||
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
||||||
import org.dromara.common.excel.core.CellMergeStrategy;
|
import org.dromara.common.excel.core.*;
|
||||||
import org.dromara.common.excel.core.DefaultExcelListener;
|
|
||||||
import org.dromara.common.excel.core.DropDownOptions;
|
|
||||||
import org.dromara.common.excel.core.ExcelDownHandler;
|
|
||||||
import org.dromara.common.excel.core.ExcelListener;
|
|
||||||
import org.dromara.common.excel.core.ExcelResult;
|
|
||||||
import org.dromara.common.excel.handler.DataWriteHandler;
|
import org.dromara.common.excel.handler.DataWriteHandler;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.*;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
-6
@@ -125,8 +125,6 @@ public record ExcelWriterWrapper<T>(ExcelWriter excelWriter) {
|
|||||||
return new ExcelWriterWrapper<>(excelWriter);
|
return new ExcelWriterWrapper<>(excelWriter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------- sheet start
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建工作表。
|
* 创建工作表。
|
||||||
*
|
*
|
||||||
@@ -207,10 +205,6 @@ public record ExcelWriterWrapper<T>(ExcelWriter excelWriter) {
|
|||||||
return FesodSheet.writerSheet();
|
return FesodSheet.writerSheet();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------- sheet end
|
|
||||||
|
|
||||||
// -------------------------------- table start
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建表格。
|
* 创建表格。
|
||||||
*
|
*
|
||||||
|
|||||||
+4
-5
@@ -13,6 +13,10 @@ import tools.jackson.databind.ser.jdk.NumberSerializer;
|
|||||||
@JacksonStdImpl
|
@JacksonStdImpl
|
||||||
public class BigNumberSerializer extends NumberSerializer {
|
public class BigNumberSerializer extends NumberSerializer {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提供实例
|
||||||
|
*/
|
||||||
|
public static final BigNumberSerializer INSTANCE = new BigNumberSerializer(Number.class);
|
||||||
/**
|
/**
|
||||||
* 根据 JS Number.MAX_SAFE_INTEGER 与 Number.MIN_SAFE_INTEGER 得来
|
* 根据 JS Number.MAX_SAFE_INTEGER 与 Number.MIN_SAFE_INTEGER 得来
|
||||||
*/
|
*/
|
||||||
@@ -22,11 +26,6 @@ public class BigNumberSerializer extends NumberSerializer {
|
|||||||
*/
|
*/
|
||||||
private static final long MIN_SAFE_INTEGER = -9007199254740991L;
|
private static final long MIN_SAFE_INTEGER = -9007199254740991L;
|
||||||
|
|
||||||
/**
|
|
||||||
* 提供实例
|
|
||||||
*/
|
|
||||||
public static final BigNumberSerializer INSTANCE = new BigNumberSerializer(Number.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造大数字序列化器。
|
* 构造大数字序列化器。
|
||||||
*
|
*
|
||||||
|
|||||||
+1
-1
@@ -9,9 +9,9 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.time.StopWatch;
|
import org.apache.commons.lang3.time.StopWatch;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
import org.aspectj.lang.annotation.Around;
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
import org.dromara.common.core.utils.ServletUtils;
|
import org.dromara.common.core.utils.ServletUtils;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
package org.dromara.common.log.event;
|
package org.dromara.common.log.event;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|||||||
+3
-6
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.support.LambdaMeta;
|
import com.baomidou.mybatisplus.core.toolkit.support.LambdaMeta;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||||
|
import lombok.AccessLevel;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.ibatis.reflection.property.PropertyNamer;
|
import org.apache.ibatis.reflection.property.PropertyNamer;
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -14,6 +16,7 @@ import java.util.regex.Pattern;
|
|||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public final class AggregateSelectUtils {
|
public final class AggregateSelectUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,12 +24,6 @@ public final class AggregateSelectUtils {
|
|||||||
*/
|
*/
|
||||||
private static final Pattern ALIAS_PATTERN = Pattern.compile("[A-Za-z_][A-Za-z0-9_]*");
|
private static final Pattern ALIAS_PATTERN = Pattern.compile("[A-Za-z_][A-Za-z0-9_]*");
|
||||||
|
|
||||||
/**
|
|
||||||
* 工具类不允许实例化。
|
|
||||||
*/
|
|
||||||
private AggregateSelectUtils() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 追加查询字段 SQL。
|
* 追加查询字段 SQL。
|
||||||
*
|
*
|
||||||
|
|||||||
+2
-11
@@ -2,22 +2,13 @@ package org.dromara.common.mybatis.core.query;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
import com.baomidou.mybatisplus.core.toolkit.*;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.LambdaUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.support.ColumnCache;
|
import com.baomidou.mybatisplus.core.toolkit.support.ColumnCache;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.support.LambdaMeta;
|
import com.baomidou.mybatisplus.core.toolkit.support.LambdaMeta;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||||
import org.apache.ibatis.reflection.property.PropertyNamer;
|
import org.apache.ibatis.reflection.property.PropertyNamer;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -5,19 +5,20 @@ package org.dromara.common.oss.config;
|
|||||||
*
|
*
|
||||||
* @param <T> 配置类型
|
* @param <T> 配置类型
|
||||||
* @param <B> 配置构建器类型
|
* @param <B> 配置构建器类型
|
||||||
*
|
|
||||||
* @author 秋辞未寒
|
* @author 秋辞未寒
|
||||||
*/
|
*/
|
||||||
public interface Config<T, B> {
|
public interface Config<T, B> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置对象拷贝
|
* 配置对象拷贝
|
||||||
|
*
|
||||||
* @return 拷贝后的新配置对象
|
* @return 拷贝后的新配置对象
|
||||||
*/
|
*/
|
||||||
T copy();
|
T copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转为构建器对象
|
* 转为构建器对象
|
||||||
|
*
|
||||||
* @return 构建器对象
|
* @return 构建器对象
|
||||||
*/
|
*/
|
||||||
B toBuilder();
|
B toBuilder();
|
||||||
|
|||||||
+1
-5
@@ -3,11 +3,7 @@ package org.dromara.common.push.annotation;
|
|||||||
import org.dromara.common.push.condition.MessageTransportCondition;
|
import org.dromara.common.push.condition.MessageTransportCondition;
|
||||||
import org.springframework.context.annotation.Conditional;
|
import org.springframework.context.annotation.Conditional;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.*;
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按消息推送传输方式启用组件。
|
* 按消息推送传输方式启用组件。
|
||||||
|
|||||||
+1
-1
@@ -1,10 +1,10 @@
|
|||||||
package org.dromara.common.push.config;
|
package org.dromara.common.push.config;
|
||||||
|
|
||||||
import org.dromara.common.push.annotation.ConditionalOnMessageTransport;
|
import org.dromara.common.push.annotation.ConditionalOnMessageTransport;
|
||||||
import org.dromara.common.push.listener.MessageTopicListener;
|
|
||||||
import org.dromara.common.push.core.WebSocketSessionManager;
|
import org.dromara.common.push.core.WebSocketSessionManager;
|
||||||
import org.dromara.common.push.handler.PlusWebSocketHandler;
|
import org.dromara.common.push.handler.PlusWebSocketHandler;
|
||||||
import org.dromara.common.push.interceptor.PlusWebSocketInterceptor;
|
import org.dromara.common.push.interceptor.PlusWebSocketInterceptor;
|
||||||
|
import org.dromara.common.push.listener.MessageTopicListener;
|
||||||
import org.dromara.common.push.properties.MessageProperties;
|
import org.dromara.common.push.properties.MessageProperties;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|||||||
+3
-3
@@ -112,13 +112,13 @@ public class RateLimiterAspect {
|
|||||||
key = expression.getValue(context, String.class);
|
key = expression.getValue(context, String.class);
|
||||||
}
|
}
|
||||||
StringBuilder stringBuffer = new StringBuilder(GlobalConstants.RATE_LIMIT_KEY);
|
StringBuilder stringBuffer = new StringBuilder(GlobalConstants.RATE_LIMIT_KEY);
|
||||||
stringBuffer.append(ServletUtils.getRequest().getRequestURI()).append(":");
|
stringBuffer.append(ServletUtils.getRequest().getRequestURI()).append(StringUtils.COLON);
|
||||||
if (rateLimiter.limitType() == LimitType.IP) {
|
if (rateLimiter.limitType() == LimitType.IP) {
|
||||||
// 获取请求ip
|
// 获取请求ip
|
||||||
stringBuffer.append(ServletUtils.getClientIP()).append(":");
|
stringBuffer.append(ServletUtils.getClientIP()).append(StringUtils.COLON);
|
||||||
} else if (rateLimiter.limitType() == LimitType.CLUSTER) {
|
} else if (rateLimiter.limitType() == LimitType.CLUSTER) {
|
||||||
// 获取客户端实例id
|
// 获取客户端实例id
|
||||||
stringBuffer.append(RedisUtils.getClient().getId()).append(":");
|
stringBuffer.append(RedisUtils.getClient().getId()).append(StringUtils.COLON);
|
||||||
}
|
}
|
||||||
return stringBuffer.append(key).toString();
|
return stringBuffer.append(key).toString();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ public class RepeatSubmitAspect {
|
|||||||
// 唯一值(没有消息头则使用请求地址)
|
// 唯一值(没有消息头则使用请求地址)
|
||||||
String submitKey = StringUtils.trimToEmpty(request.getHeader(SaManager.getConfig().getTokenName()));
|
String submitKey = StringUtils.trimToEmpty(request.getHeader(SaManager.getConfig().getTokenName()));
|
||||||
|
|
||||||
submitKey = SecureUtil.md5(submitKey + ":" + nowParams);
|
submitKey = SecureUtil.md5(submitKey + StringUtils.COLON + nowParams);
|
||||||
// 唯一标识(指定key + url + 消息头)
|
// 唯一标识(指定key + url + 消息头)
|
||||||
String cacheRepeatKey = GlobalConstants.REPEAT_SUBMIT_KEY + url + submitKey;
|
String cacheRepeatKey = GlobalConstants.REPEAT_SUBMIT_KEY + url + submitKey;
|
||||||
if (RedisUtils.setObjectIfAbsent(cacheRepeatKey, "", Duration.ofMillis(interval))) {
|
if (RedisUtils.setObjectIfAbsent(cacheRepeatKey, "", Duration.ofMillis(interval))) {
|
||||||
|
|||||||
-1
@@ -24,7 +24,6 @@ import tools.jackson.databind.module.SimpleModule;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.List;
|
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ public class KeyPrefixHandler implements NameMapper {
|
|||||||
*/
|
*/
|
||||||
public KeyPrefixHandler(String keyPrefix) {
|
public KeyPrefixHandler(String keyPrefix) {
|
||||||
//前缀为空 则返回空前缀
|
//前缀为空 则返回空前缀
|
||||||
this.keyPrefix = StringUtils.isBlank(keyPrefix) ? "" : keyPrefix + ":";
|
this.keyPrefix = StringUtils.isBlank(keyPrefix) ? "" : keyPrefix + StringUtils.COLON;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-2
@@ -1,5 +1,6 @@
|
|||||||
package org.dromara.common.redis.manager;
|
package org.dromara.common.redis.manager;
|
||||||
|
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.springframework.cache.Cache;
|
import org.springframework.cache.Cache;
|
||||||
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
@@ -55,7 +56,7 @@ public class CaffeineCacheDecorator implements Cache {
|
|||||||
* @return 唯一键
|
* @return 唯一键
|
||||||
*/
|
*/
|
||||||
public String getUniqueKey(Object key) {
|
public String getUniqueKey(Object key) {
|
||||||
return name + ":" + key;
|
return name + StringUtils.COLON + key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -175,7 +176,7 @@ public class CaffeineCacheDecorator implements Cache {
|
|||||||
* 清理当前缓存命名空间下的本地一级缓存。
|
* 清理当前缓存命名空间下的本地一级缓存。
|
||||||
*/
|
*/
|
||||||
private void clearLocalCache() {
|
private void clearLocalCache() {
|
||||||
String prefix = name + ":";
|
String prefix = name + StringUtils.COLON;
|
||||||
caffeine.asMap().keySet().removeIf(key -> key instanceof String cacheKey && cacheKey.startsWith(prefix));
|
caffeine.asMap().keySet().removeIf(key -> key instanceof String cacheKey && cacheKey.startsWith(prefix));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -561,15 +561,16 @@ public class RedisUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得缓存的基本对象列表(全局匹配忽略租户 自行拼接租户id)
|
* 获得缓存的基本对象列表(全局匹配忽略租户 自行拼接租户id)
|
||||||
* <P>
|
* <p>
|
||||||
* limit-设置扫描的限制数量(默认为0,查询全部)
|
* limit-设置扫描的限制数量(默认为0,查询全部)
|
||||||
* pattern-设置键的匹配模式(默认为null)
|
* pattern-设置键的匹配模式(默认为null)
|
||||||
* chunkSize-设置每次扫描的块大小(默认为0,本方法设置为1000)
|
* chunkSize-设置每次扫描的块大小(默认为0,本方法设置为1000)
|
||||||
* type-设置键的类型(默认为null,查询全部类型)
|
* type-设置键的类型(默认为null,查询全部类型)
|
||||||
* </P>
|
* </P>
|
||||||
* @see KeysScanOptions
|
*
|
||||||
* @param pattern 字符串前缀
|
* @param pattern 字符串前缀
|
||||||
* @return 对象列表
|
* @return 对象列表
|
||||||
|
* @see KeysScanOptions
|
||||||
*/
|
*/
|
||||||
public static Collection<String> keys(final String pattern) {
|
public static Collection<String> keys(final String pattern) {
|
||||||
return keys(KeysScanOptions.defaults().pattern(pattern).chunkSize(1000));
|
return keys(KeysScanOptions.defaults().pattern(pattern).chunkSize(1000));
|
||||||
@@ -579,14 +580,14 @@ public class RedisUtils {
|
|||||||
* 通过扫描参数获取缓存的基本对象列表
|
* 通过扫描参数获取缓存的基本对象列表
|
||||||
*
|
*
|
||||||
* @param keysScanOptions 扫描参数
|
* @param keysScanOptions 扫描参数
|
||||||
* <P>
|
* <p>
|
||||||
* limit-设置扫描的限制数量(默认为0,查询全部)
|
* limit-设置扫描的限制数量(默认为0,查询全部)
|
||||||
* pattern-设置键的匹配模式(默认为null)
|
* pattern-设置键的匹配模式(默认为null)
|
||||||
* chunkSize-设置每次扫描的块大小(默认为0)
|
* chunkSize-设置每次扫描的块大小(默认为0)
|
||||||
* type-设置键的类型(默认为null,查询全部类型)
|
* type-设置键的类型(默认为null,查询全部类型)
|
||||||
* </P>
|
* </P>
|
||||||
* @see KeysScanOptions
|
|
||||||
* @return 对象列表
|
* @return 对象列表
|
||||||
|
* @see KeysScanOptions
|
||||||
*/
|
*/
|
||||||
public static Collection<String> keys(final KeysScanOptions keysScanOptions) {
|
public static Collection<String> keys(final KeysScanOptions keysScanOptions) {
|
||||||
Stream<String> keysStream = CLIENT.getKeys().getKeysStream(keysScanOptions);
|
Stream<String> keysStream = CLIENT.getKeys().getKeysStream(keysScanOptions);
|
||||||
|
|||||||
+2
-1
@@ -4,6 +4,7 @@ import cn.dev33.satoken.dao.auto.SaTokenDaoBySessionFollowObject;
|
|||||||
import cn.dev33.satoken.util.SaFoxUtil;
|
import cn.dev33.satoken.util.SaFoxUtil;
|
||||||
import com.github.benmanes.caffeine.cache.Cache;
|
import com.github.benmanes.caffeine.cache.Cache;
|
||||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
@@ -157,7 +158,7 @@ public class PlusSaTokenDao implements SaTokenDaoBySessionFollowObject {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> searchData(String prefix, String keyword, int start, int size, boolean sortType) {
|
public List<String> searchData(String prefix, String keyword, int start, int size, boolean sortType) {
|
||||||
String pattern = prefix + "*" + keyword + "*";
|
String pattern = prefix + "*" + keyword + "*";
|
||||||
String cacheKey = pattern + start + ":" + size + ":" + sortType;
|
String cacheKey = pattern + start + StringUtils.COLON + size + StringUtils.COLON + sortType;
|
||||||
return (List<String>) CAFFEINE.get(cacheKey, k -> {
|
return (List<String>) CAFFEINE.get(cacheKey, k -> {
|
||||||
Collection<String> keys = RedisUtils.keys(pattern);
|
Collection<String> keys = RedisUtils.keys(pattern);
|
||||||
List<String> list = new ArrayList<>(keys);
|
List<String> list = new ArrayList<>(keys);
|
||||||
|
|||||||
+1
-1
@@ -9,8 +9,8 @@ import org.dromara.common.core.utils.SpringUtils;
|
|||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.system.api.model.LoginUser;
|
import org.dromara.system.api.model.LoginUser;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,9 +1,9 @@
|
|||||||
package org.dromara.common.satoken.utils;
|
package org.dromara.common.satoken.utils;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.exception.NotLoginException;
|
||||||
import cn.dev33.satoken.session.SaSession;
|
import cn.dev33.satoken.session.SaSession;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
|
||||||
import cn.dev33.satoken.exception.NotLoginException;
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.http.useragent.UserAgent;
|
import cn.hutool.http.useragent.UserAgent;
|
||||||
|
|||||||
+1
-1
@@ -130,7 +130,7 @@ public class SecurityConfig implements WebMvcConfigurer {
|
|||||||
return new SaServletFilter()
|
return new SaServletFilter()
|
||||||
.addInclude("/actuator", "/actuator/**")
|
.addInclude("/actuator", "/actuator/**")
|
||||||
.setAuth(obj -> {
|
.setAuth(obj -> {
|
||||||
SaHttpBasicUtil.check(username + ":" + password);
|
SaHttpBasicUtil.check(username + StringUtils.COLON + password);
|
||||||
})
|
})
|
||||||
.setError(e -> {
|
.setError(e -> {
|
||||||
HttpServletResponse response = ServletUtils.getResponse();
|
HttpServletResponse response = ServletUtils.getResponse();
|
||||||
|
|||||||
+1
-1
@@ -1,8 +1,8 @@
|
|||||||
package org.dromara.common.security.handler;
|
package org.dromara.common.security.handler;
|
||||||
|
|
||||||
import cn.hutool.core.util.ReUtil;
|
import cn.hutool.core.util.ReUtil;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||||
|
|||||||
+1
-5
@@ -2,11 +2,7 @@ package org.dromara.common.sensitive.annotation;
|
|||||||
|
|
||||||
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.*;
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据脱敏注解
|
* 数据脱敏注解
|
||||||
|
|||||||
-1
@@ -124,7 +124,6 @@ public class AuthTopIamRequest extends AuthDefaultRequest {
|
|||||||
.add("Authorization", "Bearer " + authToken.getAccessToken()), false).getBody();
|
.add("Authorization", "Bearer " + authToken.getAccessToken()), false).getBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成 TopIAM 授权地址。
|
* 生成 TopIAM 授权地址。
|
||||||
*
|
*
|
||||||
|
|||||||
+6
-3
@@ -69,7 +69,8 @@ public class SocialUtils {
|
|||||||
case "coding" -> new AuthCodingRequest(builder.build(), STATE_CACHE);
|
case "coding" -> new AuthCodingRequest(builder.build(), STATE_CACHE);
|
||||||
case "oschina" -> new AuthOschinaRequest(builder.build(), STATE_CACHE);
|
case "oschina" -> new AuthOschinaRequest(builder.build(), STATE_CACHE);
|
||||||
// 支付宝在创建回调地址时,不允许使用localhost或者127.0.0.1,所以这儿的回调地址使用的局域网内的ip
|
// 支付宝在创建回调地址时,不允许使用localhost或者127.0.0.1,所以这儿的回调地址使用的局域网内的ip
|
||||||
case "alipay_wallet" -> new AuthAlipayRequest(builder.build(), socialProperties.getType().get("alipay_wallet").getAlipayPublicKey(), STATE_CACHE);
|
case "alipay_wallet" ->
|
||||||
|
new AuthAlipayRequest(builder.build(), socialProperties.getType().get("alipay_wallet").getAlipayPublicKey(), STATE_CACHE);
|
||||||
case "qq" -> new AuthQqRequest(builder.build(), STATE_CACHE);
|
case "qq" -> new AuthQqRequest(builder.build(), STATE_CACHE);
|
||||||
case "wechat_open" -> new AuthWeChatOpenRequest(builder.build(), STATE_CACHE);
|
case "wechat_open" -> new AuthWeChatOpenRequest(builder.build(), STATE_CACHE);
|
||||||
case "taobao" -> new AuthTaobaoRequest(builder.build(), STATE_CACHE);
|
case "taobao" -> new AuthTaobaoRequest(builder.build(), STATE_CACHE);
|
||||||
@@ -77,9 +78,11 @@ public class SocialUtils {
|
|||||||
case "linkedin" -> new AuthLinkedinRequest(builder.build(), STATE_CACHE);
|
case "linkedin" -> new AuthLinkedinRequest(builder.build(), STATE_CACHE);
|
||||||
case "microsoft" -> new AuthMicrosoftRequest(builder.tenantId(obj.getTenantId()).build(), STATE_CACHE);
|
case "microsoft" -> new AuthMicrosoftRequest(builder.tenantId(obj.getTenantId()).build(), STATE_CACHE);
|
||||||
case "renren" -> new AuthRenrenRequest(builder.build(), STATE_CACHE);
|
case "renren" -> new AuthRenrenRequest(builder.build(), STATE_CACHE);
|
||||||
case "stack_overflow" -> new AuthStackOverflowRequest(builder.stackOverflowKey(obj.getStackOverflowKey()).build(), STATE_CACHE);
|
case "stack_overflow" ->
|
||||||
|
new AuthStackOverflowRequest(builder.stackOverflowKey(obj.getStackOverflowKey()).build(), STATE_CACHE);
|
||||||
case "huawei" -> new AuthHuaweiV3Request(builder.build(), STATE_CACHE);
|
case "huawei" -> new AuthHuaweiV3Request(builder.build(), STATE_CACHE);
|
||||||
case "wechat_enterprise" -> new AuthWeChatEnterpriseQrcodeV2Request(builder.agentId(obj.getAgentId()).build(), STATE_CACHE);
|
case "wechat_enterprise" ->
|
||||||
|
new AuthWeChatEnterpriseQrcodeV2Request(builder.agentId(obj.getAgentId()).build(), STATE_CACHE);
|
||||||
case "gitlab" -> new AuthGitlabRequest(builder.build(), STATE_CACHE);
|
case "gitlab" -> new AuthGitlabRequest(builder.build(), STATE_CACHE);
|
||||||
case "wechat_mp" -> new AuthWeChatMpRequest(builder.build(), STATE_CACHE);
|
case "wechat_mp" -> new AuthWeChatMpRequest(builder.build(), STATE_CACHE);
|
||||||
case "aliyun" -> new AuthAliyunRequest(builder.build(), STATE_CACHE);
|
case "aliyun" -> new AuthAliyunRequest(builder.build(), STATE_CACHE);
|
||||||
|
|||||||
+1
-5
@@ -1,10 +1,6 @@
|
|||||||
package org.dromara.common.translation.annotation;
|
package org.dromara.common.translation.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.*;
|
||||||
import java.lang.annotation.ElementType;
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.RetentionPolicy;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用翻译注解
|
* 通用翻译注解
|
||||||
|
|||||||
+2
-8
@@ -7,13 +7,7 @@ import org.dromara.common.translation.annotation.TranslationType;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,8 +82,8 @@ public interface TranslationInterface<T> {
|
|||||||
*
|
*
|
||||||
* @param ids 原始 ID 字符串
|
* @param ids 原始 ID 字符串
|
||||||
* @param mapper ID 到值的映射函数
|
* @param mapper ID 到值的映射函数
|
||||||
* @return 拼接后的结果字符串
|
|
||||||
* @param <E> 值类型
|
* @param <E> 值类型
|
||||||
|
* @return 拼接后的结果字符串
|
||||||
*/
|
*/
|
||||||
default <E> String joinMappedValues(String ids, Function<Long, E> mapper) {
|
default <E> String joinMappedValues(String ids, Function<Long, E> mapper) {
|
||||||
return StreamUtils.join(parseLongIds(ids), id -> {
|
return StreamUtils.join(parseLongIds(ids), id -> {
|
||||||
|
|||||||
+1
-6
@@ -12,12 +12,7 @@ import org.dromara.common.translation.annotation.TranslationType;
|
|||||||
import org.dromara.common.translation.core.TranslationInterface;
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 翻译响应处理器。
|
* 翻译响应处理器。
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
package org.dromara.common.web.core;
|
package org.dromara.common.web.core;
|
||||||
|
|
||||||
import org.springframework.web.servlet.LocaleResolver;
|
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.web.servlet.LocaleResolver;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
package org.dromara.common.web.filter;
|
package org.dromara.common.web.filter;
|
||||||
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
|
|
||||||
import jakarta.servlet.*;
|
import jakarta.servlet.*;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-2
@@ -1,13 +1,12 @@
|
|||||||
package org.dromara.common.web.filter;
|
package org.dromara.common.web.filter;
|
||||||
|
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import org.dromara.common.core.constant.Constants;
|
|
||||||
|
|
||||||
import jakarta.servlet.ReadListener;
|
import jakarta.servlet.ReadListener;
|
||||||
import jakarta.servlet.ServletInputStream;
|
import jakarta.servlet.ServletInputStream;
|
||||||
import jakarta.servlet.ServletResponse;
|
import jakarta.servlet.ServletResponse;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
import jakarta.servlet.http.HttpServletRequestWrapper;
|
||||||
|
import org.dromara.common.core.constant.Constants;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|||||||
+3
-3
@@ -1,13 +1,13 @@
|
|||||||
package org.dromara.common.web.filter;
|
package org.dromara.common.web.filter;
|
||||||
|
|
||||||
|
import jakarta.servlet.*;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.web.config.properties.XssProperties;
|
import org.dromara.common.web.config.properties.XssProperties;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
import jakarta.servlet.*;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
+1
-6
@@ -1,11 +1,6 @@
|
|||||||
package com.aizuda.snail.ai.starter.filter;
|
package com.aizuda.snail.ai.starter.filter;
|
||||||
|
|
||||||
import jakarta.servlet.Filter;
|
import jakarta.servlet.*;
|
||||||
import jakarta.servlet.FilterChain;
|
|
||||||
import jakarta.servlet.FilterConfig;
|
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.ServletRequest;
|
|
||||||
import jakarta.servlet.ServletResponse;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ server:
|
|||||||
context-path: /snail-ai
|
context-path: /snail-ai
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
|
application:
|
||||||
|
name: ruoyi-snailai-server
|
||||||
|
profiles:
|
||||||
|
active: @profiles.active@
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -14,8 +18,7 @@ spring:
|
|||||||
web:
|
web:
|
||||||
resources:
|
resources:
|
||||||
static-locations: classpath:admin/
|
static-locations: classpath:admin/
|
||||||
profiles:
|
|
||||||
active: @profiles.active@
|
|
||||||
snail-ai:
|
snail-ai:
|
||||||
server:
|
server:
|
||||||
grpc-port: 18888
|
grpc-port: 18888
|
||||||
|
|||||||
+1
-1
@@ -1,8 +1,8 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
+10
-10
@@ -1,36 +1,36 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.PageResult;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.ValidatorUtils;
|
import org.dromara.common.core.utils.ValidatorUtils;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.validate.QueryGroup;
|
import org.dromara.common.core.validate.QueryGroup;
|
||||||
import org.dromara.common.web.core.BaseController;
|
|
||||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.core.domain.PageResult;
|
|
||||||
import org.dromara.common.excel.core.ExcelResult;
|
import org.dromara.common.excel.core.ExcelResult;
|
||||||
import org.dromara.common.excel.utils.ExcelBuilder;
|
import org.dromara.common.excel.utils.ExcelBuilder;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import org.dromara.demo.domain.bo.TestDemoBo;
|
import org.dromara.demo.domain.bo.TestDemoBo;
|
||||||
import org.dromara.demo.domain.vo.TestDemoImportVo;
|
import org.dromara.demo.domain.vo.TestDemoImportVo;
|
||||||
import org.dromara.demo.domain.vo.TestDemoVo;
|
import org.dromara.demo.domain.vo.TestDemoVo;
|
||||||
import org.dromara.demo.service.ITestDemoService;
|
import org.dromara.demo.service.ITestDemoService;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import java.util.Arrays;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-4
@@ -1,17 +1,16 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.MessageUtils;
|
import org.dromara.common.core.utils.MessageUtils;
|
||||||
import lombok.Data;
|
|
||||||
import org.hibernate.validator.constraints.Range;
|
import org.hibernate.validator.constraints.Range;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试国际化
|
* 测试国际化
|
||||||
|
|||||||
+4
-4
@@ -1,11 +1,11 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import org.dromara.common.core.domain.R;
|
|
||||||
import org.dromara.common.web.core.BaseController;
|
|
||||||
import org.dromara.common.sensitive.annotation.Sensitive;
|
|
||||||
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.sensitive.annotation.Sensitive;
|
||||||
import org.dromara.common.sensitive.core.SensitiveService;
|
import org.dromara.common.sensitive.core.SensitiveService;
|
||||||
|
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
+6
-6
@@ -1,25 +1,25 @@
|
|||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.validate.QueryGroup;
|
import org.dromara.common.core.validate.QueryGroup;
|
||||||
import org.dromara.common.web.core.BaseController;
|
|
||||||
import org.dromara.common.excel.utils.ExcelBuilder;
|
import org.dromara.common.excel.utils.ExcelBuilder;
|
||||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.demo.domain.bo.TestTreeBo;
|
import org.dromara.demo.domain.bo.TestTreeBo;
|
||||||
import org.dromara.demo.domain.vo.TestTreeVo;
|
import org.dromara.demo.domain.vo.TestTreeVo;
|
||||||
import org.dromara.demo.service.ITestTreeService;
|
import org.dromara.demo.service.ITestTreeService;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.controller.queue;
|
package org.dromara.demo.controller.queue;
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import org.dromara.common.core.domain.R;
|
|
||||||
import org.dromara.common.redis.utils.QueueUtils;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.redis.utils.QueueUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.domain;
|
package org.dromara.demo.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import org.dromara.common.encrypt.annotation.EncryptField;
|
|
||||||
import org.dromara.common.encrypt.enums.AlgorithmType;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.encrypt.annotation.EncryptField;
|
||||||
|
import org.dromara.common.encrypt.enums.AlgorithmType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试加密字段实体。
|
* 测试加密字段实体。
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package org.dromara.demo.domain.vo;
|
package org.dromara.demo.domain.vo;
|
||||||
|
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import org.dromara.common.core.enums.UserStatus;
|
import org.dromara.common.core.enums.UserStatus;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
|||||||
+2
-3
@@ -1,11 +1,10 @@
|
|||||||
package org.dromara.demo.domain.vo;
|
package org.dromara.demo.domain.vo;
|
||||||
|
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package org.dromara.demo.domain.vo;
|
package org.dromara.demo.domain.vo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import org.apache.fesod.sheet.annotation.format.DateTimeFormat;
|
import org.apache.fesod.sheet.annotation.format.DateTimeFormat;
|
||||||
@@ -8,8 +10,6 @@ import org.dromara.common.excel.annotation.ExcelRequired;
|
|||||||
import org.dromara.common.translation.annotation.Translation;
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.domain.vo;
|
package org.dromara.demo.domain.vo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
import org.apache.fesod.sheet.annotation.ExcelIgnoreUnannotated;
|
||||||
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
import org.apache.fesod.sheet.annotation.ExcelProperty;
|
||||||
import org.dromara.demo.domain.TestTree;
|
import org.dromara.demo.domain.TestTree;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package org.dromara.demo.service;
|
package org.dromara.demo.service;
|
||||||
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import org.dromara.demo.domain.bo.TestDemoBo;
|
import org.dromara.demo.domain.bo.TestDemoBo;
|
||||||
import org.dromara.demo.domain.vo.TestDemoVo;
|
import org.dromara.demo.domain.vo.TestDemoVo;
|
||||||
|
|||||||
+1
-1
@@ -1,10 +1,10 @@
|
|||||||
package org.dromara.demo.service.impl;
|
package org.dromara.demo.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import org.apache.fesod.sheet.write.metadata.WriteSheet;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.fesod.sheet.write.metadata.WriteSheet;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
import org.dromara.common.core.constant.SystemConstants;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
|||||||
+1
-1
@@ -39,13 +39,13 @@ public class TestTreeServiceImpl implements ITestTreeService {
|
|||||||
return treeMapper.selectVoById(id);
|
return treeMapper.selectVoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @DS("slave") // 切换从库查询
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的测试树表列表。
|
* 查询符合条件的测试树表列表。
|
||||||
*
|
*
|
||||||
* @param bo 查询条件
|
* @param bo 查询条件
|
||||||
* @return 结果列表
|
* @return 结果列表
|
||||||
*/
|
*/
|
||||||
|
// @DS("slave") // 切换从库查询
|
||||||
@Override
|
@Override
|
||||||
public List<TestTreeVo> queryList(TestTreeBo bo) {
|
public List<TestTreeVo> queryList(TestTreeBo bo) {
|
||||||
LambdaQueryWrapper<TestTree> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<TestTree> lqw = buildQueryWrapper(bo);
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import cn.hutool.core.io.IoUtil;
|
|||||||
import com.baomidou.lock.annotation.Lock4j;
|
import com.baomidou.lock.annotation.Lock4j;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.PageResult;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.redis.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
|
||||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||||
|
import org.dromara.common.redis.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.gen.domain.GenTable;
|
import org.dromara.gen.domain.GenTable;
|
||||||
import org.dromara.gen.domain.GenTableColumn;
|
import org.dromara.gen.domain.GenTableColumn;
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package org.dromara.gen.domain;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
|
||||||
import org.dromara.gen.constant.GenConstants;
|
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.gen.constant.GenConstants;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ public interface GenTableMapper extends BaseMapperPlus<GenTable, GenTable> {
|
|||||||
*
|
*
|
||||||
* @param dataName 数据源名称,用于选择不同的数据源
|
* @param dataName 数据源名称,用于选择不同的数据源
|
||||||
* @return 当前数据库中的表名列表
|
* @return 当前数据库中的表名列表
|
||||||
*
|
|
||||||
* @DS("") 使用默认数据源执行查询操作
|
* @DS("") 使用默认数据源执行查询操作
|
||||||
*/
|
*/
|
||||||
@DS("")
|
@DS("")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.dromara.gen.service;
|
package org.dromara.gen.service;
|
||||||
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.gen.domain.GenTable;
|
import org.dromara.gen.domain.GenTable;
|
||||||
import org.dromara.gen.domain.GenTableColumn;
|
import org.dromara.gen.domain.GenTableColumn;
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -62,6 +62,7 @@ public class CacheController {
|
|||||||
* @param dbSize 数据库
|
* @param dbSize 数据库
|
||||||
* @param commandStats 命令统计
|
* @param commandStats 命令统计
|
||||||
*/
|
*/
|
||||||
public record CacheListInfoVo(Properties info, Long dbSize, List<Map<String, String>> commandStats) {}
|
public record CacheListInfoVo(Properties info, Long dbSize, List<Map<String, String>> commandStats) {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ public class SysUserOnlineController extends BaseController {
|
|||||||
// 获取所有未过期的 token
|
// 获取所有未过期的 token
|
||||||
Collection<String> keys = RedisUtils.keys(CacheNames.ONLINE_TOKEN_KEY + "*");
|
Collection<String> keys = RedisUtils.keys(CacheNames.ONLINE_TOKEN_KEY + "*");
|
||||||
List<Supplier<UserOnlineDTO>> suppliers = keys.stream().map(key -> (Supplier<UserOnlineDTO>) () -> {
|
List<Supplier<UserOnlineDTO>> suppliers = keys.stream().map(key -> (Supplier<UserOnlineDTO>) () -> {
|
||||||
String token = StringUtils.substringAfterLast(key, ":");
|
String token = StringUtils.substringAfterLast(key, StringUtils.COLON);
|
||||||
// 如果已经过期则跳过
|
// 如果已经过期则跳过
|
||||||
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
+2
-43
@@ -1,14 +1,11 @@
|
|||||||
package org.dromara.system.controller.system;
|
package org.dromara.system.controller.system;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.crypto.digest.BCrypt;
|
import cn.hutool.crypto.digest.BCrypt;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.MimeTypeUtils;
|
|
||||||
import org.dromara.common.encrypt.annotation.ApiEncrypt;
|
import org.dromara.common.encrypt.annotation.ApiEncrypt;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
@@ -19,16 +16,10 @@ import org.dromara.common.web.core.BaseController;
|
|||||||
import org.dromara.system.domain.bo.SysUserBo;
|
import org.dromara.system.domain.bo.SysUserBo;
|
||||||
import org.dromara.system.domain.bo.SysUserProfileBo;
|
import org.dromara.system.domain.bo.SysUserProfileBo;
|
||||||
import org.dromara.system.domain.vo.ProfileUserVo;
|
import org.dromara.system.domain.vo.ProfileUserVo;
|
||||||
import org.dromara.system.domain.vo.SysOssVo;
|
|
||||||
import org.dromara.system.domain.vo.SysUserVo;
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
import org.dromara.system.service.ISysOssService;
|
|
||||||
import org.dromara.system.service.ISysUserService;
|
import org.dromara.system.service.ISysUserService;
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人信息 业务处理
|
* 个人信息 业务处理
|
||||||
@@ -42,7 +33,6 @@ import java.util.Arrays;
|
|||||||
public class SysProfileController extends BaseController {
|
public class SysProfileController extends BaseController {
|
||||||
|
|
||||||
private final ISysUserService userService;
|
private final ISysUserService userService;
|
||||||
private final ISysOssService ossService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录用户的个人中心信息。
|
* 获取当前登录用户的个人中心信息。
|
||||||
@@ -112,38 +102,6 @@ public class SysProfileController extends BaseController {
|
|||||||
return R.fail("修改密码异常,请联系管理员");
|
return R.fail("修改密码异常,请联系管理员");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 头像上传
|
|
||||||
*
|
|
||||||
* @param avatarfile 用户头像
|
|
||||||
* @return 头像上传结果
|
|
||||||
*/
|
|
||||||
@RepeatSubmit
|
|
||||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping(value = "/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
|
||||||
public R<AvatarVo> avatar(@RequestPart("avatarfile") MultipartFile avatarfile) {
|
|
||||||
if (ObjectUtil.isNotNull(avatarfile) && !avatarfile.isEmpty()) {
|
|
||||||
String extension = FileUtil.extName(avatarfile.getOriginalFilename());
|
|
||||||
if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION)) {
|
|
||||||
return R.fail("文件格式不正确,请上传" + Arrays.toString(MimeTypeUtils.IMAGE_EXTENSION) + "格式");
|
|
||||||
}
|
|
||||||
SysOssVo oss = ossService.upload(avatarfile);
|
|
||||||
String avatar = oss.getUrl();
|
|
||||||
boolean updateSuccess = DataPermissionHelper.ignore(() -> userService.updateUserAvatar(LoginHelper.getUserId(), oss.getOssId()));
|
|
||||||
if (updateSuccess) {
|
|
||||||
return R.ok(new AvatarVo(avatar));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return R.fail("上传图片异常,请联系管理员");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户头像信息
|
|
||||||
*
|
|
||||||
* @param imgUrl 头像地址
|
|
||||||
*/
|
|
||||||
public record AvatarVo(String imgUrl) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户个人信息
|
* 用户个人信息
|
||||||
*
|
*
|
||||||
@@ -151,7 +109,8 @@ public class SysProfileController extends BaseController {
|
|||||||
* @param roleGroup 用户所属角色组
|
* @param roleGroup 用户所属角色组
|
||||||
* @param postGroup 用户所属岗位组
|
* @param postGroup 用户所属岗位组
|
||||||
*/
|
*/
|
||||||
public record ProfileVo(ProfileUserVo user, String roleGroup, String postGroup) {}
|
public record ProfileVo(ProfileUserVo user, String roleGroup, String postGroup) {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户密码修改
|
* 用户密码修改
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import org.dromara.common.core.constant.SystemConstants;
|
|||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -24,6 +25,8 @@ import java.util.List;
|
|||||||
@TableName("sys_menu")
|
@TableName("sys_menu")
|
||||||
public class SysMenu extends BaseEntity {
|
public class SysMenu extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 6967394714839655267L;
|
||||||
/**
|
/**
|
||||||
* 菜单ID
|
* 菜单ID
|
||||||
*/
|
*/
|
||||||
@@ -195,7 +198,7 @@ public class SysMenu extends BaseEntity {
|
|||||||
* 内链域名特殊字符替换
|
* 内链域名特殊字符替换
|
||||||
*/
|
*/
|
||||||
public static String innerLinkReplaceEach(String path) {
|
public static String innerLinkReplaceEach(String path) {
|
||||||
return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":"},
|
return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", StringUtils.COLON},
|
||||||
new String[]{"", "", "", "/", "/"});
|
new String[]{"", "", "", "/", "/"});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ public class SysUserBo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String gender;
|
private String gender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像 OSS ID
|
||||||
|
*/
|
||||||
|
private Long avatar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码
|
* 密码
|
||||||
*/
|
*/
|
||||||
|
|||||||
+5
@@ -53,4 +53,9 @@ public class SysUserProfileBo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String gender;
|
private String gender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像 OSS ID
|
||||||
|
*/
|
||||||
|
private Long avatar;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -10,8 +10,8 @@ import org.dromara.system.domain.SysDept;
|
|||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
-1
@@ -13,7 +13,6 @@ import java.io.Serializable;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统访问记录视图对象 sys_login_info
|
* 系统访问记录视图对象 sys_login_info
|
||||||
*
|
*
|
||||||
|
|||||||
+1
-1
@@ -6,8 +6,8 @@ import org.dromara.system.domain.SysMenu;
|
|||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import java.io.Serializable;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知公告视图对象 sys_notice
|
* 通知公告视图对象 sys_notice
|
||||||
*
|
*
|
||||||
|
|||||||
-9
@@ -188,15 +188,6 @@ public interface ISysUserService {
|
|||||||
*/
|
*/
|
||||||
int updateUserProfile(SysUserBo user);
|
int updateUserProfile(SysUserBo user);
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户头像
|
|
||||||
*
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @param avatar 头像地址
|
|
||||||
* @return 是否修改成功
|
|
||||||
*/
|
|
||||||
boolean updateUserAvatar(Long userId, Long avatar);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
*
|
*
|
||||||
|
|||||||
+8
-9
@@ -14,8 +14,8 @@ import org.dromara.common.core.utils.ServletUtils;
|
|||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.ip.AddressUtils;
|
import org.dromara.common.core.utils.ip.AddressUtils;
|
||||||
import org.dromara.common.log.event.LoginInfoEvent;
|
import org.dromara.common.log.event.LoginInfoEvent;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.mybatis.core.mapper.LambdaCrudChainWrapper;
|
import org.dromara.common.mybatis.core.mapper.LambdaCrudChainWrapper;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.system.domain.SysLoginInfo;
|
import org.dromara.system.domain.SysLoginInfo;
|
||||||
import org.dromara.system.domain.bo.SysLoginInfoBo;
|
import org.dromara.system.domain.bo.SysLoginInfoBo;
|
||||||
@@ -66,14 +66,13 @@ public class SysLoginInfoServiceImpl implements ISysLoginInfoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String address = AddressUtils.getRealAddressByIP(ip);
|
String address = AddressUtils.getRealAddressByIP(ip);
|
||||||
StringBuilder s = new StringBuilder();
|
String s = getBlock(ip) +
|
||||||
s.append(getBlock(ip));
|
address +
|
||||||
s.append(address);
|
getBlock(loginInfoEvent.getUsername()) +
|
||||||
s.append(getBlock(loginInfoEvent.getUsername()));
|
getBlock(loginInfoEvent.getStatus()) +
|
||||||
s.append(getBlock(loginInfoEvent.getStatus()));
|
getBlock(loginInfoEvent.getMessage());
|
||||||
s.append(getBlock(loginInfoEvent.getMessage()));
|
|
||||||
// 打印信息到日志
|
// 打印信息到日志
|
||||||
log.info(s.toString(), loginInfoEvent.getArgs());
|
log.info(s, loginInfoEvent.getArgs());
|
||||||
// 获取客户端操作系统
|
// 获取客户端操作系统
|
||||||
String os = userAgent.getOs().getName();
|
String os = userAgent.getOs().getName();
|
||||||
// 获取客户端浏览器
|
// 获取客户端浏览器
|
||||||
@@ -110,7 +109,7 @@ public class SysLoginInfoServiceImpl implements ISysLoginInfoService {
|
|||||||
if (msg == null) {
|
if (msg == null) {
|
||||||
msg = "";
|
msg = "";
|
||||||
}
|
}
|
||||||
return "[" + msg.toString() + "]";
|
return "[" + msg + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-5
@@ -11,11 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.domain.PageResult;
|
import org.dromara.common.core.domain.PageResult;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.*;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.core.utils.ThreadUtils;
|
|
||||||
import org.dromara.common.core.utils.file.FileUtils;
|
import org.dromara.common.core.utils.file.FileUtils;
|
||||||
import org.dromara.common.json.utils.JsonUtils;
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|||||||
+2
-3
@@ -365,7 +365,6 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增角色菜单信息
|
* 新增角色菜单信息
|
||||||
*
|
*
|
||||||
@@ -546,7 +545,7 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
|||||||
}
|
}
|
||||||
// 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作
|
// 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作
|
||||||
keys.parallelStream().forEach(key -> {
|
keys.parallelStream().forEach(key -> {
|
||||||
String token = StringUtils.substringAfterLast(key, ":");
|
String token = StringUtils.substringAfterLast(key, StringUtils.COLON);
|
||||||
// 如果已经过期则跳过
|
// 如果已经过期则跳过
|
||||||
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
||||||
return;
|
return;
|
||||||
@@ -582,7 +581,7 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService {
|
|||||||
}
|
}
|
||||||
// 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作
|
// 角色关联的在线用户量过大会导致redis阻塞卡顿 谨慎操作
|
||||||
keys.parallelStream().forEach(key -> {
|
keys.parallelStream().forEach(key -> {
|
||||||
String token = StringUtils.substringAfterLast(key, ":");
|
String token = StringUtils.substringAfterLast(key, StringUtils.COLON);
|
||||||
// 如果已经过期则跳过
|
// 如果已经过期则跳过
|
||||||
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
if (StpUtil.stpLogic.getTokenActiveTimeoutByToken(token) < -1) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
+4
-18
@@ -386,28 +386,14 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
|||||||
public int updateUserProfile(SysUserBo user) {
|
public int updateUserProfile(SysUserBo user) {
|
||||||
return userMapper.lambda()
|
return userMapper.lambda()
|
||||||
.setIfPresent(SysUser::getNickName, user.getNickName())
|
.setIfPresent(SysUser::getNickName, user.getNickName())
|
||||||
.set(SysUser::getPhoneNumber, user.getPhoneNumber())
|
.setIfPresent(SysUser::getAvatar, user.getAvatar())
|
||||||
.set(SysUser::getEmail, user.getEmail())
|
.setIfPresent(SysUser::getPhoneNumber, user.getPhoneNumber())
|
||||||
.set(SysUser::getGender, user.getGender())
|
.setIfPresent(SysUser::getEmail, user.getEmail())
|
||||||
|
.setIfPresent(SysUser::getGender, user.getGender())
|
||||||
.eq(SysUser::getUserId, user.getUserId())
|
.eq(SysUser::getUserId, user.getUserId())
|
||||||
.updateCount();
|
.updateCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户头像
|
|
||||||
*
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @param avatar 头像地址
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean updateUserAvatar(Long userId, Long avatar) {
|
|
||||||
return userMapper.lambda()
|
|
||||||
.set(SysUser::getAvatar, avatar)
|
|
||||||
.eq(SysUser::getUserId, userId)
|
|
||||||
.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
*
|
*
|
||||||
|
|||||||
-1
@@ -102,7 +102,6 @@ public enum TaskAssigneeEnum {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
/**
|
/**
|
||||||
* 获取所有办理人类型的代码列表,通常用于程序内部逻辑判断。
|
* 获取所有办理人类型的代码列表,通常用于程序内部逻辑判断。
|
||||||
*
|
*
|
||||||
|
|||||||
+8
-10
@@ -77,21 +77,19 @@ public enum TaskStatusEnum {
|
|||||||
*/
|
*/
|
||||||
TIMEOUT("timeout", "超时");
|
TIMEOUT("timeout", "超时");
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*/
|
|
||||||
private final String status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态描述。
|
|
||||||
*/
|
|
||||||
private final String desc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态编码与描述缓存。
|
* 状态编码与描述缓存。
|
||||||
*/
|
*/
|
||||||
private static final Map<String, String> STATUS_DESC_MAP = Arrays.stream(values())
|
private static final Map<String, String> STATUS_DESC_MAP = Arrays.stream(values())
|
||||||
.collect(Collectors.toConcurrentMap(TaskStatusEnum::getStatus, TaskStatusEnum::getDesc));
|
.collect(Collectors.toConcurrentMap(TaskStatusEnum::getStatus, TaskStatusEnum::getDesc));
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private final String status;
|
||||||
|
/**
|
||||||
|
* 状态描述。
|
||||||
|
*/
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据状态编码获取任务业务状态描述。
|
* 根据状态编码获取任务业务状态描述。
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ public class FlwSpelController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
/**
|
* /**
|
||||||
* 新增流程 SpEL 表达式定义。
|
* 新增流程 SpEL 表达式定义。
|
||||||
*
|
*
|
||||||
* @param bo 表达式信息
|
* @param bo 表达式信息
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user