sort;
+ }
+}
diff --git a/eladmin-system/src/main/java/me/zhengjie/config/WebSocketConfig.java b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/WebSocketConfig.java
similarity index 93%
rename from eladmin-system/src/main/java/me/zhengjie/config/WebSocketConfig.java
rename to eladmin-common/src/main/java/me/zhengjie/config/webConfig/WebSocketConfig.java
index f55f5c60..4751bb1c 100644
--- a/eladmin-system/src/main/java/me/zhengjie/config/WebSocketConfig.java
+++ b/eladmin-common/src/main/java/me/zhengjie/config/webConfig/WebSocketConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.config;
+package me.zhengjie.config.webConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/eladmin-common/src/main/java/me/zhengjie/exception/BadConfigurationException.java b/eladmin-common/src/main/java/me/zhengjie/exception/BadConfigurationException.java
deleted file mode 100644
index ede3691f..00000000
--- a/eladmin-common/src/main/java/me/zhengjie/exception/BadConfigurationException.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2019-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package me.zhengjie.exception;
-
-/**
- * 统一关于错误配置信息 异常
- *
- * @author: liaojinlong
- * @date: 2020/6/10 18:06
- */
-public class BadConfigurationException extends RuntimeException {
- /**
- * Constructs a new runtime exception with {@code null} as its
- * detail message. The cause is not initialized, and may subsequently be
- * initialized by a call to {@link #initCause}.
- */
- public BadConfigurationException() {
- super();
- }
-
- /**
- * Constructs a new runtime exception with the specified detail message.
- * The cause is not initialized, and may subsequently be initialized by a
- * call to {@link #initCause}.
- *
- * @param message the detail message. The detail message is saved for
- * later retrieval by the {@link #getMessage()} method.
- */
- public BadConfigurationException(String message) {
- super(message);
- }
-
- /**
- * Constructs a new runtime exception with the specified detail message and
- * cause. Note that the detail message associated with
- * {@code cause} is not automatically incorporated in
- * this runtime exception's detail message.
- *
- * @param message the detail message (which is saved for later retrieval
- * by the {@link #getMessage()} method).
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A {@code null} value is
- * permitted, and indicates that the cause is nonexistent or
- * unknown.)
- * @since 1.4
- */
- public BadConfigurationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructs a new runtime exception with the specified cause and a
- * detail message of {@code (cause==null ? null : cause.toString())}
- * (which typically contains the class and detail message of
- * {@code cause}). This constructor is useful for runtime exceptions
- * that are little more than wrappers for other throwables.
- *
- * @param cause the cause (which is saved for later retrieval by the
- * {@link #getCause()} method). (A {@code null} value is
- * permitted, and indicates that the cause is nonexistent or
- * unknown.)
- * @since 1.4
- */
- public BadConfigurationException(Throwable cause) {
- super(cause);
- }
-
- /**
- * Constructs a new runtime exception with the specified detail
- * message, cause, suppression enabled or disabled, and writable
- * stack trace enabled or disabled.
- *
- * @param message the detail message.
- * @param cause the cause. (A {@code null} value is permitted,
- * and indicates that the cause is nonexistent or unknown.)
- * @param enableSuppression whether or not suppression is enabled
- * or disabled
- * @param writableStackTrace whether or not the stack trace should
- * be writable
- * @since 1.7
- */
- protected BadConfigurationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
- super(message, cause, enableSuppression, writableStackTrace);
- }
-}
diff --git a/eladmin-common/src/main/java/me/zhengjie/exception/BadRequestException.java b/eladmin-common/src/main/java/me/zhengjie/exception/BadRequestException.java
index 900453bd..1d6297b9 100644
--- a/eladmin-common/src/main/java/me/zhengjie/exception/BadRequestException.java
+++ b/eladmin-common/src/main/java/me/zhengjie/exception/BadRequestException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/exception/EntityExistException.java b/eladmin-common/src/main/java/me/zhengjie/exception/EntityExistException.java
index 03f9bf2a..32d0e38f 100644
--- a/eladmin-common/src/main/java/me/zhengjie/exception/EntityExistException.java
+++ b/eladmin-common/src/main/java/me/zhengjie/exception/EntityExistException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java b/eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java
index bcdc9562..4d9f4d96 100644
--- a/eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java
+++ b/eladmin-common/src/main/java/me/zhengjie/exception/EntityNotFoundException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/exception/handler/ApiError.java b/eladmin-common/src/main/java/me/zhengjie/exception/handler/ApiError.java
index 977788c7..aa377c4f 100644
--- a/eladmin-common/src/main/java/me/zhengjie/exception/handler/ApiError.java
+++ b/eladmin-common/src/main/java/me/zhengjie/exception/handler/ApiError.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import lombok.Data;
* @date 2018-11-23
*/
@Data
-class ApiError {
+public class ApiError {
private Integer status = 400;
private Long timestamp;
diff --git a/eladmin-common/src/main/java/me/zhengjie/exception/handler/GlobalExceptionHandler.java b/eladmin-common/src/main/java/me/zhengjie/exception/handler/GlobalExceptionHandler.java
index 23cbb383..4e4e7165 100644
--- a/eladmin-common/src/main/java/me/zhengjie/exception/handler/GlobalExceptionHandler.java
+++ b/eladmin-common/src/main/java/me/zhengjie/exception/handler/GlobalExceptionHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/AnonTagUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/AnonTagUtils.java
new file mode 100644
index 00000000..9a2832de
--- /dev/null
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/AnonTagUtils.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2019-2020 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package me.zhengjie.utils;
+
+import me.zhengjie.annotation.rest.AnonymousAccess;
+import me.zhengjie.utils.enums.RequestMethodEnum;
+import org.springframework.context.ApplicationContext;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
+import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
+
+import java.util.*;
+
+/**
+ * @author Zheng Jie
+ * @description 匿名标记工具
+ * @date 2025-01-13
+ **/
+public class AnonTagUtils {
+
+ /**
+ * 获取匿名标记的URL
+ * @param applicationContext /
+ * @return /
+ */
+ public static Map> getAnonymousUrl(ApplicationContext applicationContext){
+ RequestMappingHandlerMapping requestMappingHandlerMapping = (RequestMappingHandlerMapping) applicationContext.getBean("requestMappingHandlerMapping");
+ Map handlerMethodMap = requestMappingHandlerMapping.getHandlerMethods();
+ Map> anonymousUrls = new HashMap<>(8);
+ // 获取匿名标记
+ Set get = new HashSet<>();
+ Set post = new HashSet<>();
+ Set put = new HashSet<>();
+ Set patch = new HashSet<>();
+ Set delete = new HashSet<>();
+ Set all = new HashSet<>();
+ for (Map.Entry infoEntry : handlerMethodMap.entrySet()) {
+ HandlerMethod handlerMethod = infoEntry.getValue();
+ AnonymousAccess anonymousAccess = handlerMethod.getMethodAnnotation(AnonymousAccess.class);
+ if (null != anonymousAccess) {
+ List requestMethods = new ArrayList<>(infoEntry.getKey().getMethodsCondition().getMethods());
+ RequestMethodEnum request = RequestMethodEnum.find(requestMethods.isEmpty() ? RequestMethodEnum.ALL.getType() : requestMethods.get(0).name());
+ if (infoEntry.getKey().getPatternsCondition()!=null) {
+ switch (Objects.requireNonNull(request)) {
+ case GET:
+ get.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
+ break;
+ case POST:
+ post.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
+ break;
+ case PUT:
+ put.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
+ break;
+ case PATCH:
+ patch.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
+ break;
+ case DELETE:
+ delete.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
+ break;
+ default:
+ all.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
+ break;
+ }
+ }
+ }
+ }
+ anonymousUrls.put(RequestMethodEnum.GET.getType(), get);
+ anonymousUrls.put(RequestMethodEnum.POST.getType(), post);
+ anonymousUrls.put(RequestMethodEnum.PUT.getType(), put);
+ anonymousUrls.put(RequestMethodEnum.PATCH.getType(), patch);
+ anonymousUrls.put(RequestMethodEnum.DELETE.getType(), delete);
+ anonymousUrls.put(RequestMethodEnum.ALL.getType(), all);
+ return anonymousUrls;
+ }
+
+ /**
+ * 获取所有匿名标记的URL
+ * @param applicationContext /
+ * @return /
+ */
+ public static Set getAllAnonymousUrl(ApplicationContext applicationContext){
+ Set allUrl = new HashSet<>();
+ Map> anonymousUrls = getAnonymousUrl(applicationContext);
+ for (String key : anonymousUrls.keySet()) {
+ allUrl.addAll(anonymousUrls.get(key));
+ }
+ return allUrl;
+ }
+}
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/BigDecimalUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/BigDecimalUtils.java
new file mode 100644
index 00000000..ff3d81fa
--- /dev/null
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/BigDecimalUtils.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2019-2020 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package me.zhengjie.utils;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
+/**
+ * @author Zheng Jie
+ * @description 计算类
+ * @date 2024-12-27
+ **/
+public class BigDecimalUtils {
+
+ /**
+ * 将对象转换为 BigDecimal
+ * @param obj 输入对象
+ * @return 转换后的 BigDecimal
+ */
+ private static BigDecimal toBigDecimal(Object obj) {
+ if (obj instanceof BigDecimal) {
+ return (BigDecimal) obj;
+ } else if (obj instanceof Long) {
+ return BigDecimal.valueOf((Long) obj);
+ } else if (obj instanceof Integer) {
+ return BigDecimal.valueOf((Integer) obj);
+ } else if (obj instanceof Double) {
+ return new BigDecimal(String.valueOf(obj));
+ } else {
+ throw new IllegalArgumentException("Unsupported type");
+ }
+ }
+
+ /**
+ * 加法
+ * @param a 加数
+ * @param b 加数
+ * @return 两个加数的和,保留两位小数
+ */
+ public static BigDecimal add(Object a, Object b) {
+ BigDecimal bdA = toBigDecimal(a);
+ BigDecimal bdB = toBigDecimal(b);
+ return bdA.add(bdB).setScale(2, RoundingMode.HALF_UP);
+ }
+
+ /**
+ * 减法
+ * @param a 被减数
+ * @param b 减数
+ * @return 两数的差,保留两位小数
+ */
+ public static BigDecimal subtract(Object a, Object b) {
+ BigDecimal bdA = toBigDecimal(a);
+ BigDecimal bdB = toBigDecimal(b);
+ return bdA.subtract(bdB).setScale(2, RoundingMode.HALF_UP);
+ }
+
+ /**
+ * 乘法
+ * @param a 乘数
+ * @param b 乘数
+ * @return 两个乘数的积,保留两位小数
+ */
+ public static BigDecimal multiply(Object a, Object b) {
+ BigDecimal bdA = toBigDecimal(a);
+ BigDecimal bdB = toBigDecimal(b);
+ return bdA.multiply(bdB).setScale(2, RoundingMode.HALF_UP);
+ }
+
+ /**
+ * 除法
+ * @param a 被除数
+ * @param b 除数
+ * @return 两数的商,保留两位小数
+ */
+ public static BigDecimal divide(Object a, Object b) {
+ BigDecimal bdA = toBigDecimal(a);
+ BigDecimal bdB = toBigDecimal(b);
+ return bdA.divide(bdB, 2, RoundingMode.HALF_UP);
+ }
+
+ /**
+ * 除法
+ * @param a 被除数
+ * @param b 除数
+ * @param scale 保留小数位数
+ * @return 两数的商,保留两位小数
+ */
+ public static BigDecimal divide(Object a, Object b, int scale) {
+ BigDecimal bdA = toBigDecimal(a);
+ BigDecimal bdB = toBigDecimal(b);
+ return bdA.divide(bdB, scale, RoundingMode.HALF_UP);
+ }
+
+ /**
+ * 分转元
+ * @param obj 分的金额
+ * @return 转换后的元,保留两位小数
+ */
+ public static BigDecimal centsToYuan(Object obj) {
+ BigDecimal cents = toBigDecimal(obj);
+ return cents.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP);
+ }
+
+ /**
+ * 元转分
+ * @param obj 元的金额
+ * @return 转换后的分
+ */
+ public static Long yuanToCents(Object obj) {
+ BigDecimal yuan = toBigDecimal(obj);
+ return yuan.multiply(BigDecimal.valueOf(100)).setScale(0, RoundingMode.HALF_UP).longValue();
+ }
+
+ public static void main(String[] args) {
+ BigDecimal num1 = new BigDecimal("10.123");
+ BigDecimal num2 = new BigDecimal("2.456");
+
+ System.out.println("加法结果: " + add(num1, num2));
+ System.out.println("减法结果: " + subtract(num1, num2));
+ System.out.println("乘法结果: " + multiply(num1, num2));
+ System.out.println("除法结果: " + divide(num1, num2));
+
+ Long cents = 12345L;
+ System.out.println("分转元结果: " + centsToYuan(cents));
+
+ BigDecimal yuan = new BigDecimal("123.45");
+ System.out.println("元转分结果: " + yuanToCents(yuan));
+ }
+}
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/CallBack.java b/eladmin-common/src/main/java/me/zhengjie/utils/CallBack.java
deleted file mode 100644
index 9b108127..00000000
--- a/eladmin-common/src/main/java/me/zhengjie/utils/CallBack.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2019-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package me.zhengjie.utils;
-
-/**
- * @author: liaojinlong
- * @date: 2020/6/9 17:02
- * @since: 1.0
- * @see {@link SpringContextHolder}
- * 针对某些初始化方法,在SpringContextHolder 初始化前时,
- * 可提交一个 提交回调任务。
- * 在SpringContextHolder 初始化后,进行回调使用
- */
-
-public interface CallBack {
- /**
- * 回调执行方法
- */
- void executor();
-
- /**
- * 本回调任务名称
- * @return /
- */
- default String getCallBackName() {
- return Thread.currentThread().getId() + ":" + this.getClass().getName();
- }
-}
-
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/CloseUtil.java b/eladmin-common/src/main/java/me/zhengjie/utils/CloseUtil.java
index f39919f2..b095ec63 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/CloseUtil.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/CloseUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/ElConstant.java b/eladmin-common/src/main/java/me/zhengjie/utils/ElConstant.java
index 479b1e69..fa58845e 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/ElConstant.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/ElConstant.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/EncryptUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/EncryptUtils.java
index 191fdbbe..83bf918f 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/EncryptUtils.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/EncryptUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java b/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
index f0043115..a5f313cb 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,16 +19,17 @@ import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.poi.excel.BigExcelWriter;
import cn.hutool.poi.excel.ExcelUtil;
+import lombok.extern.slf4j.Slf4j;
import me.zhengjie.exception.BadRequestException;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.streaming.SXSSFSheet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
+
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
+import java.nio.file.Files;
import java.security.MessageDigest;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
@@ -44,10 +45,9 @@ import java.util.stream.Collectors;
* @author Zheng Jie
* @date 2018-12-27
*/
+@Slf4j
public class FileUtil extends cn.hutool.core.io.FileUtil {
- private static final Logger log = LoggerFactory.getLogger(FileUtil.class);
-
/**
* 系统临时目录
*
@@ -110,7 +110,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
* 获取文件扩展名,不带 .
*/
public static String getExtensionName(String filename) {
- if ((filename != null) && (filename.length() > 0)) {
+ if ((filename != null) && (!filename.isEmpty())) {
int dot = filename.lastIndexOf('.');
if ((dot > -1) && (dot < (filename.length() - 1))) {
return filename.substring(dot + 1);
@@ -123,9 +123,9 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
* Java文件操作 获取不带扩展名的文件名
*/
public static String getFileNameNoEx(String filename) {
- if ((filename != null) && (filename.length() > 0)) {
+ if ((filename != null) && (!filename.isEmpty())) {
int dot = filename.lastIndexOf('.');
- if ((dot > -1) && (dot < (filename.length()))) {
+ if (dot > -1) {
return filename.substring(0, dot);
}
}
@@ -162,7 +162,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
}
OutputStream os = null;
try {
- os = new FileOutputStream(file);
+ os = Files.newOutputStream(file.toPath());
int bytesRead;
int len = 8192;
byte[] buffer = new byte[len];
@@ -170,7 +170,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
os.write(buffer, 0, bytesRead);
}
} catch (Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
CloseUtil.close(os);
CloseUtil.close(ins);
@@ -301,7 +301,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
byte[] b = new byte[(int) file.length()];
InputStream in = null;
try {
- in = new FileInputStream(file);
+ in = Files.newInputStream(file.toPath());
try {
System.out.println(in.read(b));
} catch (IOException e) {
@@ -407,7 +407,6 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
return fileName;
}
-
public static String getMd5(File file) {
return getMd5(getByte(file));
}
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/PageResult.java b/eladmin-common/src/main/java/me/zhengjie/utils/PageResult.java
index 0f1fdfe2..f6019cd8 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/PageResult.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/PageResult.java
@@ -1,16 +1,24 @@
package me.zhengjie.utils;
-import lombok.AccessLevel;
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import java.io.Serializable;
import java.util.List;
-@Getter
-@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
-public class PageResult {
+/**
+ * 分页结果封装类
+ * @author Zheng Jie
+ * @date 2018-11-23
+ * @param
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class PageResult implements Serializable {
- private final List content;
+ private List content;
- private final long totalElements;
+ private long totalElements;
}
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/PageUtil.java b/eladmin-common/src/main/java/me/zhengjie/utils/PageUtil.java
index 56020d98..cbb99e54 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/PageUtil.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/PageUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java b/eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java
index 587ece98..cbb8b65f 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/RedisUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/RedisUtils.java
index 65d02789..21480065 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/RedisUtils.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/RedisUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.utils;
+import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.slf4j.Logger;
@@ -24,14 +25,16 @@ import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.stereotype.Component;
+
import java.util.*;
import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
/**
* @author /
*/
@Component
-@SuppressWarnings({"unchecked", "all"})
+@SuppressWarnings({"all"})
public class RedisUtils {
private static final Logger log = LoggerFactory.getLogger(RedisUtils.class);
@@ -39,9 +42,8 @@ public class RedisUtils {
public RedisUtils(RedisTemplate redisTemplate) {
this.redisTemplate = redisTemplate;
- this.redisTemplate.setHashKeySerializer(new StringRedisSerializer());
this.redisTemplate.setKeySerializer(new StringRedisSerializer());
- this.redisTemplate.setStringSerializer(new StringRedisSerializer());
+ this.redisTemplate.setHashKeySerializer(new StringRedisSerializer());
}
/**
@@ -221,6 +223,65 @@ public class RedisUtils {
return key == null ? null : redisTemplate.opsForValue().get(key);
}
+ /**
+ * 普通缓存获取
+ *
+ * @param key 键
+ * @return 值
+ */
+ public T get(String key, Class clazz) {
+ Object value = key == null ? null : redisTemplate.opsForValue().get(key);
+ if (value == null) {
+ return null;
+ }
+ if (clazz.isInstance(value)) {
+ return clazz.cast(value);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * 普通缓存获取
+ *
+ * @param key 键
+ * @param clazz 列表中元素的类型
+ * @return 值
+ */
+ public List getList(String key, Class clazz) {
+ Object value = key == null ? null : redisTemplate.opsForValue().get(key);
+ if (value == null) {
+ return null;
+ }
+ if (value instanceof List>) {
+ List> list = (List>) value;
+ // 检查每个元素是否为指定类型
+ if (list.stream().allMatch(clazz::isInstance)) {
+ return list.stream().map(clazz::cast).collect(Collectors.toList());
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * 普通缓存获取
+ *
+ * @param key 键
+ * @return 值
+ */
+ public String getStr(String key) {
+ if(StrUtil.isBlank(key)){
+ return null;
+ }
+ Object value = redisTemplate.opsForValue().get(key);
+ if (value == null) {
+ return null;
+ } else {
+ return String.valueOf(value);
+ }
+ }
+
/**
* 批量获取
*
@@ -242,13 +303,17 @@ public class RedisUtils {
* @return true成功 false失败
*/
public boolean set(String key, Object value) {
- try {
- redisTemplate.opsForValue().set(key, value);
- return true;
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- return false;
+ int attempt = 0;
+ while (attempt < 3) {
+ try {
+ redisTemplate.opsForValue().set(key, value);
+ return true;
+ } catch (Exception e) {
+ attempt++;
+ log.error("Attempt {} failed: {}", attempt, e.getMessage(), e);
+ }
}
+ return false;
}
/**
@@ -716,10 +781,25 @@ public class RedisUtils {
keys.addAll(redisTemplate.keys(new StringBuffer(prefix).append(id).toString()));
}
long count = redisTemplate.delete(keys);
- // 此处提示可自行删除
- log.debug("--------------------------------------------");
- log.debug("成功删除缓存:" + keys.toString());
- log.debug("缓存删除数量:" + count + "个");
- log.debug("--------------------------------------------");
+ }
+
+ // ============================incr=============================
+
+ /**
+ * 递增
+ * @param key
+ * @return
+ */
+ public Long increment(String key) {
+ return redisTemplate.opsForValue().increment(key);
+ }
+
+ /**
+ * 递减
+ * @param key
+ * @return
+ */
+ public Long decrement(String key) {
+ return redisTemplate.opsForValue().decrement(key);
}
}
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/RequestHolder.java b/eladmin-common/src/main/java/me/zhengjie/utils/RequestHolder.java
index 71a4b9e5..8d90ac48 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/RequestHolder.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/RequestHolder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java
index 28e4672c..fb98424a 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/SecurityUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,18 +15,24 @@
*/
package me.zhengjie.utils;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.jwt.JWT;
+import cn.hutool.jwt.JWTUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
-import me.zhengjie.exception.BadRequestException;
import me.zhengjie.utils.enums.DataScopeEnum;
-import org.springframework.http.HttpStatus;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
import java.util.List;
+import java.util.Objects;
/**
* 获取当前登录的用户
@@ -34,45 +40,32 @@ import java.util.List;
* @date 2019-01-17
*/
@Slf4j
+@Component
public class SecurityUtils {
+ public static String header;
+
+ public static String tokenStartWith;
+
+ @Value("${jwt.header}")
+ public void setHeader(String header) {
+ SecurityUtils.header = header;
+ }
+
+ @Value("${jwt.token-start-with}")
+ public void setTokenStartWith(String tokenStartWith) {
+ SecurityUtils.tokenStartWith = tokenStartWith;
+ }
+
/**
* 获取当前登录的用户
* @return UserDetails
*/
public static UserDetails getCurrentUser() {
- UserDetailsService userDetailsService = SpringContextHolder.getBean(UserDetailsService.class);
+ UserDetailsService userDetailsService = SpringBeanHolder.getBean(UserDetailsService.class);
return userDetailsService.loadUserByUsername(getCurrentUsername());
}
- /**
- * 获取系统用户名称
- *
- * @return 系统用户名称
- */
- public static String getCurrentUsername() {
- final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
- if (authentication == null) {
- throw new BadRequestException(HttpStatus.UNAUTHORIZED, "当前登录状态过期");
- }
- if (authentication.getPrincipal() instanceof UserDetails) {
- UserDetails userDetails = (UserDetails) authentication.getPrincipal();
- return userDetails.getUsername();
- }
- throw new BadRequestException(HttpStatus.UNAUTHORIZED, "找不到当前登录的信息");
- }
-
- /**
- * 获取系统用户ID
- * @return 系统用户ID
- */
- public static Long getCurrentUserId() {
- UserDetails userDetails = getCurrentUser();
- // 将 Java 对象转换为 JSONObject 对象
- JSONObject jsonObject = (JSONObject) JSON.toJSON(userDetails);
- return jsonObject.getJSONObject("user").getLong("id");
- }
-
/**
* 获取当前用户的数据权限
* @return /
@@ -91,9 +84,62 @@ public class SecurityUtils {
*/
public static String getDataScopeType() {
List dataScopes = getCurrentUserDataScope();
- if(dataScopes.size() != 0){
+ if(CollUtil.isEmpty(dataScopes)){
return "";
}
return DataScopeEnum.ALL.getValue();
}
+
+ /**
+ * 获取用户ID
+ * @return 系统用户ID
+ */
+ public static Long getCurrentUserId() {
+ return getCurrentUserId(getToken());
+ }
+
+ /**
+ * 获取用户ID
+ * @return 系统用户ID
+ */
+ public static Long getCurrentUserId(String token) {
+ JWT jwt = JWTUtil.parseToken(token);
+ return Long.valueOf(jwt.getPayload("userId").toString());
+ }
+
+ /**
+ * 获取系统用户名称
+ *
+ * @return 系统用户名称
+ */
+ public static String getCurrentUsername() {
+ return getCurrentUsername(getToken());
+ }
+
+ /**
+ * 获取系统用户名称
+ *
+ * @return 系统用户名称
+ */
+ public static String getCurrentUsername(String token) {
+ JWT jwt = JWTUtil.parseToken(token);
+ return jwt.getPayload("sub").toString();
+ }
+
+ /**
+ * 获取Token
+ * @return /
+ */
+ public static String getToken() {
+ HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder
+ .getRequestAttributes())).getRequest();
+ String bearerToken = request.getHeader(header);
+ if (bearerToken != null && bearerToken.startsWith(tokenStartWith)) {
+ // 去掉令牌前缀
+ return bearerToken.replace(tokenStartWith, "");
+ } else {
+ log.debug("非法Token:{}", bearerToken);
+ }
+ return null;
+ }
}
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java b/eladmin-common/src/main/java/me/zhengjie/utils/SpringBeanHolder.java
similarity index 80%
rename from eladmin-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java
rename to eladmin-common/src/main/java/me/zhengjie/utils/SpringBeanHolder.java
index 41ead386..ca9cdfc0 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/SpringContextHolder.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/SpringBeanHolder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,10 +31,11 @@ import java.util.List;
* @date 2019-01-07
*/
@Slf4j
-public class SpringContextHolder implements ApplicationContextAware, DisposableBean {
+@SuppressWarnings("all")
+public class SpringBeanHolder implements ApplicationContextAware, DisposableBean {
private static ApplicationContext applicationContext = null;
- private static final List CALL_BACKS = new ArrayList<>();
+ private static final List CALL_BACKS = new ArrayList<>();
private static boolean addCallback = true;
/**
@@ -43,9 +44,9 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB
*
* @param callBack 回调函数
*/
- public synchronized static void addCallBacks(CallBack callBack) {
+ public synchronized static void addCallBacks(SpringBeanHolder.CallBack callBack) {
if (addCallback) {
- SpringContextHolder.CALL_BACKS.add(callBack);
+ SpringBeanHolder.CALL_BACKS.add(callBack);
} else {
log.warn("CallBack:{} 已无法添加!立即执行", callBack.getCallBackName());
callBack.executor();
@@ -55,7 +56,6 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB
/**
* 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型.
*/
- @SuppressWarnings("unchecked")
public static T getBean(String name) {
assertContextInjected();
return (T) applicationContext.getBean(name);
@@ -127,22 +127,22 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB
@Override
public void destroy() {
- SpringContextHolder.clearHolder();
+ SpringBeanHolder.clearHolder();
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
- if (SpringContextHolder.applicationContext != null) {
- log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext);
+ if (SpringBeanHolder.applicationContext != null) {
+ log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringBeanHolder.applicationContext);
}
- SpringContextHolder.applicationContext = applicationContext;
+ SpringBeanHolder.applicationContext = applicationContext;
if (addCallback) {
- for (CallBack callBack : SpringContextHolder.CALL_BACKS) {
+ for (SpringBeanHolder.CallBack callBack : SpringBeanHolder.CALL_BACKS) {
callBack.executor();
}
CALL_BACKS.clear();
}
- SpringContextHolder.addCallback = false;
+ SpringBeanHolder.addCallback = false;
}
/**
@@ -153,4 +153,20 @@ public class SpringContextHolder implements ApplicationContextAware, DisposableB
return new ArrayList<>(Arrays.asList(applicationContext
.getBeanNamesForAnnotation(Service.class)));
}
+
+ interface CallBack {
+
+ /**
+ * 回调执行方法
+ */
+ void executor();
+
+ /**
+ * 本回调任务名称
+ * @return /
+ */
+ default String getCallBackName() {
+ return Thread.currentThread().getId() + ":" + this.getClass().getName();
+ }
+ }
}
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java b/eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java
index a27a47a9..6c189376 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/StringUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
/**
* 注入bean
*/
- private final static Ip2regionSearcher IP_SEARCHER = SpringContextHolder.getBean(Ip2regionSearcher.class);
+ private final static Ip2regionSearcher IP_SEARCHER = SpringBeanHolder.getBean(Ip2regionSearcher.class);
/**
* 驼峰命名法工具
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/ThrowableUtil.java b/eladmin-common/src/main/java/me/zhengjie/utils/ThrowableUtil.java
index 075a65c5..59f1d98f 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/ThrowableUtil.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/ThrowableUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/ValidationUtil.java b/eladmin-common/src/main/java/me/zhengjie/utils/ValidationUtil.java
index e561762b..2e82d6c4 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/ValidationUtil.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/ValidationUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeBiEnum.java b/eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeBiEnum.java
index 944bc71c..2c6fbb6b 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeBiEnum.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeBiEnum.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeEnum.java b/eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeEnum.java
index 916862a6..3993993f 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeEnum.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/enums/CodeEnum.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/enums/DataScopeEnum.java b/eladmin-common/src/main/java/me/zhengjie/utils/enums/DataScopeEnum.java
index 465eef65..08e41f66 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/enums/DataScopeEnum.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/enums/DataScopeEnum.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-common/src/main/java/me/zhengjie/utils/enums/RequestMethodEnum.java b/eladmin-common/src/main/java/me/zhengjie/utils/enums/RequestMethodEnum.java
index 7de5146c..5d944835 100644
--- a/eladmin-common/src/main/java/me/zhengjie/utils/enums/RequestMethodEnum.java
+++ b/eladmin-common/src/main/java/me/zhengjie/utils/enums/RequestMethodEnum.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java b/eladmin-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java
index fdb962a4..fddc1993 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import java.io.Serializable;
@Setter
@Entity
@NoArgsConstructor
-@Table(name = "code_column_config")
+@Table(name = "code_column")
public class ColumnInfo implements Serializable {
@Id
diff --git a/eladmin-generator/src/main/java/me/zhengjie/domain/GenConfig.java b/eladmin-generator/src/main/java/me/zhengjie/domain/GenConfig.java
index a2d67063..47e87d31 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/domain/GenConfig.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/domain/GenConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import java.io.Serializable;
@Setter
@Entity
@NoArgsConstructor
-@Table(name = "code_gen_config")
+@Table(name = "code_config")
public class GenConfig implements Serializable {
public GenConfig(String tableName) {
diff --git a/eladmin-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java b/eladmin-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java
index 1d3967b5..c900a654 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
*/
package me.zhengjie.domain.vo;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -29,20 +31,19 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class TableInfo {
- /** 表名称 */
+ @ApiModelProperty(value = "表名称")
private Object tableName;
- /** 创建日期 */
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
+ @ApiModelProperty(value = "创建日期:yyyy-MM-dd HH:mm:ss")
private Object createTime;
- /** 数据库引擎 */
+ @ApiModelProperty(value = "数据库引擎")
private Object engine;
- /** 编码集 */
+ @ApiModelProperty(value = "编码集")
private Object coding;
- /** 备注 */
+ @ApiModelProperty(value = "备注")
private Object remark;
-
-
}
diff --git a/eladmin-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java b/eladmin-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java
index 4638be26..7a174d2d 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java b/eladmin-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java
index 18c9a0c8..1513c810 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/java/me/zhengjie/rest/GenConfigController.java b/eladmin-generator/src/main/java/me/zhengjie/rest/GenConfigController.java
index d4cbec91..85a2a4bb 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/rest/GenConfigController.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/rest/GenConfigController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/java/me/zhengjie/rest/GeneratorController.java b/eladmin-generator/src/main/java/me/zhengjie/rest/GeneratorController.java
index 4a1f1e4e..68148b94 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/rest/GeneratorController.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/rest/GeneratorController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/java/me/zhengjie/service/GenConfigService.java b/eladmin-generator/src/main/java/me/zhengjie/service/GenConfigService.java
index b5711f48..175439ab 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/service/GenConfigService.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/service/GenConfigService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/java/me/zhengjie/service/GeneratorService.java b/eladmin-generator/src/main/java/me/zhengjie/service/GeneratorService.java
index b9c2a2f5..6e59160a 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/service/GeneratorService.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/service/GeneratorService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@ import me.zhengjie.domain.ColumnInfo;
import me.zhengjie.domain.vo.TableInfo;
import me.zhengjie.utils.PageResult;
import org.springframework.http.ResponseEntity;
-import org.springframework.scheduling.annotation.Async;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
diff --git a/eladmin-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java b/eladmin-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java
index bc2d061d..5801d983 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@ import lombok.RequiredArgsConstructor;
import me.zhengjie.domain.GenConfig;
import me.zhengjie.repository.GenConfigRepository;
import me.zhengjie.service.GenConfigService;
-import me.zhengjie.utils.StringUtils;
import org.springframework.stereotype.Service;
import java.io.File;
@@ -29,6 +28,7 @@ import java.io.File;
*/
@Service
@RequiredArgsConstructor
+@SuppressWarnings({"unchecked","all"})
public class GenConfigServiceImpl implements GenConfigService {
private final GenConfigRepository genConfigRepository;
diff --git a/eladmin-generator/src/main/java/me/zhengjie/service/impl/GeneratorServiceImpl.java b/eladmin-generator/src/main/java/me/zhengjie/service/impl/GeneratorServiceImpl.java
index 604cf2db..fdd0a0ae 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/service/impl/GeneratorServiceImpl.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/service/impl/GeneratorServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,6 +50,7 @@ import java.util.stream.Collectors;
*/
@Service
@RequiredArgsConstructor
+@SuppressWarnings({"unchecked","all"})
public class GeneratorServiceImpl implements GeneratorService {
private static final Logger log = LoggerFactory.getLogger(GeneratorServiceImpl.class);
@PersistenceContext
diff --git a/eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java b/eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java
index b5fcd6b7..cee76364 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public class ColUtil {
*/
public static PropertiesConfiguration getConfig() {
try {
- return new PropertiesConfiguration("generator.properties");
+ return new PropertiesConfiguration("gen.properties");
} catch (ConfigurationException e) {
log.error(e.getMessage(), e);
}
diff --git a/eladmin-generator/src/main/java/me/zhengjie/utils/GenUtil.java b/eladmin-generator/src/main/java/me/zhengjie/utils/GenUtil.java
index 8c8a95aa..bb5a85e4 100644
--- a/eladmin-generator/src/main/java/me/zhengjie/utils/GenUtil.java
+++ b/eladmin-generator/src/main/java/me/zhengjie/utils/GenUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/resources/generator.properties b/eladmin-generator/src/main/resources/gen.properties
similarity index 100%
rename from eladmin-generator/src/main/resources/generator.properties
rename to eladmin-generator/src/main/resources/gen.properties
diff --git a/eladmin-generator/src/main/resources/template/admin/Controller.ftl b/eladmin-generator/src/main/resources/template/admin/Controller.ftl
index a7d6d754..215fc953 100644
--- a/eladmin-generator/src/main/resources/template/admin/Controller.ftl
+++ b/eladmin-generator/src/main/resources/template/admin/Controller.ftl
@@ -1,5 +1,5 @@
/*
-* Copyright 2019-2020 Zheng Jie
+* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,13 +39,12 @@ import ${package}.service.dto.${className}Dto;
**/
@RestController
@RequiredArgsConstructor
-@Api(tags = "${apiAlias}管理")
+@Api(tags = "${apiAlias}")
@RequestMapping("/api/${changeClassName}")
public class ${className}Controller {
private final ${className}Service ${changeClassName}Service;
- @Log("导出数据")
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('${changeClassName}:list')")
@@ -54,7 +53,6 @@ public class ${className}Controller {
}
@GetMapping
- @Log("查询${apiAlias}")
@ApiOperation("查询${apiAlias}")
@PreAuthorize("@el.check('${changeClassName}:list')")
public ResponseEntity> query${className}(${className}QueryCriteria criteria, Pageable pageable){
@@ -83,7 +81,7 @@ public class ${className}Controller {
@Log("删除${apiAlias}")
@ApiOperation("删除${apiAlias}")
@PreAuthorize("@el.check('${changeClassName}:del')")
- public ResponseEntity delete${className}(@RequestBody ${pkColumnType}[] ids) {
+ public ResponseEntity delete${className}(@ApiParam(value = "传ID数组[]") @RequestBody ${pkColumnType}[] ids) {
${changeClassName}Service.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
diff --git a/eladmin-generator/src/main/resources/template/admin/Dto.ftl b/eladmin-generator/src/main/resources/template/admin/Dto.ftl
index ac81d988..3dab87ac 100644
--- a/eladmin-generator/src/main/resources/template/admin/Dto.ftl
+++ b/eladmin-generator/src/main/resources/template/admin/Dto.ftl
@@ -1,5 +1,5 @@
/*
-* Copyright 2019-2020 Zheng Jie
+* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import java.io.Serializable;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
#if>
+import io.swagger.annotations.ApiModelProperty;
/**
* @website https://eladmin.vip
@@ -40,7 +41,9 @@ public class ${className}Dto implements Serializable {
<#list columns as column>
<#if column.remark != ''>
- /** ${column.remark} */
+ @ApiModelProperty(value = "${column.remark}")
+ <#else>
+ @ApiModelProperty(value = "${column.changeColumnName}")
#if>
<#if column.columnKey = 'PRI'>
<#if !auto && pkColumnType = 'Long'>
diff --git a/eladmin-generator/src/main/resources/template/admin/Entity.ftl b/eladmin-generator/src/main/resources/template/admin/Entity.ftl
index 2e85cea8..0945eef3 100644
--- a/eladmin-generator/src/main/resources/template/admin/Entity.ftl
+++ b/eladmin-generator/src/main/resources/template/admin/Entity.ftl
@@ -1,5 +1,5 @@
/*
-* Copyright 2019-2020 Zheng Jie
+* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,25 @@ import java.sql.Timestamp;
<#if hasBigDecimal>
import java.math.BigDecimal;
#if>
+<#assign notBlankUsed = false>
+<#assign notNullUsed = false>
+<#if columns??>
+ <#list columns as column>
+ <#if column.istNotNull && column.columnKey != 'PRI'>
+ <#if column.columnType = 'String'>
+ <#assign notBlankUsed = true>
+ <#else>
+ <#assign notNullUsed = true>
+ #if>
+ #if>
+ #list>
+#if>
+<#if notBlankUsed>
+import javax.validation.constraints.NotBlank;
+#if>
+<#if notNullUsed>
+import javax.validation.constraints.NotNull;
+#if>
import java.io.Serializable;
/**
diff --git a/eladmin-generator/src/main/resources/template/admin/Mapper.ftl b/eladmin-generator/src/main/resources/template/admin/Mapper.ftl
index 7bd67c0a..3a29ccde 100644
--- a/eladmin-generator/src/main/resources/template/admin/Mapper.ftl
+++ b/eladmin-generator/src/main/resources/template/admin/Mapper.ftl
@@ -1,5 +1,5 @@
/*
-* Copyright 2019-2020 Zheng Jie
+* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/resources/template/admin/QueryCriteria.ftl b/eladmin-generator/src/main/resources/template/admin/QueryCriteria.ftl
index b94f0f45..d6bd5925 100644
--- a/eladmin-generator/src/main/resources/template/admin/QueryCriteria.ftl
+++ b/eladmin-generator/src/main/resources/template/admin/QueryCriteria.ftl
@@ -1,5 +1,5 @@
/*
-* Copyright 2019-2020 Zheng Jie
+* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ import java.util.List;
<#if queryColumns??>
import me.zhengjie.annotation.Query;
#if>
+import io.swagger.annotations.ApiModelProperty;
/**
* @website https://eladmin.vip
@@ -42,31 +43,61 @@ public class ${className}QueryCriteria{
<#if column.queryType = '='>
/** 精确 */
@Query
+ <#if column.remark != ''>
+ @ApiModelProperty(value = "${column.remark}")
+ <#else>
+ @ApiModelProperty(value = "${column.changeColumnName}")
+ #if>
private ${column.columnType} ${column.changeColumnName};
#if>
<#if column.queryType = 'Like'>
/** 模糊 */
@Query(type = Query.Type.INNER_LIKE)
+ <#if column.remark != ''>
+ @ApiModelProperty(value = "${column.remark}")
+ <#else>
+ @ApiModelProperty(value = "${column.changeColumnName}")
+ #if>
private ${column.columnType} ${column.changeColumnName};
#if>
<#if column.queryType = '!='>
/** 不等于 */
@Query(type = Query.Type.NOT_EQUAL)
+ <#if column.remark != ''>
+ @ApiModelProperty(value = "${column.remark}")
+ <#else>
+ @ApiModelProperty(value = "${column.changeColumnName}")
+ #if>
private ${column.columnType} ${column.changeColumnName};
#if>
<#if column.queryType = 'NotNull'>
/** 不为空 */
@Query(type = Query.Type.NOT_NULL)
+ <#if column.remark != ''>
+ @ApiModelProperty(value = "${column.remark}")
+ <#else>
+ @ApiModelProperty(value = "${column.changeColumnName}")
+ #if>
private ${column.columnType} ${column.changeColumnName};
#if>
<#if column.queryType = '>='>
/** 大于等于 */
@Query(type = Query.Type.GREATER_THAN)
+ <#if column.remark != ''>
+ @ApiModelProperty(value = "${column.remark}")
+ <#else>
+ @ApiModelProperty(value = "${column.changeColumnName}")
+ #if>
private ${column.columnType} ${column.changeColumnName};
#if>
<#if column.queryType = '<='>
/** 小于等于 */
@Query(type = Query.Type.LESS_THAN)
+ <#if column.remark != ''>
+ @ApiModelProperty(value = "${column.remark}")
+ <#else>
+ @ApiModelProperty(value = "${column.changeColumnName}")
+ #if>
private ${column.columnType} ${column.changeColumnName};
#if>
#list>
diff --git a/eladmin-generator/src/main/resources/template/admin/Repository.ftl b/eladmin-generator/src/main/resources/template/admin/Repository.ftl
index dac1e924..42688716 100644
--- a/eladmin-generator/src/main/resources/template/admin/Repository.ftl
+++ b/eladmin-generator/src/main/resources/template/admin/Repository.ftl
@@ -1,5 +1,5 @@
/*
-* Copyright 2019-2020 Zheng Jie
+* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/resources/template/admin/Service.ftl b/eladmin-generator/src/main/resources/template/admin/Service.ftl
index 9329e8b5..17f5ece9 100644
--- a/eladmin-generator/src/main/resources/template/admin/Service.ftl
+++ b/eladmin-generator/src/main/resources/template/admin/Service.ftl
@@ -1,5 +1,5 @@
/*
-* Copyright 2019-2020 Zheng Jie
+* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-generator/src/main/resources/template/admin/ServiceImpl.ftl b/eladmin-generator/src/main/resources/template/admin/ServiceImpl.ftl
index e79205c2..784edd6b 100644
--- a/eladmin-generator/src/main/resources/template/admin/ServiceImpl.ftl
+++ b/eladmin-generator/src/main/resources/template/admin/ServiceImpl.ftl
@@ -1,5 +1,5 @@
/*
-* Copyright 2019-2020 Zheng Jie
+* Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java b/eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java
index 6c001cd3..590a1738 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-logging/src/main/java/me/zhengjie/aspect/LogAspect.java b/eladmin-logging/src/main/java/me/zhengjie/aspect/LogAspect.java
index 107aefc7..b5f35fdc 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/aspect/LogAspect.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/aspect/LogAspect.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-logging/src/main/java/me/zhengjie/domain/SysLog.java b/eladmin-logging/src/main/java/me/zhengjie/domain/SysLog.java
index a6b2e473..f15a333c 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/domain/SysLog.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/domain/SysLog.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
*/
package me.zhengjie.domain;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@@ -36,41 +38,44 @@ public class SysLog implements Serializable {
@Id
@Column(name = "log_id")
+ @ApiModelProperty(value = "ID")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
- /** 操作用户 */
+ @ApiModelProperty(value = "操作用户")
private String username;
- /** 描述 */
+ @ApiModelProperty(value = "描述")
private String description;
- /** 方法名 */
+ @ApiModelProperty(value = "方法名")
private String method;
- /** 参数 */
+ @ApiModelProperty(value = "参数")
private String params;
- /** 日志类型 */
+ @ApiModelProperty(value = "日志类型")
private String logType;
- /** 请求ip */
+ @ApiModelProperty(value = "请求ip")
private String requestIp;
- /** 地址 */
+ @ApiModelProperty(value = "地址")
private String address;
- /** 浏览器 */
+ @ApiModelProperty(value = "浏览器")
private String browser;
- /** 请求耗时 */
+ @ApiModelProperty(value = "请求耗时")
private Long time;
- /** 异常详细 */
+ @ApiModelProperty(value = "异常详细")
private byte[] exceptionDetail;
/** 创建日期 */
@CreationTimestamp
+ @ApiModelProperty(value = "创建日期:yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp createTime;
public SysLog(String logType, Long time) {
diff --git a/eladmin-logging/src/main/java/me/zhengjie/repository/LogRepository.java b/eladmin-logging/src/main/java/me/zhengjie/repository/LogRepository.java
index 805f97b3..5a68c1c5 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/repository/LogRepository.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/repository/LogRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-logging/src/main/java/me/zhengjie/rest/SysLogController.java b/eladmin-logging/src/main/java/me/zhengjie/rest/SysLogController.java
index fa173705..59dc4f80 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/rest/SysLogController.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/rest/SysLogController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-logging/src/main/java/me/zhengjie/service/SysLogService.java b/eladmin-logging/src/main/java/me/zhengjie/service/SysLogService.java
index 80f2d1c4..c4a873fe 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/service/SysLogService.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/service/SysLogService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogErrorDto.java b/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogErrorDto.java
index 1fde4fb3..fd66068a 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogErrorDto.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogErrorDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
@@ -26,21 +27,30 @@ import java.sql.Timestamp;
@Data
public class SysLogErrorDto implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "用户名")
private String username;
+ @ApiModelProperty(value = "描述")
private String description;
+ @ApiModelProperty(value = "方法")
private String method;
+ @ApiModelProperty(value = "参数")
private String params;
+ @ApiModelProperty(value = "浏览器")
private String browser;
+ @ApiModelProperty(value = "请求ip")
private String requestIp;
+ @ApiModelProperty(value = "地址")
private String address;
+ @ApiModelProperty(value = "创建时间")
private Timestamp createTime;
}
\ No newline at end of file
diff --git a/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogQueryCriteria.java b/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogQueryCriteria.java
index 0588f646..769919c8 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogQueryCriteria.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@@ -28,15 +29,19 @@ import java.util.List;
@Data
public class SysLogQueryCriteria {
+ @ApiModelProperty(value = "模糊查询")
@Query(blurry = "username,description,address,requestIp,method,params")
private String blurry;
@Query
+ @ApiModelProperty(value = "用户名")
private String username;
@Query
+ @ApiModelProperty(value = "日志类型")
private String logType;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
diff --git a/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogSmallDto.java b/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogSmallDto.java
index d7312cd7..55894dbd 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogSmallDto.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/service/dto/SysLogSmallDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
@@ -26,15 +27,21 @@ import java.sql.Timestamp;
@Data
public class SysLogSmallDto implements Serializable {
+ @ApiModelProperty(value = "描述")
private String description;
+ @ApiModelProperty(value = "请求IP")
private String requestIp;
+ @ApiModelProperty(value = "耗时")
private Long time;
+ @ApiModelProperty(value = "地址")
private String address;
+ @ApiModelProperty(value = "浏览器")
private String browser;
+ @ApiModelProperty(value = "创建时间")
private Timestamp createTime;
}
diff --git a/eladmin-logging/src/main/java/me/zhengjie/service/impl/SysLogServiceImpl.java b/eladmin-logging/src/main/java/me/zhengjie/service/impl/SysLogServiceImpl.java
index 95ea4a09..866c6339 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/service/impl/SysLogServiceImpl.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/service/impl/SysLogServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogErrorMapper.java b/eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogErrorMapper.java
index c777d11a..80e5e2f1 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogErrorMapper.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogErrorMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogSmallMapper.java b/eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogSmallMapper.java
index eeb5433a..28497036 100644
--- a/eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogSmallMapper.java
+++ b/eladmin-logging/src/main/java/me/zhengjie/service/mapstruct/LogSmallMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/pom.xml b/eladmin-system/pom.xml
index e1799196..a7b837cc 100644
--- a/eladmin-system/pom.xml
+++ b/eladmin-system/pom.xml
@@ -39,12 +39,6 @@
2.7
-
-
- org.springframework.boot
- spring-boot-starter-websocket
-
-
org.springframework.boot
diff --git a/eladmin-system/src/main/java/me/zhengjie/AppRun.java b/eladmin-system/src/main/java/me/zhengjie/AppRun.java
index a09ee26e..a8dfb89a 100644
--- a/eladmin-system/src/main/java/me/zhengjie/AppRun.java
+++ b/eladmin-system/src/main/java/me/zhengjie/AppRun.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,9 @@
package me.zhengjie;
import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.rest.AnonymousGetMapping;
-import me.zhengjie.utils.SpringContextHolder;
+import me.zhengjie.utils.SpringBeanHolder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
@@ -35,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
* @author Zheng Jie
* @date 2018/11/15 9:20:19
*/
+@Slf4j
@EnableAsync
@RestController
@Api(hidden = true)
@@ -49,11 +51,15 @@ public class AppRun {
// 或者在 application.yml 添加文件路径,方便 kill,kill `cat /home/eladmin/app.pid`
springApplication.addListeners(new ApplicationPidFileWriter());
springApplication.run(args);
+ log.info("---------------------------------------------");
+ log.info("Local: {}", "http://localhost:8000");
+ log.info("Swagger: {}", "http://localhost:8000/doc.html");
+ log.info("---------------------------------------------");
}
@Bean
- public SpringContextHolder springContextHolder() {
- return new SpringContextHolder();
+ public SpringBeanHolder springContextHolder() {
+ return new SpringBeanHolder();
}
/**
diff --git a/eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java b/eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java
deleted file mode 100644
index 6e075eab..00000000
--- a/eladmin-system/src/main/java/me/zhengjie/config/thread/AsyncTaskProperties.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2019-2020 Zheng Jie
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package me.zhengjie.config.thread;
-
-import lombok.Data;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-/**
- * 线程池配置属性类
- * @author https://juejin.im/entry/5abb8f6951882555677e9da2
- * @date 2019年10月31日14:58:18
- */
-@Data
-@Component
-public class AsyncTaskProperties {
-
- public static int corePoolSize;
-
- public static int maxPoolSize;
-
- public static int keepAliveSeconds;
-
- public static int queueCapacity;
-
- @Value("${task.pool.core-pool-size}")
- public void setCorePoolSize(int corePoolSize) {
- AsyncTaskProperties.corePoolSize = corePoolSize;
- }
-
- @Value("${task.pool.max-pool-size}")
- public void setMaxPoolSize(int maxPoolSize) {
- AsyncTaskProperties.maxPoolSize = maxPoolSize;
- }
-
- @Value("${task.pool.keep-alive-seconds}")
- public void setKeepAliveSeconds(int keepAliveSeconds) {
- AsyncTaskProperties.keepAliveSeconds = keepAliveSeconds;
- }
-
- @Value("${task.pool.queue-capacity}")
- public void setQueueCapacity(int queueCapacity) {
- AsyncTaskProperties.queueCapacity = queueCapacity;
- }
-}
diff --git a/eladmin-system/src/main/java/me/zhengjie/config/thread/CustomExecutorConfig.java b/eladmin-system/src/main/java/me/zhengjie/config/thread/CustomExecutorConfig.java
deleted file mode 100644
index ca8a8bc5..00000000
--- a/eladmin-system/src/main/java/me/zhengjie/config/thread/CustomExecutorConfig.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package me.zhengjie.config.thread;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Primary;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ThreadPoolExecutor;
-
-/**
- * 创建自定义的线程池
- * @author Zheng Jie
- * @description
- * @date 2023-06-08
- **/
-@Configuration
-public class CustomExecutorConfig {
-
- /**
- * 自定义线程池,用法 @Async
- * @return Executor
- */
- @Bean
- @Primary
- public Executor elAsync() {
- ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
- executor.setCorePoolSize(AsyncTaskProperties.corePoolSize);
- executor.setMaxPoolSize(AsyncTaskProperties.maxPoolSize);
- executor.setQueueCapacity(AsyncTaskProperties.queueCapacity);
- executor.setThreadNamePrefix("el-async-");
- executor.setKeepAliveSeconds(AsyncTaskProperties.keepAliveSeconds);
- executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
- executor.initialize();
- return executor;
- }
-
- /**
- * 自定义线程池,用法 @Async("otherAsync")
- * @return Executor
- */
- @Bean
- public Executor otherAsync() {
- ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
- executor.setCorePoolSize(15);
- executor.setQueueCapacity(50);
- executor.setKeepAliveSeconds(AsyncTaskProperties.keepAliveSeconds);
- executor.setThreadNamePrefix("el-task-");
- executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
- executor.initialize();
- return executor;
- }
-}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/App.java
similarity index 95%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/App.java
index cf5789c9..f8b01990 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/App.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/App.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.domain;
+package me.zhengjie.modules.maint.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Database.java
similarity index 80%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Database.java
index 6b3a68a6..babf3ba6 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Database.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Database.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.domain;
+package me.zhengjie.modules.maint.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
@@ -36,19 +36,19 @@ public class Database extends BaseEntity implements Serializable {
@Id
@Column(name = "db_id")
- @ApiModelProperty(value = "ID", hidden = true)
+ @ApiModelProperty(value = "ID", hidden = true)
private String id;
- @ApiModelProperty(value = "数据库名称")
+ @ApiModelProperty(value = "数据库名称")
private String name;
- @ApiModelProperty(value = "数据库连接地址")
+ @ApiModelProperty(value = "数据库连接地址")
private String jdbcUrl;
- @ApiModelProperty(value = "数据库密码")
+ @ApiModelProperty(value = "数据库密码")
private String pwd;
- @ApiModelProperty(value = "用户名")
+ @ApiModelProperty(value = "用户名")
private String userName;
public void copy(Database source){
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Deploy.java
similarity index 95%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Deploy.java
index bcf61e54..8c2e2d71 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/Deploy.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/Deploy.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.domain;
+package me.zhengjie.modules.maint.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/DeployHistory.java
similarity index 95%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/DeployHistory.java
index b4213a41..e4de70cf 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/DeployHistory.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/DeployHistory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.domain;
+package me.zhengjie.modules.maint.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/ServerDeploy.java
similarity index 96%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/ServerDeploy.java
index f5235627..d7dc1d0b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/domain/ServerDeploy.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/ServerDeploy.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.domain;
+package me.zhengjie.modules.maint.domain;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.BeanUtil;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/enums/DataTypeEnum.java
similarity index 98%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/enums/DataTypeEnum.java
index e104b9ee..6d4ab1c9 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/DataTypeEnum.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/domain/enums/DataTypeEnum.java
@@ -17,7 +17,7 @@
*
*/
-package me.zhengjie.modules.mnt.util;
+package me.zhengjie.modules.maint.domain.enums;
import lombok.extern.slf4j.Slf4j;
/**
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/AppRepository.java
similarity index 87%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/AppRepository.java
index 41e5f5c9..9dda8c26 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/AppRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/AppRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.repository;
+package me.zhengjie.modules.maint.repository;
-import me.zhengjie.modules.mnt.domain.App;
+import me.zhengjie.modules.maint.domain.App;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DatabaseRepository.java
similarity index 87%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DatabaseRepository.java
index 695e0adc..2872b990 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DatabaseRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DatabaseRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.repository;
+package me.zhengjie.modules.maint.repository;
-import me.zhengjie.modules.mnt.domain.Database;
+import me.zhengjie.modules.maint.domain.Database;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployHistoryRepository.java
similarity index 86%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployHistoryRepository.java
index 3c8980ec..54d207b4 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployHistoryRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployHistoryRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.repository;
+package me.zhengjie.modules.maint.repository;
-import me.zhengjie.modules.mnt.domain.DeployHistory;
+import me.zhengjie.modules.maint.domain.DeployHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployRepository.java
similarity index 87%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployRepository.java
index 2ea44986..0adf8989 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/DeployRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/DeployRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.repository;
+package me.zhengjie.modules.maint.repository;
-import me.zhengjie.modules.mnt.domain.Deploy;
+import me.zhengjie.modules.maint.domain.Deploy;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/ServerDeployRepository.java
similarity index 88%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/ServerDeployRepository.java
index 4ca336c0..ae8882b9 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/repository/ServerDeployRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/repository/ServerDeployRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.repository;
+package me.zhengjie.modules.maint.repository;
-import me.zhengjie.modules.mnt.domain.ServerDeploy;
+import me.zhengjie.modules.maint.domain.ServerDeploy;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/AppController.java
similarity index 91%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/AppController.java
index 96cfbed3..ae931a48 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/AppController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.rest;
+package me.zhengjie.modules.maint.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
-import me.zhengjie.modules.mnt.domain.App;
-import me.zhengjie.modules.mnt.service.AppService;
-import me.zhengjie.modules.mnt.service.dto.AppDto;
-import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria;
+import me.zhengjie.modules.maint.domain.App;
+import me.zhengjie.modules.maint.service.AppService;
+import me.zhengjie.modules.maint.service.dto.AppDto;
+import me.zhengjie.modules.maint.service.dto.AppQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DatabaseController.java
similarity index 92%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DatabaseController.java
index ded799d3..7e93506f 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DatabaseController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,18 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.rest;
+package me.zhengjie.modules.maint.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.exception.BadRequestException;
-import me.zhengjie.modules.mnt.domain.Database;
-import me.zhengjie.modules.mnt.service.DatabaseService;
-import me.zhengjie.modules.mnt.service.dto.DatabaseDto;
-import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria;
-import me.zhengjie.modules.mnt.util.SqlUtils;
+import me.zhengjie.modules.maint.domain.Database;
+import me.zhengjie.modules.maint.service.DatabaseService;
+import me.zhengjie.modules.maint.service.dto.DatabaseDto;
+import me.zhengjie.modules.maint.service.dto.DatabaseQueryCriteria;
+import me.zhengjie.modules.maint.util.SqlUtils;
import me.zhengjie.utils.FileUtil;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployController.java
similarity index 93%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployController.java
index 7bef6197..372880a7 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,19 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.rest;
+package me.zhengjie.modules.maint.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.Log;
-import me.zhengjie.exception.BadRequestException;
-import me.zhengjie.modules.mnt.domain.Deploy;
-import me.zhengjie.modules.mnt.domain.DeployHistory;
-import me.zhengjie.modules.mnt.service.DeployService;
-import me.zhengjie.modules.mnt.service.dto.DeployDto;
-import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria;
+import me.zhengjie.modules.maint.domain.Deploy;
+import me.zhengjie.modules.maint.domain.DeployHistory;
+import me.zhengjie.modules.maint.service.DeployService;
+import me.zhengjie.modules.maint.service.dto.DeployDto;
+import me.zhengjie.modules.maint.service.dto.DeployQueryCriteria;
import me.zhengjie.utils.FileUtil;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployHistoryController.java
similarity index 89%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployHistoryController.java
index 60ee88c4..21295264 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/DeployHistoryController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.rest;
+package me.zhengjie.modules.maint.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
-import me.zhengjie.modules.mnt.service.DeployHistoryService;
-import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto;
-import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria;
+import me.zhengjie.modules.maint.service.DeployHistoryService;
+import me.zhengjie.modules.maint.service.dto.DeployHistoryDto;
+import me.zhengjie.modules.maint.service.dto.DeployHistoryQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/ServerDeployController.java
similarity index 91%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/ServerDeployController.java
index f4c60f42..5fde7be6 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/rest/ServerDeployController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.rest;
+package me.zhengjie.modules.maint.rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
-import me.zhengjie.modules.mnt.domain.ServerDeploy;
-import me.zhengjie.modules.mnt.service.ServerDeployService;
-import me.zhengjie.modules.mnt.service.dto.ServerDeployDto;
-import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria;
+import me.zhengjie.modules.maint.domain.ServerDeploy;
+import me.zhengjie.modules.maint.service.ServerDeployService;
+import me.zhengjie.modules.maint.service.dto.ServerDeployDto;
+import me.zhengjie.modules.maint.service.dto.ServerDeployQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/AppService.java
similarity index 88%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/AppService.java
index 9bded4d8..2134f276 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/AppService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/AppService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service;
+package me.zhengjie.modules.maint.service;
-import me.zhengjie.modules.mnt.domain.App;
-import me.zhengjie.modules.mnt.service.dto.AppDto;
-import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria;
+import me.zhengjie.modules.maint.domain.App;
+import me.zhengjie.modules.maint.service.dto.AppDto;
+import me.zhengjie.modules.maint.service.dto.AppQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DatabaseService.java
similarity index 88%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DatabaseService.java
index 904f73ca..81237fc7 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DatabaseService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DatabaseService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service;
+package me.zhengjie.modules.maint.service;
-import me.zhengjie.modules.mnt.domain.Database;
-import me.zhengjie.modules.mnt.service.dto.DatabaseDto;
-import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria;
+import me.zhengjie.modules.maint.domain.Database;
+import me.zhengjie.modules.maint.service.dto.DatabaseDto;
+import me.zhengjie.modules.maint.service.dto.DatabaseQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployHistoryService.java
similarity index 86%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployHistoryService.java
index 07bcb642..93c60cce 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployHistoryService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployHistoryService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service;
+package me.zhengjie.modules.maint.service;
-import me.zhengjie.modules.mnt.domain.DeployHistory;
-import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto;
-import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria;
+import me.zhengjie.modules.maint.domain.DeployHistory;
+import me.zhengjie.modules.maint.service.dto.DeployHistoryDto;
+import me.zhengjie.modules.maint.service.dto.DeployHistoryQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployService.java
similarity index 89%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployService.java
index 7fb78f59..0a5fbb13 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/DeployService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/DeployService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service;
+package me.zhengjie.modules.maint.service;
-import me.zhengjie.modules.mnt.domain.Deploy;
-import me.zhengjie.modules.mnt.domain.DeployHistory;
-import me.zhengjie.modules.mnt.service.dto.DeployDto;
-import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria;
+import me.zhengjie.modules.maint.domain.Deploy;
+import me.zhengjie.modules.maint.domain.DeployHistory;
+import me.zhengjie.modules.maint.service.dto.DeployDto;
+import me.zhengjie.modules.maint.service.dto.DeployQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/ServerDeployService.java
similarity index 88%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/ServerDeployService.java
index 6dd343fd..512081fb 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/ServerDeployService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/ServerDeployService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service;
+package me.zhengjie.modules.maint.service;
-import me.zhengjie.modules.mnt.domain.ServerDeploy;
-import me.zhengjie.modules.mnt.service.dto.ServerDeployDto;
-import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria;
+import me.zhengjie.modules.maint.domain.ServerDeploy;
+import me.zhengjie.modules.maint.service.dto.ServerDeployDto;
+import me.zhengjie.modules.maint.service.dto.ServerDeployQueryCriteria;
import me.zhengjie.utils.PageResult;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppDto.java
similarity index 69%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppDto.java
index c6fd6f74..df88534a 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -28,44 +29,27 @@ import java.io.Serializable;
@Setter
public class AppDto extends BaseDTO implements Serializable {
- /**
- * 应用编号
- */
+ @ApiModelProperty(value = "ID")
private Long id;
- /**
- * 应用名称
- */
+ @ApiModelProperty(value = "应用名称")
private String name;
- /**
- * 端口
- */
+ @ApiModelProperty(value = "端口")
private Integer port;
- /**
- * 上传目录
- */
+ @ApiModelProperty(value = "上传目录")
private String uploadPath;
- /**
- * 部署目录
- */
+ @ApiModelProperty(value = "部署目录")
private String deployPath;
- /**
- * 备份目录
- */
+ @ApiModelProperty(value = "备份目录")
private String backupPath;
- /**
- * 启动脚本
- */
+ @ApiModelProperty(value = "启动脚本")
private String startScript;
- /**
- * 部署脚本
- */
+ @ApiModelProperty(value = "部署脚本")
private String deployScript;
-
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppQueryCriteria.java
similarity index 81%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppQueryCriteria.java
index 17f358f7..9932a3e0 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/AppQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/AppQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@@ -27,12 +28,11 @@ import java.util.List;
@Data
public class AppQueryCriteria{
- /**
- * 模糊
- */
+ @ApiModelProperty(value = "模糊")
@Query(type = Query.Type.INNER_LIKE)
private String name;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseDto.java
similarity index 73%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseDto.java
index 689b06b9..04b9155b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -28,28 +29,18 @@ import java.io.Serializable;
@Setter
public class DatabaseDto extends BaseDTO implements Serializable {
- /**
- * id
- */
+ @ApiModelProperty(value = "ID")
private String id;
- /**
- * 数据库名称
- */
+ @ApiModelProperty(value = "数据库名称")
private String name;
- /**
- * 数据库连接地址
- */
+ @ApiModelProperty(value = "数据库连接地址")
private String jdbcUrl;
- /**
- * 数据库密码
- */
+ @ApiModelProperty(value = "数据库密码")
private String pwd;
- /**
- * 用户名
- */
+ @ApiModelProperty(value = "用户名")
private String userName;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseQueryCriteria.java
similarity index 78%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseQueryCriteria.java
index 53d619d4..dceb0f83 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DatabaseQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DatabaseQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@@ -27,18 +28,15 @@ import java.util.List;
@Data
public class DatabaseQueryCriteria{
- /**
- * 模糊
- */
+ @ApiModelProperty(value = "模糊")
@Query(type = Query.Type.INNER_LIKE)
private String name;
- /**
- * 精确
- */
@Query
+ @ApiModelProperty(value = "数据库连接地址")
private String jdbcUrl;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployDto.java
similarity index 82%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployDto.java
index f3d77b8e..6eda1529 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
import cn.hutool.core.collection.CollectionUtil;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -33,23 +34,19 @@ import java.util.stream.Collectors;
@Setter
public class DeployDto extends BaseDTO implements Serializable {
- /**
- * 部署编号
- */
+ @ApiModelProperty(value = "ID")
private String id;
+ @ApiModelProperty(value = "应用")
private AppDto app;
- /**
- * 服务器
- */
+ @ApiModelProperty(value = "服务器")
private Set deploys;
+ @ApiModelProperty(value = "服务器名称")
private String servers;
- /**
- * 服务状态
- */
+ @ApiModelProperty(value = "服务状态")
private String status;
public String getServers() {
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryDto.java
similarity index 71%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryDto.java
index a9f480cf..d08b9975 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
@@ -26,33 +27,21 @@ import java.sql.Timestamp;
@Data
public class DeployHistoryDto implements Serializable {
- /**
- * 编号
- */
+ @ApiModelProperty(value = "ID")
private String id;
- /**
- * 应用名称
- */
+ @ApiModelProperty(value = "应用名称")
private String appName;
- /**
- * 部署IP
- */
+ @ApiModelProperty(value = "部署IP")
private String ip;
- /**
- * 部署时间
- */
+ @ApiModelProperty(value = "部署时间")
private Timestamp deployDate;
- /**
- * 部署人员
- */
+ @ApiModelProperty(value = "部署人员")
private String deployUser;
- /**
- * 部署编号
- */
+ @ApiModelProperty(value = "部署编号")
private Long deployId;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryQueryCriteria.java
similarity index 78%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryQueryCriteria.java
index c34f1242..469f6661 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployHistoryQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployHistoryQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@@ -27,15 +28,15 @@ import java.util.List;
@Data
public class DeployHistoryQueryCriteria{
- /**
- * 精确
- */
+ @ApiModelProperty(value = "模糊查询")
@Query(blurry = "appName,ip,deployUser")
private String blurry;
@Query
+ @ApiModelProperty(value = "部署编号")
private Long deployId;
+ @ApiModelProperty(value = "部署时间")
@Query(type = Query.Type.BETWEEN)
private List deployDate;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployQueryCriteria.java
similarity index 81%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployQueryCriteria.java
index c404620a..cd6da2b0 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/DeployQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/DeployQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@@ -27,12 +28,11 @@ import java.util.List;
@Data
public class DeployQueryCriteria{
- /**
- * 模糊
- */
+ @ApiModelProperty(value = "应用名称")
@Query(type = Query.Type.INNER_LIKE, propName = "name", joinName = "app")
private String appName;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployDto.java
similarity index 79%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployDto.java
index a49c7950..a916517b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -29,16 +30,22 @@ import java.util.Objects;
@Setter
public class ServerDeployDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "名称")
private String name;
+ @ApiModelProperty(value = "IP")
private String ip;
+ @ApiModelProperty(value = "端口")
private Integer port;
+ @ApiModelProperty(value = "账号")
private String account;
+ @ApiModelProperty(value = "密码")
private String password;
@Override
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployQueryCriteria.java
similarity index 80%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployQueryCriteria.java
index bb8bd412..cdc20da3 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/dto/ServerDeployQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/dto/ServerDeployQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,8 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.dto;
+package me.zhengjie.modules.maint.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@@ -27,12 +28,11 @@ import java.util.List;
@Data
public class ServerDeployQueryCriteria{
- /**
- * 模糊
- */
+ @ApiModelProperty(value = "模糊查询")
@Query(blurry = "name,ip,account")
private String blurry;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/AppServiceImpl.java
similarity index 91%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/AppServiceImpl.java
index 7d66d0bf..d7aeb296 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/AppServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/AppServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.impl;
+package me.zhengjie.modules.maint.service.impl;
import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
-import me.zhengjie.modules.mnt.domain.App;
-import me.zhengjie.modules.mnt.repository.AppRepository;
-import me.zhengjie.modules.mnt.service.AppService;
-import me.zhengjie.modules.mnt.service.dto.AppDto;
-import me.zhengjie.modules.mnt.service.dto.AppQueryCriteria;
-import me.zhengjie.modules.mnt.service.mapstruct.AppMapper;
+import me.zhengjie.modules.maint.domain.App;
+import me.zhengjie.modules.maint.repository.AppRepository;
+import me.zhengjie.modules.maint.service.AppService;
+import me.zhengjie.modules.maint.service.dto.AppDto;
+import me.zhengjie.modules.maint.service.dto.AppQueryCriteria;
+import me.zhengjie.modules.maint.service.mapstruct.AppMapper;
import me.zhengjie.utils.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DatabaseServiceImpl.java
similarity index 88%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DatabaseServiceImpl.java
index 386b4c29..e620edb6 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DatabaseServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DatabaseServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,18 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.impl;
+package me.zhengjie.modules.maint.service.impl;
import cn.hutool.core.util.IdUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import me.zhengjie.modules.mnt.domain.Database;
-import me.zhengjie.modules.mnt.repository.DatabaseRepository;
-import me.zhengjie.modules.mnt.service.DatabaseService;
-import me.zhengjie.modules.mnt.service.dto.DatabaseDto;
-import me.zhengjie.modules.mnt.service.dto.DatabaseQueryCriteria;
-import me.zhengjie.modules.mnt.service.mapstruct.DatabaseMapper;
-import me.zhengjie.modules.mnt.util.SqlUtils;
+import me.zhengjie.modules.maint.domain.Database;
+import me.zhengjie.modules.maint.repository.DatabaseRepository;
+import me.zhengjie.modules.maint.service.DatabaseService;
+import me.zhengjie.modules.maint.service.dto.DatabaseDto;
+import me.zhengjie.modules.maint.service.dto.DatabaseQueryCriteria;
+import me.zhengjie.modules.maint.service.mapstruct.DatabaseMapper;
+import me.zhengjie.modules.maint.util.SqlUtils;
import me.zhengjie.utils.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployHistoryServiceImpl.java
similarity index 87%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployHistoryServiceImpl.java
index 762b783e..a206b326 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployHistoryServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployHistoryServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.impl;
+package me.zhengjie.modules.maint.service.impl;
import cn.hutool.core.util.IdUtil;
import lombok.RequiredArgsConstructor;
-import me.zhengjie.modules.mnt.domain.DeployHistory;
-import me.zhengjie.modules.mnt.repository.DeployHistoryRepository;
-import me.zhengjie.modules.mnt.service.DeployHistoryService;
-import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto;
-import me.zhengjie.modules.mnt.service.dto.DeployHistoryQueryCriteria;
-import me.zhengjie.modules.mnt.service.mapstruct.DeployHistoryMapper;
+import me.zhengjie.modules.maint.domain.DeployHistory;
+import me.zhengjie.modules.maint.repository.DeployHistoryRepository;
+import me.zhengjie.modules.maint.service.DeployHistoryService;
+import me.zhengjie.modules.maint.service.dto.DeployHistoryDto;
+import me.zhengjie.modules.maint.service.dto.DeployHistoryQueryCriteria;
+import me.zhengjie.modules.maint.service.mapstruct.DeployHistoryMapper;
import me.zhengjie.utils.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java
similarity index 92%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java
index 1c16f9c6..41a25988 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/DeployServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/DeployServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,31 +13,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.impl;
+package me.zhengjie.modules.maint.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.exception.BadRequestException;
-import me.zhengjie.modules.mnt.domain.App;
-import me.zhengjie.modules.mnt.domain.Deploy;
-import me.zhengjie.modules.mnt.domain.DeployHistory;
-import me.zhengjie.modules.mnt.domain.ServerDeploy;
-import me.zhengjie.modules.mnt.repository.DeployRepository;
-import me.zhengjie.modules.mnt.service.DeployHistoryService;
-import me.zhengjie.modules.mnt.service.DeployService;
-import me.zhengjie.modules.mnt.service.ServerDeployService;
-import me.zhengjie.modules.mnt.service.dto.AppDto;
-import me.zhengjie.modules.mnt.service.dto.DeployDto;
-import me.zhengjie.modules.mnt.service.dto.DeployQueryCriteria;
-import me.zhengjie.modules.mnt.service.dto.ServerDeployDto;
-import me.zhengjie.modules.mnt.service.mapstruct.DeployMapper;
-import me.zhengjie.modules.mnt.util.ExecuteShellUtil;
-import me.zhengjie.modules.mnt.util.ScpClientUtil;
-import me.zhengjie.modules.mnt.websocket.MsgType;
-import me.zhengjie.modules.mnt.websocket.SocketMsg;
-import me.zhengjie.modules.mnt.websocket.WebSocketServer;
+import me.zhengjie.modules.maint.domain.App;
+import me.zhengjie.modules.maint.domain.Deploy;
+import me.zhengjie.modules.maint.domain.DeployHistory;
+import me.zhengjie.modules.maint.domain.ServerDeploy;
+import me.zhengjie.modules.maint.repository.DeployRepository;
+import me.zhengjie.modules.maint.service.DeployHistoryService;
+import me.zhengjie.modules.maint.service.DeployService;
+import me.zhengjie.modules.maint.service.ServerDeployService;
+import me.zhengjie.modules.maint.service.dto.AppDto;
+import me.zhengjie.modules.maint.service.dto.DeployDto;
+import me.zhengjie.modules.maint.service.dto.DeployQueryCriteria;
+import me.zhengjie.modules.maint.service.dto.ServerDeployDto;
+import me.zhengjie.modules.maint.service.mapstruct.DeployMapper;
+import me.zhengjie.modules.maint.util.ExecuteShellUtil;
+import me.zhengjie.modules.maint.util.ScpClientUtil;
+import me.zhengjie.modules.maint.websocket.MsgType;
+import me.zhengjie.modules.maint.websocket.SocketMsg;
+import me.zhengjie.modules.maint.websocket.WebSocketServer;
import me.zhengjie.utils.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/ServerDeployServiceImpl.java
similarity index 89%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/ServerDeployServiceImpl.java
index 24b29e0e..5075a90b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/impl/ServerDeployServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/impl/ServerDeployServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.impl;
+package me.zhengjie.modules.maint.service.impl;
import lombok.RequiredArgsConstructor;
-import me.zhengjie.modules.mnt.domain.ServerDeploy;
-import me.zhengjie.modules.mnt.repository.ServerDeployRepository;
-import me.zhengjie.modules.mnt.service.ServerDeployService;
-import me.zhengjie.modules.mnt.service.dto.ServerDeployDto;
-import me.zhengjie.modules.mnt.service.dto.ServerDeployQueryCriteria;
-import me.zhengjie.modules.mnt.service.mapstruct.ServerDeployMapper;
-import me.zhengjie.modules.mnt.util.ExecuteShellUtil;
+import me.zhengjie.modules.maint.domain.ServerDeploy;
+import me.zhengjie.modules.maint.repository.ServerDeployRepository;
+import me.zhengjie.modules.maint.service.ServerDeployService;
+import me.zhengjie.modules.maint.service.dto.ServerDeployDto;
+import me.zhengjie.modules.maint.service.dto.ServerDeployQueryCriteria;
+import me.zhengjie.modules.maint.service.mapstruct.ServerDeployMapper;
+import me.zhengjie.modules.maint.util.ExecuteShellUtil;
import me.zhengjie.utils.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/AppMapper.java
similarity index 82%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/AppMapper.java
index fc39eeb2..bc2e66fb 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/AppMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/AppMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.mapstruct;
+package me.zhengjie.modules.maint.service.mapstruct;
import me.zhengjie.base.BaseMapper;
-import me.zhengjie.modules.mnt.domain.App;
-import me.zhengjie.modules.mnt.service.dto.AppDto;
+import me.zhengjie.modules.maint.domain.App;
+import me.zhengjie.modules.maint.service.dto.AppDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DatabaseMapper.java
similarity index 81%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DatabaseMapper.java
index 3cc6e8dd..564438e4 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DatabaseMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DatabaseMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.mapstruct;
+package me.zhengjie.modules.maint.service.mapstruct;
import me.zhengjie.base.BaseMapper;
-import me.zhengjie.modules.mnt.domain.Database;
-import me.zhengjie.modules.mnt.service.dto.DatabaseDto;
+import me.zhengjie.modules.maint.domain.Database;
+import me.zhengjie.modules.maint.service.dto.DatabaseDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployHistoryMapper.java
similarity index 81%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployHistoryMapper.java
index 2522ab02..5e6f6468 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployHistoryMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployHistoryMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.mapstruct;
+package me.zhengjie.modules.maint.service.mapstruct;
import me.zhengjie.base.BaseMapper;
-import me.zhengjie.modules.mnt.domain.DeployHistory;
-import me.zhengjie.modules.mnt.service.dto.DeployHistoryDto;
+import me.zhengjie.modules.maint.domain.DeployHistory;
+import me.zhengjie.modules.maint.service.dto.DeployHistoryDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployMapper.java
similarity index 82%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployMapper.java
index cd3edee8..8ed5347e 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/DeployMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/DeployMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.mapstruct;
+package me.zhengjie.modules.maint.service.mapstruct;
import me.zhengjie.base.BaseMapper;
-import me.zhengjie.modules.mnt.domain.Deploy;
-import me.zhengjie.modules.mnt.service.dto.DeployDto;
+import me.zhengjie.modules.maint.domain.Deploy;
+import me.zhengjie.modules.maint.service.dto.DeployDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/ServerDeployMapper.java
similarity index 81%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/ServerDeployMapper.java
index 960b25b1..27d03fa1 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/service/mapstruct/ServerDeployMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/service/mapstruct/ServerDeployMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.service.mapstruct;
+package me.zhengjie.modules.maint.service.mapstruct;
import me.zhengjie.base.BaseMapper;
-import me.zhengjie.modules.mnt.domain.ServerDeploy;
-import me.zhengjie.modules.mnt.service.dto.ServerDeployDto;
+import me.zhengjie.modules.maint.domain.ServerDeploy;
+import me.zhengjie.modules.maint.service.dto.ServerDeployDto;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ExecuteShellUtil.java
similarity index 95%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ExecuteShellUtil.java
index a5d5b599..1fc60791 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ExecuteShellUtil.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ExecuteShellUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,22 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.util;
+package me.zhengjie.modules.maint.util;
import cn.hutool.core.io.IoUtil;
import com.jcraft.jsch.ChannelShell;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import lombok.extern.slf4j.Slf4j;
-
import java.io.*;
import java.util.Vector;
/**
* 执行shell命令
*
- * @author: ZhangHouYing
- * @date: 2019/8/10
+ * @author ZhangHouYing
+ * @date 2019/8/10
*/
@Slf4j
public class ExecuteShellUtil {
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ScpClientUtil.java
similarity index 85%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ScpClientUtil.java
index 7cb83aa1..92ba0844 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/ScpClientUtil.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/ScpClientUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.util;
+package me.zhengjie.modules.maint.util;
import ch.ethz.ssh2.Connection;
import ch.ethz.ssh2.SCPClient;
import com.google.common.collect.Maps;
+import me.zhengjie.utils.StringUtils;
import java.io.IOException;
import java.util.Map;
@@ -26,17 +27,20 @@ import java.util.logging.Logger;
/**
* 远程执行linux命令
- * @author: ZhangHouYing
- * @date: 2019-08-10 10:06
+ * @author ZhangHouYing
+ * @date 2019-08-10 10:06
*/
public class ScpClientUtil {
- static private Map instance = Maps.newHashMap();
+ private final String ip;
+ private final int port;
+ private final String username;
+ private final String password;
+
+ static private final Map instance = Maps.newHashMap();
static synchronized public ScpClientUtil getInstance(String ip, int port, String username, String password) {
- if (instance.get(ip) == null) {
- instance.put(ip, new ScpClientUtil(ip, port, username, password));
- }
+ instance.computeIfAbsent(ip, i -> new ScpClientUtil(i, port, username, password));
return instance.get(ip);
}
@@ -81,7 +85,7 @@ public class ScpClientUtil {
System.err.println("authentication failed");
}
SCPClient client = new SCPClient(conn);
- if ((mode == null) || (mode.length() == 0)) {
+ if (StringUtils.isBlank(mode)) {
mode = "0600";
}
if (remoteFileName == null) {
@@ -95,11 +99,4 @@ public class ScpClientUtil {
conn.close();
}
}
-
- private String ip;
- private int port;
- private String username;
- private String password;
-
-
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/SqlUtils.java
similarity index 81%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/util/SqlUtils.java
index 0e867af5..ac4c9d2a 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/util/SqlUtils.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/util/SqlUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,20 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.util;
+package me.zhengjie.modules.maint.util;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.util.StringUtils;
-import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
+import me.zhengjie.modules.maint.domain.enums.DataTypeEnum;
import me.zhengjie.utils.CloseUtil;
import javax.sql.DataSource;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
-import java.sql.*;
+import java.nio.file.Files;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -113,7 +116,6 @@ public class SqlUtils {
connection.close();
} catch (Exception e) {
log.error(e.getMessage(),e);
- log.error("connection close error:" + e.getMessage());
}
}
}
@@ -126,7 +128,7 @@ public class SqlUtils {
return true;
}
} catch (Exception e) {
- log.info("Get connection failed:" + e.getMessage());
+ log.error("Get connection failed:{}", e.getMessage());
} finally {
releaseConnection(connection);
}
@@ -146,27 +148,26 @@ public class SqlUtils {
return "success";
}
-
/**
* 批量执行sql
* @param connection /
* @param sqlList /
*/
public static void batchExecute(Connection connection, List sqlList) {
- Statement st = null;
- try {
- st = connection.createStatement();
+ try (Statement st = connection.createStatement()) {
for (String sql : sqlList) {
+ // 去除末尾的分号
if (sql.endsWith(";")) {
sql = sql.substring(0, sql.length() - 1);
}
- st.addBatch(sql);
+ // 检查 SQL 语句是否为空
+ if (!sql.trim().isEmpty()) {
+ st.addBatch(sql);
+ }
}
st.executeBatch();
- } catch (SQLException throwables) {
- throwables.printStackTrace();
- } finally {
- CloseUtil.close(st);
+ } catch (SQLException e) {
+ log.error("SQL脚本批量执行发生异常: {},错误代码: {}", e.getMessage(), e.getErrorCode());
}
}
@@ -174,29 +175,31 @@ public class SqlUtils {
* 将文件中的sql语句以;为单位读取到列表中
* @param sqlFile /
* @return /
- * @throws Exception e
- */
- private static List readSqlList(File sqlFile) throws Exception {
- List sqlList = Lists.newArrayList();
+ */
+ private static List readSqlList(File sqlFile) {
+ List sqlList = new ArrayList<>();
StringBuilder sb = new StringBuilder();
- try (BufferedReader reader = new BufferedReader(new InputStreamReader(
- new FileInputStream(sqlFile), StandardCharsets.UTF_8))) {
- String tmp;
- while ((tmp = reader.readLine()) != null) {
- log.info("line:{}", tmp);
- if (tmp.endsWith(";")) {
- sb.append(tmp);
+ try (BufferedReader reader = Files.newBufferedReader(sqlFile.toPath(), StandardCharsets.UTF_8)) {
+ String line;
+ while ((line = reader.readLine()) != null) {
+ log.info("line: {}", line);
+ sb.append(line.trim());
+
+ if (line.trim().endsWith(";")) {
sqlList.add(sb.toString());
- sb.delete(0, sb.length());
+ // 清空 StringBuilder
+ sb.setLength(0);
} else {
- sb.append(tmp);
+ // 在行之间加一个空格
+ sb.append(" ");
}
}
- if (!"".endsWith(sb.toString().trim())) {
- sqlList.add(sb.toString());
+ if (sb.length() > 0) {
+ sqlList.add(sb.toString().trim());
}
+ } catch (Exception e) {
+ log.error("读取SQL文件时发生异常: {}", e.getMessage());
}
-
return sqlList;
}
@@ -228,5 +231,4 @@ public class SqlUtils {
}
return jdbcUrl;
}
-
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/MsgType.java
similarity index 90%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/MsgType.java
index 2fc473da..36853452 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/MsgType.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/MsgType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.websocket;
+package me.zhengjie.modules.maint.websocket;
/**
* @author ZhangHouYing
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/SocketMsg.java
similarity index 91%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/SocketMsg.java
index ade33a24..97fde3c6 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/SocketMsg.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/SocketMsg.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.websocket;
+package me.zhengjie.modules.maint.websocket;
import lombok.Data;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/WebSocketServer.java
similarity index 97%
rename from eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/WebSocketServer.java
index 000a5158..2441707f 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/websocket/WebSocketServer.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/maint/websocket/WebSocketServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.mnt.websocket;
+package me.zhengjie.modules.maint.websocket;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/config/JobRunner.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/config/JobRunner.java
index a5a9c91f..a82e978c 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/config/JobRunner.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/config/JobRunner.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/config/QuartzConfig.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/config/QuartzConfig.java
index d542a36a..afc9c3ce 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/config/QuartzConfig.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/config/QuartzConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzJob.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzJob.java
index 39e11f42..2b013fa4 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzJob.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzJob.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzLog.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzLog.java
index 4de57ec1..a5697778 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzLog.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/domain/QuartzLog.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzJobRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzJobRepository.java
index 79b222be..1334b581 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzJobRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzJobRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzLogRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzLogRepository.java
index db724aa4..9198a642 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzLogRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/repository/QuartzLogRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java
index e1f1a5de..3b4f096e 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import me.zhengjie.modules.quartz.domain.QuartzLog;
import me.zhengjie.modules.quartz.service.QuartzJobService;
import me.zhengjie.modules.quartz.service.dto.JobQueryCriteria;
import me.zhengjie.utils.PageResult;
-import me.zhengjie.utils.SpringContextHolder;
+import me.zhengjie.utils.SpringBeanHolder;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -126,7 +126,7 @@ public class QuartzJobController {
private void checkBean(String beanName){
// 避免调用攻击者可以从SpringContextHolder获得控制jdbcTemplate类
// 并使用getDeclaredMethod调用jdbcTemplate的queryForMap函数,执行任意sql命令。
- if(!SpringContextHolder.getAllServiceBeanName().contains(beanName)){
+ if(!SpringBeanHolder.getAllServiceBeanName().contains(beanName)){
throw new BadRequestException("非法的 Bean,请重新输入!");
}
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/QuartzJobService.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/QuartzJobService.java
index 2e93c7b8..0a6a109b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/QuartzJobService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/QuartzJobService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java
index 6cec0f19..bb2c67e5 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.quartz.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@@ -27,12 +28,15 @@ import java.util.List;
@Data
public class JobQueryCriteria {
+ @ApiModelProperty(value = "任务名称")
@Query(type = Query.Type.INNER_LIKE)
private String jobName;
@Query
+ @ApiModelProperty(value = "是否成功")
private Boolean isSuccess;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/QuartzJobServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/QuartzJobServiceImpl.java
index 06341e20..20707f07 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/QuartzJobServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/QuartzJobServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,6 @@ import me.zhengjie.modules.quartz.utils.QuartzManage;
import me.zhengjie.utils.*;
import org.quartz.CronExpression;
import org.springframework.data.domain.Pageable;
-import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
@@ -104,6 +103,7 @@ public class QuartzJobServiceImpl implements QuartzJobService {
@Override
public void updateIsPause(QuartzJob quartzJob) {
+ // 置换暂停状态
if (quartzJob.getIsPause()) {
quartzManage.resumeJob(quartzJob);
quartzJob.setIsPause(false);
@@ -129,7 +129,6 @@ public class QuartzJobServiceImpl implements QuartzJobService {
}
}
- @Async
@Override
@Transactional(rollbackFor = Exception.class)
public void executionSubJob(String[] tasks) throws InterruptedException {
@@ -145,11 +144,11 @@ public class QuartzJobServiceImpl implements QuartzJobService {
// 执行任务
execution(quartzJob);
// 获取执行状态,如果执行失败则停止后面的子任务执行
- Boolean result = (Boolean) redisUtils.get(uuid);
+ Boolean result = redisUtils.get(uuid, Boolean.class);
while (result == null) {
// 休眠5秒,再次获取子任务执行情况
Thread.sleep(5000);
- result = (Boolean) redisUtils.get(uuid);
+ result = redisUtils.get(uuid, Boolean.class);
}
if(!result){
redisUtils.del(uuid);
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/TestTask.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/TestTask.java
index 4cf34342..c530a007 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/TestTask.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/TestTask.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ public class TestTask {
}
public void run1(String str){
- log.info("run1 执行成功,参数为: {}" + str);
+ log.info("run1 执行成功,参数为: {}", str);
}
public void run2(){
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java
index 4de11205..28c3f64c 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,13 +26,12 @@ import me.zhengjie.modules.quartz.repository.QuartzLogRepository;
import me.zhengjie.modules.quartz.service.QuartzJobService;
import me.zhengjie.service.EmailService;
import me.zhengjie.utils.RedisUtils;
-import me.zhengjie.utils.SpringContextHolder;
+import me.zhengjie.utils.SpringBeanHolder;
import me.zhengjie.utils.StringUtils;
import me.zhengjie.utils.ThrowableUtil;
import org.quartz.JobExecutionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.scheduling.quartz.QuartzJobBean;
import java.util.*;
@@ -43,22 +42,23 @@ import java.util.concurrent.*;
* @author /
* @date 2019-01-07
*/
-@Async
public class ExecutionJob extends QuartzJobBean {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
+
// 此处仅供参考,可根据任务执行情况自定义线程池参数
- private final ThreadPoolTaskExecutor executor = SpringContextHolder.getBean("elAsync");
+ private final ThreadPoolTaskExecutor executor = SpringBeanHolder.getBean("taskAsync");
+
@Override
public void executeInternal(JobExecutionContext context) {
// 获取任务
QuartzJob quartzJob = (QuartzJob) context.getMergedJobDataMap().get(QuartzJob.JOB_KEY);
// 获取spring bean
- QuartzLogRepository quartzLogRepository = SpringContextHolder.getBean(QuartzLogRepository.class);
- QuartzJobService quartzJobService = SpringContextHolder.getBean(QuartzJobService.class);
- RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
+ QuartzLogRepository quartzLogRepository = SpringBeanHolder.getBean(QuartzLogRepository.class);
+ QuartzJobService quartzJobService = SpringBeanHolder.getBean(QuartzJobService.class);
+ RedisUtils redisUtils = SpringBeanHolder.getBean(RedisUtils.class);
String uuid = quartzJob.getUuid();
@@ -81,7 +81,7 @@ public class ExecutionJob extends QuartzJobBean {
}
// 任务状态
log.setIsSuccess(true);
- logger.info("任务执行成功,任务名称:" + quartzJob.getJobName() + ", 执行时间:" + times + "毫秒");
+ logger.info("任务执行成功,任务名称:{}, 执行时间:{}毫秒", quartzJob.getJobName(), times);
// 判断是否存在子任务
if(StringUtils.isNotBlank(quartzJob.getSubTask())){
String[] tasks = quartzJob.getSubTask().split("[,,]");
@@ -92,7 +92,7 @@ public class ExecutionJob extends QuartzJobBean {
if(StringUtils.isNotBlank(uuid)) {
redisUtils.set(uuid, false);
}
- logger.error("任务执行失败,任务名称:" + quartzJob.getJobName());
+ logger.error("任务执行失败,任务名称:{}", quartzJob.getJobName());
long times = System.currentTimeMillis() - startTime;
log.setTime(times);
// 任务状态 0:成功 1:失败
@@ -100,12 +100,12 @@ public class ExecutionJob extends QuartzJobBean {
log.setExceptionDetail(ThrowableUtil.getStackTrace(e));
// 任务如果失败了则暂停
if(quartzJob.getPauseAfterFailure() != null && quartzJob.getPauseAfterFailure()){
- quartzJob.setIsPause(false);
//更新状态
+ quartzJob.setIsPause(false);
quartzJobService.updateIsPause(quartzJob);
}
if(quartzJob.getEmail() != null){
- EmailService emailService = SpringContextHolder.getBean(EmailService.class);
+ EmailService emailService = SpringBeanHolder.getBean(EmailService.class);
// 邮箱报警
if(StringUtils.isNoneBlank(quartzJob.getEmail())){
EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e));
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzManage.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzManage.java
index 4dbac76b..e4620625 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzManage.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzManage.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java
index 31c3a0f8..a8f708dc 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/QuartzRunnable.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package me.zhengjie.modules.quartz.utils;
import lombok.extern.slf4j.Slf4j;
-import me.zhengjie.utils.SpringContextHolder;
+import me.zhengjie.utils.SpringBeanHolder;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ReflectionUtils;
import java.lang.reflect.Method;
@@ -35,7 +35,7 @@ public class QuartzRunnable implements Callable {
QuartzRunnable(String beanName, String methodName, String params)
throws NoSuchMethodException, SecurityException {
- this.target = SpringContextHolder.getBean(beanName);
+ this.target = SpringBeanHolder.getBean(beanName);
this.params = params;
if (StringUtils.isNotBlank(params)) {
this.method = target.getClass().getDeclaredMethod(methodName, String.class);
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/CaptchaConfig.java
similarity index 51%
rename from eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/security/config/CaptchaConfig.java
index 0201a13d..94fdf2ce 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginProperties.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/CaptchaConfig.java
@@ -13,89 +13,100 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.security.config.bean;
+package me.zhengjie.modules.security.config;
import com.wf.captcha.*;
import com.wf.captcha.base.Captcha;
import lombok.Data;
-import me.zhengjie.exception.BadConfigurationException;
+import lombok.Getter;
+import me.zhengjie.exception.BadRequestException;
+import me.zhengjie.modules.security.config.enums.LoginCodeEnum;
import me.zhengjie.utils.StringUtils;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
import java.awt.*;
-import java.util.Objects;
/**
- * 配置文件读取
- *
+ * 登录验证码配置信息
* @author liaojinlong
- * @date loginCode.length0loginCode.length0/6/10 17:loginCode.length6
+ * @date 2025-01-13
*/
@Data
-public class LoginProperties {
+@Configuration
+@ConfigurationProperties(prefix = "login.code")
+public class CaptchaConfig {
/**
- * 账号单用户 登录
+ * 验证码配置
*/
- private boolean singleLogin = false;
-
- private LoginCode loginCode;
-
- public static final String cacheKey = "user-login-cache:";
-
- public boolean isSingleLogin() {
- return singleLogin;
- }
+ @Getter
+ private LoginCodeEnum codeType;
/**
- * 获取验证码生产类
- *
- * @return /
+ * 验证码有效期 分钟
*/
- public Captcha getCaptcha() {
- if (Objects.isNull(loginCode)) {
- loginCode = new LoginCode();
- if (Objects.isNull(loginCode.getCodeType())) {
- loginCode.setCodeType(LoginCodeEnum.ARITHMETIC);
- }
- }
- return switchCaptcha(loginCode);
- }
+ private Long expiration = 5L;
+
+ /**
+ * 验证码内容长度
+ */
+ private int length = 4;
+
+ /**
+ * 验证码宽度
+ */
+ private int width = 111;
+
+ /**
+ * 验证码高度
+ */
+ private int height = 36;
+
+ /**
+ * 验证码字体
+ */
+ private String fontName;
+
+ /**
+ * 字体大小
+ */
+ private int fontSize = 25;
/**
* 依据配置信息生产验证码
- *
- * @param loginCode 验证码配置信息
* @return /
*/
- private Captcha switchCaptcha(LoginCode loginCode) {
+ public Captcha getCaptcha() {
Captcha captcha;
- switch (loginCode.getCodeType()) {
+ switch (codeType) {
case ARITHMETIC:
// 算术类型 https://gitee.com/whvse/EasyCaptcha
- captcha = new FixedArithmeticCaptcha(loginCode.getWidth(), loginCode.getHeight());
+ captcha = new FixedArithmeticCaptcha(width, height);
// 几位数运算,默认是两位
- captcha.setLen(loginCode.getLength());
+ captcha.setLen(length);
break;
case CHINESE:
- captcha = new ChineseCaptcha(loginCode.getWidth(), loginCode.getHeight());
- captcha.setLen(loginCode.getLength());
+ captcha = new ChineseCaptcha(width, height);
+ captcha.setLen(length);
break;
case CHINESE_GIF:
- captcha = new ChineseGifCaptcha(loginCode.getWidth(), loginCode.getHeight());
- captcha.setLen(loginCode.getLength());
+ captcha = new ChineseGifCaptcha(width, height);
+ captcha.setLen(length);
break;
case GIF:
- captcha = new GifCaptcha(loginCode.getWidth(), loginCode.getHeight());
- captcha.setLen(loginCode.getLength());
+ captcha = new GifCaptcha(width, height);
+ captcha.setLen(length);
break;
case SPEC:
- captcha = new SpecCaptcha(loginCode.getWidth(), loginCode.getHeight());
- captcha.setLen(loginCode.getLength());
+ captcha = new SpecCaptcha(width, height);
+ captcha.setLen(length);
break;
default:
- throw new BadConfigurationException("验证码配置信息错误!正确配置查看 LoginCodeEnum ");
+ throw new BadRequestException("验证码配置信息错误!正确配置查看 LoginCodeEnum ");
}
- if(StringUtils.isNotBlank(loginCode.getFontName())){
- captcha.setFont(new Font(loginCode.getFontName(), Font.PLAIN, loginCode.getFontSize()));
+ if(StringUtils.isNotBlank(fontName)){
+ captcha.setFont(new Font(fontName, Font.PLAIN, fontSize));
}
return captcha;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/ConfigBeanConfiguration.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/ConfigBeanConfiguration.java
deleted file mode 100644
index 8cbc88dd..00000000
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/ConfigBeanConfiguration.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2019-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package me.zhengjie.modules.security.config;
-
-import me.zhengjie.modules.security.config.bean.LoginProperties;
-import me.zhengjie.modules.security.config.bean.SecurityProperties;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @apiNote 配置文件转换Pojo类的 统一配置 类
- * @author: liaojinlong
- * @date: 2020/6/10 19:04
- */
-@Configuration
-public class ConfigBeanConfiguration {
-
- @Bean
- @ConfigurationProperties(prefix = "login")
- public LoginProperties loginProperties() {
- return new LoginProperties();
- }
-
- @Bean
- @ConfigurationProperties(prefix = "jwt")
- public SecurityProperties securityProperties() {
- return new SecurityProperties();
- }
-}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/LoginProperties.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/LoginProperties.java
new file mode 100644
index 00000000..b38aabdf
--- /dev/null
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/LoginProperties.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2019-2020 the original author or authors.
+ *
+ * Licensed under the Apache License, Version loginCode.length.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-loginCode.length.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package me.zhengjie.modules.security.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 配置文件读取
+ *
+ * @author liaojinlong
+ * @date loginCode.length0loginCode.length0/6/10 17:loginCode.length6
+ */
+@Data
+@Configuration
+@ConfigurationProperties(prefix = "login")
+public class LoginProperties {
+
+ /**
+ * 账号单用户 登录
+ */
+ private boolean singleLogin = false;
+
+ public static final String cacheKey = "user-login-cache:";
+}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/SecurityProperties.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityProperties.java
similarity index 84%
rename from eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/SecurityProperties.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityProperties.java
index 16ec3cf0..53e94528 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/SecurityProperties.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SecurityProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,9 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.security.config.bean;
+package me.zhengjie.modules.security.config;
import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
/**
* Jwt参数配置
@@ -24,6 +26,8 @@ import lombok.Data;
* @date 2019年11月28日
*/
@Data
+@Configuration
+@ConfigurationProperties(prefix = "jwt")
public class SecurityProperties {
/**
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SpringSecurityConfig.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SpringSecurityConfig.java
index ad886f31..1aaeacc4 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SpringSecurityConfig.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/SpringSecurityConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,11 +16,10 @@
package me.zhengjie.modules.security.config;
import lombok.RequiredArgsConstructor;
-import me.zhengjie.annotation.AnonymousAccess;
-import me.zhengjie.modules.security.config.bean.SecurityProperties;
import me.zhengjie.modules.security.security.*;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.modules.security.service.UserCacheManager;
+import me.zhengjie.utils.AnonTagUtils;
import me.zhengjie.utils.enums.RequestMethodEnum;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -34,12 +33,7 @@ import org.springframework.security.config.core.GrantedAuthorityDefaults;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.filter.CorsFilter;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
-import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import java.util.*;
/**
@@ -58,7 +52,6 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
private final ApplicationContext applicationContext;
private final SecurityProperties properties;
private final OnlineUserService onlineUserService;
- private final UserCacheManager userCacheManager;
@Bean
GrantedAuthorityDefaults grantedAuthorityDefaults() {
@@ -74,15 +67,12 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
- // 搜寻匿名标记 url: @AnonymousAccess
- RequestMappingHandlerMapping requestMappingHandlerMapping = (RequestMappingHandlerMapping) applicationContext.getBean("requestMappingHandlerMapping");
- Map handlerMethodMap = requestMappingHandlerMapping.getHandlerMethods();
// 获取匿名标记
- Map> anonymousUrls = getAnonymousUrl(handlerMethodMap);
+ Map> anonymousUrls = AnonTagUtils.getAnonymousUrl(applicationContext);
httpSecurity
// 禁用 CSRF
.csrf().disable()
- .addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class)
+ .addFilter(corsFilter)
// 授权异常
.exceptionHandling()
.authenticationEntryPoint(authenticationErrorHandler)
@@ -138,51 +128,6 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
}
private TokenConfigurer securityConfigurerAdapter() {
- return new TokenConfigurer(tokenProvider, properties, onlineUserService, userCacheManager);
- }
-
- private Map> getAnonymousUrl(Map handlerMethodMap) {
- Map> anonymousUrls = new HashMap<>(8);
- Set get = new HashSet<>();
- Set post = new HashSet<>();
- Set put = new HashSet<>();
- Set patch = new HashSet<>();
- Set delete = new HashSet<>();
- Set all = new HashSet<>();
- for (Map.Entry infoEntry : handlerMethodMap.entrySet()) {
- HandlerMethod handlerMethod = infoEntry.getValue();
- AnonymousAccess anonymousAccess = handlerMethod.getMethodAnnotation(AnonymousAccess.class);
- if (null != anonymousAccess) {
- List requestMethods = new ArrayList<>(infoEntry.getKey().getMethodsCondition().getMethods());
- RequestMethodEnum request = RequestMethodEnum.find(requestMethods.size() == 0 ? RequestMethodEnum.ALL.getType() : requestMethods.get(0).name());
- switch (Objects.requireNonNull(request)) {
- case GET:
- get.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
- break;
- case POST:
- post.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
- break;
- case PUT:
- put.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
- break;
- case PATCH:
- patch.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
- break;
- case DELETE:
- delete.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
- break;
- default:
- all.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
- break;
- }
- }
- }
- anonymousUrls.put(RequestMethodEnum.GET.getType(), get);
- anonymousUrls.put(RequestMethodEnum.POST.getType(), post);
- anonymousUrls.put(RequestMethodEnum.PUT.getType(), put);
- anonymousUrls.put(RequestMethodEnum.PATCH.getType(), patch);
- anonymousUrls.put(RequestMethodEnum.DELETE.getType(), delete);
- anonymousUrls.put(RequestMethodEnum.ALL.getType(), all);
- return anonymousUrls;
+ return new TokenConfigurer(tokenProvider, properties, onlineUserService);
}
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCode.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCode.java
deleted file mode 100644
index fefd252b..00000000
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCode.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2019-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package me.zhengjie.modules.security.config.bean;
-
-import lombok.Data;
-
-/**
- * 登录验证码配置信息
- *
- * @author liaojinlong
- * @date 2020/6/10 18:53
- */
-@Data
-public class LoginCode {
-
- /**
- * 验证码配置
- */
- private LoginCodeEnum codeType;
- /**
- * 验证码有效期 分钟
- */
- private Long expiration = 2L;
- /**
- * 验证码内容长度
- */
- private int length = 2;
- /**
- * 验证码宽度
- */
- private int width = 111;
- /**
- * 验证码高度
- */
- private int height = 36;
- /**
- * 验证码字体
- */
- private String fontName;
- /**
- * 字体大小
- */
- private int fontSize = 25;
-
- public LoginCodeEnum getCodeType() {
- return codeType;
- }
-}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCodeEnum.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/enums/LoginCodeEnum.java
similarity index 87%
rename from eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCodeEnum.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/security/config/enums/LoginCodeEnum.java
index 685ccbbb..f3ad553d 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/config/bean/LoginCodeEnum.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/config/enums/LoginCodeEnum.java
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.modules.security.config.bean;
+package me.zhengjie.modules.security.config.enums;
/**
* 验证码配置枚举
*
- * @author: liaojinlong
- * @date: 2020/6/10 17:40
+ * @author liaojinlong
+ * @date 2020/6/10 17:40
*/
public enum LoginCodeEnum {
@@ -39,5 +39,8 @@ public enum LoginCodeEnum {
* 闪图
*/
GIF,
+ /**
+ * 静态
+ */
SPEC
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthController.java
similarity index 75%
rename from eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java
rename to eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthController.java
index 89a6d665..2adb3da3 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,12 +25,14 @@ import me.zhengjie.annotation.Log;
import me.zhengjie.annotation.rest.AnonymousDeleteMapping;
import me.zhengjie.annotation.rest.AnonymousGetMapping;
import me.zhengjie.annotation.rest.AnonymousPostMapping;
-import me.zhengjie.config.RsaProperties;
+import me.zhengjie.config.properties.RsaProperties;
import me.zhengjie.exception.BadRequestException;
-import me.zhengjie.modules.security.config.bean.LoginCodeEnum;
-import me.zhengjie.modules.security.config.bean.LoginProperties;
-import me.zhengjie.modules.security.config.bean.SecurityProperties;
+import me.zhengjie.modules.security.config.CaptchaConfig;
+import me.zhengjie.modules.security.config.enums.LoginCodeEnum;
+import me.zhengjie.modules.security.config.LoginProperties;
+import me.zhengjie.modules.security.config.SecurityProperties;
import me.zhengjie.modules.security.security.TokenProvider;
+import me.zhengjie.modules.security.service.UserDetailsServiceImpl;
import me.zhengjie.modules.security.service.dto.AuthUserDto;
import me.zhengjie.modules.security.service.dto.JwtUserDto;
import me.zhengjie.modules.security.service.OnlineUserService;
@@ -41,13 +43,12 @@ import me.zhengjie.utils.StringUtils;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
@@ -63,14 +64,15 @@ import java.util.concurrent.TimeUnit;
@RequestMapping("/auth")
@RequiredArgsConstructor
@Api(tags = "系统:系统授权接口")
-public class AuthorizationController {
+public class AuthController {
private final SecurityProperties properties;
private final RedisUtils redisUtils;
private final OnlineUserService onlineUserService;
private final TokenProvider tokenProvider;
- private final AuthenticationManagerBuilder authenticationManagerBuilder;
- @Resource
- private LoginProperties loginProperties;
+ private final LoginProperties loginProperties;
+ private final CaptchaConfig captchaConfig;
+ private final PasswordEncoder passwordEncoder;
+ private final UserDetailsServiceImpl userDetailsService;
@Log("用户登录")
@ApiOperation("登录授权")
@@ -79,7 +81,7 @@ public class AuthorizationController {
// 密码解密
String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, authUser.getPassword());
// 查询验证码
- String code = (String) redisUtils.get(authUser.getUuid());
+ String code = redisUtils.get(authUser.getUuid(), String.class);
// 清除验证码
redisUtils.del(authUser.getUuid());
if (StringUtils.isBlank(code)) {
@@ -96,27 +98,29 @@ public class AuthorizationController {
errorData.put("status", 400);
return new ResponseEntity<>(errorData, HttpStatus.BAD_REQUEST);
}
- UsernamePasswordAuthenticationToken authenticationToken =
- new UsernamePasswordAuthenticationToken(authUser.getUsername(), password);
- Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
+ // 获取用户信息
+ JwtUserDto jwtUser = userDetailsService.loadUserByUsername(authUser.getUsername());
+ // 验证用户密码
+ if (!passwordEncoder.matches(password, jwtUser.getPassword())) {
+ throw new BadRequestException("登录密码错误");
+ }
+ Authentication authentication = new UsernamePasswordAuthenticationToken(jwtUser, null, jwtUser.getAuthorities());
SecurityContextHolder.getContext().setAuthentication(authentication);
- // 生成令牌与第三方系统获取令牌方式
- // UserDetails userDetails = userDetailsService.loadUserByUsername(userInfo.getUsername());
- // Authentication authentication = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.getAuthorities());
- // SecurityContextHolder.getContext().setAuthentication(authentication);
- String token = tokenProvider.createToken(authentication);
- final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal();
+ // 生成令牌
+ String token = tokenProvider.createToken(jwtUser);
+ // 将密码设置为空
+ jwtUser.setPassword(null);
// 返回 token 与 用户信息
Map authInfo = new HashMap(2) {{
put("token", properties.getTokenStartWith() + token);
- put("user", jwtUserDto);
+ put("user", jwtUser);
}};
if (loginProperties.isSingleLogin()) {
// 踢掉之前已经登录的token
onlineUserService.kickOutForUsername(authUser.getUsername());
}
// 保存在线信息
- onlineUserService.save(jwtUserDto, token, request);
+ onlineUserService.save(jwtUser, token, request);
// 返回登录信息
return ResponseEntity.ok(authInfo);
}
@@ -124,14 +128,17 @@ public class AuthorizationController {
@ApiOperation("获取用户信息")
@GetMapping(value = "/info")
public ResponseEntity getUserInfo() {
- return ResponseEntity.ok(SecurityUtils.getCurrentUser());
+ JwtUserDto jwtUser = (JwtUserDto) SecurityUtils.getCurrentUser();
+ // 将密码设置为空
+ jwtUser.setPassword(null);
+ return ResponseEntity.ok(jwtUser);
}
@ApiOperation("获取验证码")
@AnonymousGetMapping(value = "/code")
public ResponseEntity getCode() {
// 获取运算的结果
- Captcha captcha = loginProperties.getCaptcha();
+ Captcha captcha = captchaConfig.getCaptcha();
String uuid = properties.getCodeKey() + IdUtil.simpleUUID();
//当验证码类型为 arithmetic时且长度 >= 2 时,captcha.text()的结果有几率为浮点型
String captchaValue = captcha.text();
@@ -139,7 +146,7 @@ public class AuthorizationController {
captchaValue = captchaValue.split("\\.")[0];
}
// 保存
- redisUtils.set(uuid, captchaValue, loginProperties.getLoginCode().getExpiration(), TimeUnit.MINUTES);
+ redisUtils.set(uuid, captchaValue, captchaConfig.getExpiration(), TimeUnit.MINUTES);
// 验证码信息
Map imgResult = new HashMap(2) {{
put("img", captcha.toBase64());
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java
index 4ad447a6..829a9347 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAccessDeniedHandler.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAccessDeniedHandler.java
index 8b3f8c17..31165f78 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAccessDeniedHandler.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAccessDeniedHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,9 @@
*/
package me.zhengjie.modules.security.security;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import me.zhengjie.exception.handler.ApiError;
+import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;
@@ -32,6 +35,10 @@ public class JwtAccessDeniedHandler implements AccessDeniedHandler {
@Override
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException {
//当用户在没有授权的情况下访问受保护的REST资源时,将调用此方法发送403 Forbidden响应
- response.sendError(HttpServletResponse.SC_FORBIDDEN, accessDeniedException.getMessage());
+ response.setStatus(HttpStatus.FORBIDDEN.value());
+ response.setContentType("application/json;charset=UTF-8");
+ ObjectMapper objectMapper = new ObjectMapper();
+ String jsonResponse = objectMapper.writeValueAsString(ApiError.error(HttpStatus.FORBIDDEN.value(), "禁止访问,您没有权限访问此资源"));
+ response.getWriter().write(jsonResponse);
}
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAuthenticationEntryPoint.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAuthenticationEntryPoint.java
index f8815862..f6884f4e 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAuthenticationEntryPoint.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/security/JwtAuthenticationEntryPoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,10 +15,13 @@
*/
package me.zhengjie.modules.security.security;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import me.zhengjie.exception.handler.ApiError;
+import org.springframework.http.HttpStatus;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@@ -26,14 +29,18 @@ import java.io.IOException;
/**
* @author Zheng Jie
*/
+@Slf4j
@Component
public class JwtAuthenticationEntryPoint implements AuthenticationEntryPoint {
@Override
- public void commence(HttpServletRequest request,
- HttpServletResponse response,
- AuthenticationException authException) throws IOException {
+ public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException {
// 当用户尝试访问安全的REST资源而不提供任何凭据时,将调用此方法发送401 响应
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED, authException==null?"Unauthorized":authException.getMessage());
+ int code = HttpStatus.UNAUTHORIZED.value();
+ response.setStatus(code);
+ response.setContentType("application/json;charset=UTF-8");
+ ObjectMapper objectMapper = new ObjectMapper();
+ String jsonResponse = objectMapper.writeValueAsString(ApiError.error(HttpStatus.UNAUTHORIZED.value(), "登录状态已过期,请重新登录"));
+ response.getWriter().write(jsonResponse);
}
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/security/TokenConfigurer.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/security/TokenConfigurer.java
index cff5e1ed..da436904 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/security/TokenConfigurer.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/security/TokenConfigurer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package me.zhengjie.modules.security.security;
import lombok.RequiredArgsConstructor;
-import me.zhengjie.modules.security.config.bean.SecurityProperties;
+import me.zhengjie.modules.security.config.SecurityProperties;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.modules.security.service.UserCacheManager;
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
@@ -33,11 +33,10 @@ public class TokenConfigurer extends SecurityConfigurerAdapter claims = new HashMap<>(6);
+ // 设置用户ID
+ claims.put(AUTHORITIES_UID_KEY, user.getUser().getId());
+ // 设置UUID,确保每次Token不一样
+ claims.put(AUTHORITIES_UUID_KEY, IdUtil.simpleUUID());
return jwtBuilder
- // 加入ID确保生成的 Token 都不一致
- .setId(IdUtil.simpleUUID())
- .claim(AUTHORITIES_KEY, authentication.getName())
- .setSubject(authentication.getName())
+ .setClaims(claims)
+ .setSubject(user.getUsername())
.compact();
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/OnlineUserService.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/OnlineUserService.java
index d1fd765d..c27a554c 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/OnlineUserService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/OnlineUserService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,12 +19,11 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.security.security.TokenProvider;
import me.zhengjie.utils.PageResult;
-import me.zhengjie.modules.security.config.bean.SecurityProperties;
+import me.zhengjie.modules.security.config.SecurityProperties;
import me.zhengjie.modules.security.service.dto.JwtUserDto;
import me.zhengjie.modules.security.service.dto.OnlineUserDto;
import me.zhengjie.utils.*;
import org.springframework.data.domain.Pageable;
-import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -92,7 +91,7 @@ public class OnlineUserService {
Collections.reverse(keys);
List onlineUserDtos = new ArrayList<>();
for (String key : keys) {
- onlineUserDtos.add((OnlineUserDto) redisUtils.get(key));
+ onlineUserDtos.add(redisUtils.get(key, OnlineUserDto.class));
}
onlineUserDtos.sort((o1, o2) -> o2.getLoginTime().compareTo(o1.getLoginTime()));
return onlineUserDtos;
@@ -134,7 +133,7 @@ public class OnlineUserService {
* @return /
*/
public OnlineUserDto getOne(String key) {
- return (OnlineUserDto)redisUtils.get(key);
+ return redisUtils.get(key, OnlineUserDto.class);
}
/**
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserCacheManager.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserCacheManager.java
index 0808e65d..51b33537 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserCacheManager.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserCacheManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
package me.zhengjie.modules.security.service;
import cn.hutool.core.util.RandomUtil;
-import me.zhengjie.modules.security.config.bean.LoginProperties;
+import me.zhengjie.modules.security.config.LoginProperties;
import me.zhengjie.modules.security.service.dto.JwtUserDto;
import me.zhengjie.utils.RedisUtils;
import me.zhengjie.utils.StringUtils;
@@ -46,10 +46,7 @@ public class UserCacheManager {
public JwtUserDto getUserCache(String userName) {
if (StringUtils.isNotEmpty(userName)) {
// 获取数据
- Object obj = redisUtils.get(LoginProperties.cacheKey + userName);
- if(obj != null){
- return (JwtUserDto)obj;
- }
+ return redisUtils.get(LoginProperties.cacheKey + userName, JwtUserDto.class);
}
return null;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserDetailsServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserDetailsServiceImpl.java
index 70db5df0..75d1ce21 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserDetailsServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/UserDetailsServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,14 +18,12 @@ package me.zhengjie.modules.security.service;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.exception.BadRequestException;
-import me.zhengjie.exception.EntityNotFoundException;
import me.zhengjie.modules.security.service.dto.JwtUserDto;
import me.zhengjie.modules.system.service.DataService;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.UserService;
import me.zhengjie.modules.system.service.dto.UserLoginDto;
import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
/**
@@ -45,24 +43,14 @@ public class UserDetailsServiceImpl implements UserDetailsService {
public JwtUserDto loadUserByUsername(String username) {
JwtUserDto jwtUserDto = userCacheManager.getUserCache(username);
if(jwtUserDto == null){
- UserLoginDto user;
- try {
- user = userService.getLoginData(username);
- } catch (EntityNotFoundException e) {
- // SpringSecurity会自动转换UsernameNotFoundException为BadCredentialsException
- throw new UsernameNotFoundException(username, e);
- }
+ UserLoginDto user = userService.getLoginData(username);
if (user == null) {
- throw new UsernameNotFoundException("");
+ throw new BadRequestException("用户不存在");
} else {
if (!user.getEnabled()) {
throw new BadRequestException("账号未激活!");
}
- jwtUserDto = new JwtUserDto(
- user,
- dataService.getDeptIds(user),
- roleService.mapToGrantedAuthorities(user)
- );
+ jwtUserDto = new JwtUserDto(user, dataService.getDeptIds(user), roleService.buildAuthorities(user), user.getPassword());
// 添加缓存数据
userCacheManager.addUserCache(username, jwtUserDto);
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java
index 5219fc53..a34c83cd 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.security.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
@@ -28,12 +29,16 @@ import javax.validation.constraints.NotBlank;
public class AuthUserDto {
@NotBlank
+ @ApiModelProperty(value = "用户名")
private String username;
@NotBlank
+ @ApiModelProperty(value = "密码")
private String password;
+ @ApiModelProperty(value = "验证码")
private String code;
+ @ApiModelProperty(value = "验证码的key")
private String uuid = "";
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthorityDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthorityDto.java
index 888cceb6..824f9e77 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthorityDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthorityDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.security.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -30,5 +31,6 @@ import org.springframework.security.core.GrantedAuthority;
@AllArgsConstructor
public class AuthorityDto implements GrantedAuthority {
+ @ApiModelProperty(value = "角色名")
private String authority;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java
index 5aa0c45f..984c5191 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/JwtUserDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,8 +16,10 @@
package me.zhengjie.modules.security.service.dto;
import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
+import lombok.Setter;
import me.zhengjie.modules.system.service.dto.UserLoginDto;
import org.springframework.security.core.userdetails.UserDetails;
import java.util.List;
@@ -32,12 +34,19 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class JwtUserDto implements UserDetails {
+ @ApiModelProperty(value = "用户")
private final UserLoginDto user;
+ @ApiModelProperty(value = "数据权限")
private final List dataScopes;
+ @ApiModelProperty(value = "角色权限")
private final List authorities;
+ @Setter
+ @ApiModelProperty(value = "密码")
+ private String password;
+
public Set getRoles() {
return authorities.stream().map(AuthorityDto::getAuthority).collect(Collectors.toSet());
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/OnlineUserDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/OnlineUserDto.java
index 290ab6d6..826f203d 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/OnlineUserDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/OnlineUserDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.security.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -29,45 +30,27 @@ import java.util.Date;
@NoArgsConstructor
public class OnlineUserDto {
- /**
- * 用户名
- */
+ @ApiModelProperty(value = "用户名")
private String userName;
- /**
- * 昵称
- */
+ @ApiModelProperty(value = "昵称")
private String nickName;
- /**
- * 岗位
- */
+ @ApiModelProperty(value = "岗位")
private String dept;
- /**
- * 浏览器
- */
+ @ApiModelProperty(value = "浏览器")
private String browser;
- /**
- * IP
- */
+ @ApiModelProperty(value = "IP")
private String ip;
- /**
- * 地址
- */
+ @ApiModelProperty(value = "地址")
private String address;
- /**
- * token
- */
+ @ApiModelProperty(value = "token")
private String key;
- /**
- * 登录时间
- */
+ @ApiModelProperty(value = "登录时间")
private Date loginTime;
-
-
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java
index 9f28af21..3130f19f 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dept.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dict.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dict.java
index 689cf2e3..859daf78 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dict.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Dict.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/DictDetail.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/DictDetail.java
index 554dde61..5287c960 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/DictDetail.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/DictDetail.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Job.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Job.java
index f2d358a6..343411cb 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Job.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Job.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java
index b2ea225d..0e649670 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Menu.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Role.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Role.java
index d33d75c1..127a758d 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Role.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Role.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java
index b4d11bda..7e9b0aa6 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java
index 647baa88..a0a45fbf 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuMetaVo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.domain.vo;
+import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
@@ -27,9 +28,12 @@ import java.io.Serializable;
@AllArgsConstructor
public class MenuMetaVo implements Serializable {
+ @ApiModelProperty(value = "菜单标题")
private String title;
+ @ApiModelProperty(value = "菜单图标")
private String icon;
+ @ApiModelProperty(value = "缓存")
private Boolean noCache;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java
index e1efa5a8..d9c0aec1 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/MenuVo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.domain.vo;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@@ -27,19 +28,27 @@ import java.util.List;
@Data
public class MenuVo implements Serializable {
+ @ApiModelProperty(value = "菜单名称")
private String name;
+ @ApiModelProperty(value = "路径")
private String path;
+ @ApiModelProperty(value = "隐藏状态")
private Boolean hidden;
+ @ApiModelProperty(value = "重定向")
private String redirect;
+ @ApiModelProperty(value = "组件")
private String component;
+ @ApiModelProperty(value = "总是显示")
private Boolean alwaysShow;
+ @ApiModelProperty(value = "元数据")
private MenuMetaVo meta;
+ @ApiModelProperty(value = "子路由")
private List children;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/UserPassVo.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/UserPassVo.java
index fccb100f..4cb1e2cc 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/UserPassVo.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/vo/UserPassVo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.domain.vo;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@@ -25,7 +26,9 @@ import lombok.Data;
@Data
public class UserPassVo {
+ @ApiModelProperty(value = "旧密码")
private String oldPass;
+ @ApiModelProperty(value = "新密码")
private String newPass;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DeptRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DeptRepository.java
index 98583224..fa9ed98c 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DeptRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DeptRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictDetailRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictDetailRepository.java
index d80b9702..4b73eb7b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictDetailRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictDetailRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictRepository.java
index f09b6d1b..6622b428 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/DictRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java
index e39ebf00..3454efcb 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/JobRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/MenuRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/MenuRepository.java
index 75fd7ff5..56a84cdd 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/MenuRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/MenuRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/RoleRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/RoleRepository.java
index 8e76cc55..7e379329 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/RoleRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/RoleRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
index f7583b04..979f0f31 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java
index b1d81ef5..959619e2 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java
index b2b55b29..265860cb 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java
index 891d3730..d5b032c3 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java
index fa10176e..729bfc45 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/LimitController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/LimitController.java
index 02db642e..aa26d8c2 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/LimitController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/LimitController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java
index 96100394..bfcef213 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MonitorController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MonitorController.java
index bb0e39b4..b360f9fa 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MonitorController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MonitorController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java
index 1404c382..3c5ed0ca 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
index 045a4dc6..823d4023 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.utils.PageResult;
-import me.zhengjie.config.RsaProperties;
+import me.zhengjie.config.properties.RsaProperties;
import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.modules.system.service.DataService;
import me.zhengjie.modules.system.domain.User;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/VerifyController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/VerifyController.java
index 09ba44b0..b66da849 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/VerifyController.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/VerifyController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DataService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DataService.java
index 10258d99..77c7cd89 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DataService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DataService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DeptService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DeptService.java
index 902f6034..fdfe8da4 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DeptService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DeptService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictDetailService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictDetailService.java
index 7e2efb7f..ecbaa918 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictDetailService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictDetailService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictService.java
index 05077b7e..83569f9c 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/DictService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/JobService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/JobService.java
index dab9f586..5543ede6 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/JobService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/JobService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/MenuService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/MenuService.java
index 1116d10a..894849de 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/MenuService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/MenuService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/MonitorService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/MonitorService.java
index 478225ae..f7e34ad9 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/MonitorService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/MonitorService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/RoleService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/RoleService.java
index 6bc8cce7..8fc1be99 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/RoleService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/RoleService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -120,7 +120,7 @@ public interface RoleService {
* @param user 用户信息
* @return 权限信息
*/
- List mapToGrantedAuthorities(UserDto user);
+ List buildAuthorities(UserDto user);
/**
* 验证是否被用户关联
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/UserService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/UserService.java
index a3cc4f24..7ab5d41d 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/UserService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/UserService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/VerifyService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/VerifyService.java
index 4ca39b9d..cc4a6b5e 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/VerifyService.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/VerifyService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptDto.java
index bc236a11..1be9a60d 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -30,28 +31,38 @@ import java.util.Objects;
@Setter
public class DeptDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "名称")
private String name;
+ @ApiModelProperty(value = "是否启用")
private Boolean enabled;
+ @ApiModelProperty(value = "排序")
private Integer deptSort;
+ @ApiModelProperty(value = "子部门")
private List children;
+ @ApiModelProperty(value = "上级部门")
private Long pid;
+ @ApiModelProperty(value = "子部门数量", hidden = true)
private Integer subCount;
+ @ApiModelProperty(value = "是否有子节点")
public Boolean getHasChildren() {
return subCount > 0;
}
+ @ApiModelProperty(value = "是否为叶子")
public Boolean getLeaf() {
return subCount <= 0;
}
+ @ApiModelProperty(value = "部门全名")
public String getLabel() {
return name;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java
index 4d8cdf2a..900be67a 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.DataPermission;
import me.zhengjie.annotation.Query;
@@ -29,18 +30,23 @@ import java.util.List;
@DataPermission(fieldName = "id")
public class DeptQueryCriteria{
+ @ApiModelProperty(value = "名称")
@Query(type = Query.Type.INNER_LIKE)
private String name;
@Query
+ @ApiModelProperty(value = "是否启用")
private Boolean enabled;
@Query
+ @ApiModelProperty(value = "上级部门")
private Long pid;
+ @ApiModelProperty(value = "PID空查询", hidden = true)
@Query(type = Query.Type.IS_NULL, propName = "pid")
private Boolean pidIsNull;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptSmallDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptSmallDto.java
index 4dc64e58..1356d525 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptSmallDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptSmallDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@@ -25,7 +26,9 @@ import java.io.Serializable;
@Data
public class DeptSmallDto implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "名称")
private String name;
}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDto.java
index a4b931b6..75c0f48d 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -28,13 +29,18 @@ import java.io.Serializable;
@Setter
public class DictDetailDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "字典ID")
private DictSmallDto dict;
+ @ApiModelProperty(value = "字典标签")
private String label;
+ @ApiModelProperty(value = "字典值")
private String value;
+ @ApiModelProperty(value = "排序")
private Integer dictSort;
}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailQueryCriteria.java
index 91a01b1d..11e4e51b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
@@ -25,9 +26,11 @@ import me.zhengjie.annotation.Query;
@Data
public class DictDetailQueryCriteria {
+ @ApiModelProperty(value = "字典标签")
@Query(type = Query.Type.INNER_LIKE)
private String label;
+ @ApiModelProperty(value = "字典名称")
@Query(propName = "name",joinName = "dict")
private String dictName;
}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDto.java
index 048b4a19..bdec264f 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -29,11 +30,15 @@ import java.util.List;
@Setter
public class DictDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "字典详情")
private List dictDetails;
+ @ApiModelProperty(value = "名称")
private String name;
+ @ApiModelProperty(value = "描述")
private String description;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictQueryCriteria.java
index 7207c616..e9564631 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
@@ -25,6 +26,7 @@ import me.zhengjie.annotation.Query;
@Data
public class DictQueryCriteria {
+ @ApiModelProperty(value = "模糊查询")
@Query(blurry = "name,description")
private String blurry;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDto.java
index 98fc6eeb..7c16fdc3 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@@ -27,5 +28,6 @@ import java.io.Serializable;
@Setter
public class DictSmallDto implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java
index 8836d550..9852d3c2 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@@ -31,12 +32,16 @@ import java.io.Serializable;
@NoArgsConstructor
public class JobDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "岗位排序")
private Integer jobSort;
+ @ApiModelProperty(value = "名称")
private String name;
+ @ApiModelProperty(value = "是否启用")
private Boolean enabled;
public JobDto(String name, Boolean enabled) {
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java
index ee851dc6..90895c2b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.zhengjie.annotation.Query;
@@ -29,12 +30,15 @@ import java.util.List;
@NoArgsConstructor
public class JobQueryCriteria {
+ @ApiModelProperty(value = "岗位名称")
@Query(type = Query.Type.INNER_LIKE)
private String name;
@Query
+ @ApiModelProperty(value = "岗位状态")
private Boolean enabled;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java
index 09cfa624..50f04a54 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobSmallDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@@ -27,7 +28,9 @@ import java.io.Serializable;
@NoArgsConstructor
public class JobSmallDto implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "名称")
private String name;
}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuDto.java
index d60dd290..d086c621 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -30,44 +31,62 @@ import java.util.Objects;
@Setter
public class MenuDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "子节点")
private List children;
+ @ApiModelProperty(value = "类型")
private Integer type;
+ @ApiModelProperty(value = "权限")
private String permission;
+ @ApiModelProperty(value = "菜单标题")
private String title;
+ @ApiModelProperty(value = "排序")
private Integer menuSort;
+ @ApiModelProperty(value = "路径")
private String path;
+ @ApiModelProperty(value = "组件")
private String component;
+ @ApiModelProperty(value = "PID")
private Long pid;
+ @ApiModelProperty(value = "子节点数目")
private Integer subCount;
+ @ApiModelProperty(value = "是否为Iframe")
private Boolean iFrame;
+ @ApiModelProperty(value = "是否缓存")
private Boolean cache;
+ @ApiModelProperty(value = "是否隐藏")
private Boolean hidden;
+ @ApiModelProperty(value = "组件名称")
private String componentName;
+ @ApiModelProperty(value = "图标")
private String icon;
+ @ApiModelProperty(value = "是否存在子节点")
public Boolean getHasChildren() {
return subCount > 0;
}
+ @ApiModelProperty(value = "是否叶子节点")
public Boolean getLeaf() {
return subCount <= 0;
}
+ @ApiModelProperty(value = "标题")
public String getLabel() {
return title;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java
index bd43e8db..79027d52 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.sql.Timestamp;
@@ -27,15 +28,19 @@ import java.util.List;
@Data
public class MenuQueryCriteria {
+ @ApiModelProperty(value = "模糊查询")
@Query(blurry = "title,component,permission")
private String blurry;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
+ @ApiModelProperty(value = "PID空查询", hidden = true)
@Query(type = Query.Type.IS_NULL, propName = "pid")
private Boolean pidIsNull;
@Query
+ @ApiModelProperty(value = "PID")
private Long pid;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleDto.java
index fc74d84b..5db3fd53 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -30,18 +31,25 @@ import java.util.Set;
@Setter
public class RoleDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "菜单")
private Set menus;
+ @ApiModelProperty(value = "部门")
private Set depts;
+ @ApiModelProperty(value = "名称")
private String name;
+ @ApiModelProperty(value = "数据权限")
private String dataScope;
+ @ApiModelProperty(value = "级别")
private Integer level;
+ @ApiModelProperty(value = "描述")
private String description;
@Override
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java
index 5454fc44..bfdbcf06 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
@@ -28,9 +29,11 @@ import java.util.List;
@Data
public class RoleQueryCriteria {
+ @ApiModelProperty(value = "模糊查询")
@Query(blurry = "name,description")
private String blurry;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleSmallDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleSmallDto.java
index 99215e63..d026ff34 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleSmallDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleSmallDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@@ -25,11 +26,15 @@ import java.io.Serializable;
@Data
public class RoleSmallDto implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "名称")
private String name;
+ @ApiModelProperty(value = "级别")
private Integer level;
+ @ApiModelProperty(value = "数据权限")
private String dataScope;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java
index 923e2d42..e27695aa 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package me.zhengjie.modules.system.service.dto;
import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -31,37 +32,53 @@ import java.util.Set;
@Setter
public class UserDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "角色")
private Set roles;
+ @ApiModelProperty(value = "岗位")
private Set jobs;
+ @ApiModelProperty(value = "部门")
private DeptSmallDto dept;
+ @ApiModelProperty(value = "部门ID")
private Long deptId;
+ @ApiModelProperty(value = "用户名")
private String username;
+ @ApiModelProperty(value = "昵称")
private String nickName;
+ @ApiModelProperty(value = "邮箱")
private String email;
+ @ApiModelProperty(value = "电话")
private String phone;
+ @ApiModelProperty(value = "性别")
private String gender;
+ @ApiModelProperty(value = "头像")
private String avatarName;
+ @ApiModelProperty(value = "头像路径")
private String avatarPath;
+ @ApiModelProperty(value = "密码")
@JSONField(serialize = false)
private String password;
+ @ApiModelProperty(value = "是否启用")
private Boolean enabled;
+ @ApiModelProperty(value = "管理员")
@JSONField(serialize = false)
private Boolean isAdmin = false;
+ @ApiModelProperty(value = "密码重置时间")
private Date pwdResetTime;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserLoginDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserLoginDto.java
index 13a51f77..b4f36210 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserLoginDto.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserLoginDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,9 @@
*/
package me.zhengjie.modules.system.service.dto;
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+
/**
* @author Zheng Jie
* @description 用户缓存时使用
@@ -22,7 +25,10 @@ package me.zhengjie.modules.system.service.dto;
**/
public class UserLoginDto extends UserDto {
+ @ApiModelProperty(value = "密码")
+ @JSONField(serialize = false)
private String password;
+ @ApiModelProperty(value = "是否为管理员")
private Boolean isAdmin;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java
index ad8e7755..e1da3434 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
import java.io.Serializable;
@@ -31,19 +32,25 @@ import java.util.Set;
public class UserQueryCriteria implements Serializable {
@Query
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "部门ID集合")
@Query(propName = "id", type = Query.Type.IN, joinName = "dept")
private Set deptIds = new HashSet<>();
+ @ApiModelProperty(value = "模糊查询")
@Query(blurry = "email,username,nickName")
private String blurry;
@Query
+ @ApiModelProperty(value = "是否启用")
private Boolean enabled;
+ @ApiModelProperty(value = "部门ID")
private Long deptId;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DataServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DataServiceImpl.java
index 782fbd8f..66daee94 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DataServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DataServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.impl;
+import cn.hutool.core.collection.CollUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.modules.system.service.DataService;
@@ -22,23 +23,23 @@ import me.zhengjie.modules.system.service.DeptService;
import me.zhengjie.modules.system.service.RoleService;
import me.zhengjie.modules.system.service.dto.RoleSmallDto;
import me.zhengjie.modules.system.service.dto.UserDto;
+import me.zhengjie.utils.CacheKey;
+import me.zhengjie.utils.RedisUtils;
import me.zhengjie.utils.enums.DataScopeEnum;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.*;
+import java.util.concurrent.TimeUnit;
/**
* @author Zheng Jie
- * @website https://eladmin.vip
* @description 数据权限服务实现
* @date 2020-05-07
**/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "data")
public class DataServiceImpl implements DataService {
+ private final RedisUtils redisUtils;
private final RoleService roleService;
private final DeptService deptService;
@@ -48,27 +49,32 @@ public class DataServiceImpl implements DataService {
* @return /
*/
@Override
- @Cacheable(key = "'user:' + #p0.id")
public List getDeptIds(UserDto user) {
- // 用于存储部门id
- Set deptIds = new HashSet<>();
- // 查询用户角色
- List roleSet = roleService.findByUsersId(user.getId());
- // 获取对应的部门ID
- for (RoleSmallDto role : roleSet) {
- DataScopeEnum dataScopeEnum = DataScopeEnum.find(role.getDataScope());
- switch (Objects.requireNonNull(dataScopeEnum)) {
- case THIS_LEVEL:
- deptIds.add(user.getDept().getId());
- break;
- case CUSTOMIZE:
- deptIds.addAll(getCustomize(deptIds, role));
- break;
- default:
- return new ArrayList<>();
+ String key = CacheKey.DATA_USER + user.getId();
+ List ids = redisUtils.getList(key, Long.class);
+ if (CollUtil.isEmpty(ids)) {
+ // 用于存储部门id
+ Set deptIds = new HashSet<>();
+ // 查询用户角色
+ List roleSet = roleService.findByUsersId(user.getId());
+ // 获取对应的部门ID
+ for (RoleSmallDto role : roleSet) {
+ DataScopeEnum dataScopeEnum = DataScopeEnum.find(role.getDataScope());
+ switch (Objects.requireNonNull(dataScopeEnum)) {
+ case THIS_LEVEL:
+ deptIds.add(user.getDept().getId());
+ break;
+ case CUSTOMIZE:
+ deptIds.addAll(getCustomize(deptIds, role));
+ break;
+ default:
+ return new ArrayList<>();
+ }
}
+ ids = new ArrayList<>(deptIds);
+ redisUtils.set(key, ids, 1, TimeUnit.DAYS);
}
- return new ArrayList<>(deptIds);
+ return new ArrayList<>(ids);
}
/**
@@ -82,7 +88,7 @@ public class DataServiceImpl implements DataService {
for (Dept dept : depts) {
deptIds.add(dept.getId());
List deptChildren = deptService.findByPid(dept.getId());
- if (deptChildren != null && deptChildren.size() != 0) {
+ if (CollUtil.isNotEmpty(deptChildren)) {
deptIds.addAll(deptService.getDeptChildren(deptChildren));
}
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java
index a02bd699..0847dd9b 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DeptServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.impl;
+import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
@@ -30,8 +31,6 @@ import me.zhengjie.modules.system.repository.DeptRepository;
import me.zhengjie.modules.system.service.DeptService;
import me.zhengjie.modules.system.service.mapstruct.DeptMapper;
import me.zhengjie.utils.enums.DataScopeEnum;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -39,6 +38,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.*;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@@ -47,7 +47,6 @@ import java.util.stream.Collectors;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "dept")
public class DeptServiceImpl implements DeptService {
private final DeptRepository deptRepository;
@@ -88,10 +87,14 @@ public class DeptServiceImpl implements DeptService {
}
@Override
- @Cacheable(key = "'id:' + #p0")
public DeptDto findById(Long id) {
- Dept dept = deptRepository.findById(id).orElseGet(Dept::new);
- ValidationUtil.isNull(dept.getId(),"Dept","id",id);
+ String key = CacheKey.DEPT_ID + id;
+ Dept dept = redisUtils.get(key, Dept.class);
+ if(dept == null){
+ dept = deptRepository.findById(id).orElseGet(Dept::new);
+ ValidationUtil.isNull(dept.getId(),"Dept","id",id);
+ redisUtils.set(key, dept, 1, TimeUnit.DAYS);
+ }
return deptMapper.toDto(dept);
}
@@ -166,7 +169,7 @@ public class DeptServiceImpl implements DeptService {
for (Dept dept : menuList) {
deptDtos.add(deptMapper.toDto(dept));
List depts = deptRepository.findByPid(dept.getId());
- if(depts!=null && depts.size()!=0){
+ if(CollUtil.isNotEmpty(depts)){
getDeleteDepts(depts, deptDtos);
}
}
@@ -179,7 +182,7 @@ public class DeptServiceImpl implements DeptService {
deptList.forEach(dept -> {
if (dept!=null && dept.getEnabled()) {
List depts = deptRepository.findByPid(dept.getId());
- if (depts.size() != 0) {
+ if (CollUtil.isNotEmpty(depts)) {
list.addAll(getDeptChildren(depts));
}
list.add(dept.getId());
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DictDetailServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DictDetailServiceImpl.java
index 5da4d056..2a008457 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DictDetailServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DictDetailServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.impl;
+import cn.hutool.core.collection.CollUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.utils.PageResult;
import me.zhengjie.modules.system.domain.Dict;
@@ -26,13 +27,12 @@ import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.service.DictDetailService;
import me.zhengjie.modules.system.service.dto.DictDetailDto;
import me.zhengjie.modules.system.service.mapstruct.DictDetailMapper;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
+import java.util.concurrent.TimeUnit;
/**
* @author Zheng Jie
@@ -40,7 +40,6 @@ import java.util.List;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "dict")
public class DictDetailServiceImpl implements DictDetailService {
private final DictRepository dictRepository;
@@ -74,9 +73,14 @@ public class DictDetailServiceImpl implements DictDetailService {
}
@Override
- @Cacheable(key = "'name:' + #p0")
public List getDictByName(String name) {
- return dictDetailMapper.toDto(dictDetailRepository.findByDictName(name));
+ String key = CacheKey.DICT_NAME + name;
+ List dictDetails = redisUtils.getList(key, DictDetail.class);
+ if(CollUtil.isEmpty(dictDetails)){
+ dictDetails = dictDetailRepository.findByDictName(name);
+ redisUtils.set(key, dictDetails, 1 , TimeUnit.DAYS);
+ }
+ return dictDetailMapper.toDto(dictDetails);
}
@Override
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DictServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DictServiceImpl.java
index 68265121..042200d0 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DictServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/DictServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@ import me.zhengjie.modules.system.repository.DictRepository;
import me.zhengjie.modules.system.service.DictService;
import me.zhengjie.modules.system.service.dto.DictDto;
import me.zhengjie.modules.system.service.mapstruct.DictMapper;
-import org.springframework.cache.annotation.CacheConfig;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -41,7 +40,6 @@ import java.util.*;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "dict")
public class DictServiceImpl implements DictService {
private final DictRepository dictRepository;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java
index a608b97a..e6646c29 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/JobServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,9 +27,6 @@ import me.zhengjie.modules.system.repository.JobRepository;
import me.zhengjie.modules.system.service.JobService;
import me.zhengjie.modules.system.service.dto.JobDto;
import me.zhengjie.modules.system.service.mapstruct.JobMapper;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -37,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
+import java.util.concurrent.TimeUnit;
/**
* @author Zheng Jie
@@ -44,7 +42,6 @@ import java.util.*;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "job")
public class JobServiceImpl implements JobService {
private final JobRepository jobRepository;
@@ -65,10 +62,14 @@ public class JobServiceImpl implements JobService {
}
@Override
- @Cacheable(key = "'id:' + #p0")
public JobDto findById(Long id) {
- Job job = jobRepository.findById(id).orElseGet(Job::new);
- ValidationUtil.isNull(job.getId(),"Job","id",id);
+ String key = CacheKey.JOB_ID + id;
+ Job job = redisUtils.get(key, Job.class);
+ if(job == null){
+ job = jobRepository.findById(id).orElseGet(Job::new);
+ ValidationUtil.isNull(job.getId(),"Job","id",id);
+ redisUtils.set(key, job, 1, TimeUnit.DAYS);
+ }
return jobMapper.toDto(job);
}
@@ -83,7 +84,6 @@ public class JobServiceImpl implements JobService {
}
@Override
- @CacheEvict(key = "'id:' + #p0.id")
@Transactional(rollbackFor = Exception.class)
public void update(Job resources) {
Job job = jobRepository.findById(resources.getId()).orElseGet(Job::new);
@@ -94,6 +94,8 @@ public class JobServiceImpl implements JobService {
ValidationUtil.isNull( job.getId(),"Job","id",resources.getId());
resources.setId(job.getId());
jobRepository.save(resources);
+ // 删除缓存
+ delCaches(resources.getId());
}
@Override
@@ -123,4 +125,12 @@ public class JobServiceImpl implements JobService {
throw new BadRequestException("所选的岗位中存在用户关联,请解除关联再试!");
}
}
+
+ /**
+ * 删除缓存
+ * @param id /
+ */
+ public void delCaches(Long id){
+ redisUtils.del(CacheKey.JOB_ID + id);
+ }
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java
index ca8297e7..ae328c02 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MenuServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.impl;
+import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
@@ -34,8 +35,6 @@ import me.zhengjie.modules.system.service.dto.MenuQueryCriteria;
import me.zhengjie.modules.system.service.dto.RoleSmallDto;
import me.zhengjie.modules.system.service.mapstruct.MenuMapper;
import me.zhengjie.utils.*;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -43,6 +42,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.*;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@@ -50,7 +50,6 @@ import java.util.stream.Collectors;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "menu")
public class MenuServiceImpl implements MenuService {
private final MenuRepository menuRepository;
@@ -88,10 +87,14 @@ public class MenuServiceImpl implements MenuService {
}
@Override
- @Cacheable(key = "'id:' + #p0")
public MenuDto findById(long id) {
- Menu menu = menuRepository.findById(id).orElseGet(Menu::new);
- ValidationUtil.isNull(menu.getId(),"Menu","id",id);
+ String key = CacheKey.MENU_ID + id;
+ Menu menu = redisUtils.get(key, Menu.class);
+ if(menu == null){
+ menu = menuRepository.findById(id).orElseGet(Menu::new);
+ ValidationUtil.isNull(menu.getId(),"Menu","id",id);
+ redisUtils.set(key, menu, 1, TimeUnit.DAYS);
+ }
return menuMapper.toDto(menu);
}
@@ -101,11 +104,16 @@ public class MenuServiceImpl implements MenuService {
* @return /
*/
@Override
- @Cacheable(key = "'user:' + #p0")
public List findByUser(Long currentUserId) {
- List roles = roleService.findByUsersId(currentUserId);
- Set roleIds = roles.stream().map(RoleSmallDto::getId).collect(Collectors.toSet());
- LinkedHashSet menus = menuRepository.findByRoleIdsAndTypeNot(roleIds, 2);
+ String key = CacheKey.MENU_USER + currentUserId;
+ List menus = redisUtils.getList(key, Menu.class);
+ if (CollUtil.isEmpty(menus)){
+ List roles = roleService.findByUsersId(currentUserId);
+ Set roleIds = roles.stream().map(RoleSmallDto::getId).collect(Collectors.toSet());
+ LinkedHashSet data = menuRepository.findByRoleIdsAndTypeNot(roleIds, 2);
+ menus = new ArrayList<>(data);
+ redisUtils.set(key, menus, 1, TimeUnit.DAYS);
+ }
return menus.stream().map(menuMapper::toDto).collect(Collectors.toList());
}
@@ -194,7 +202,7 @@ public class MenuServiceImpl implements MenuService {
for (Menu menu : menuList) {
menuSet.add(menu);
List menus = menuRepository.findByPidOrderByMenuSort(menu.getId());
- if(menus!=null && menus.size()!=0){
+ if(CollUtil.isNotEmpty(menus)){
getChildMenus(menus, menuSet);
}
}
@@ -252,7 +260,7 @@ public class MenuServiceImpl implements MenuService {
}
}
}
- if(trees.size() == 0){
+ if(trees.isEmpty()){
trees = menuDtos.stream().filter(s -> !ids.contains(s.getId())).collect(Collectors.toList());
}
return trees;
@@ -287,16 +295,7 @@ public class MenuServiceImpl implements MenuService {
menuVo.setChildren(buildMenus(menuDtoList));
// 处理是一级菜单并且没有子菜单的情况
} else if(menuDTO.getPid() == null){
- MenuVo menuVo1 = new MenuVo();
- menuVo1.setMeta(menuVo.getMeta());
- // 非外链
- if(!menuDTO.getIFrame()){
- menuVo1.setPath("index");
- menuVo1.setName(menuVo.getName());
- menuVo1.setComponent(menuVo.getComponent());
- } else {
- menuVo1.setPath(menuDTO.getPath());
- }
+ MenuVo menuVo1 = getMenuVo(menuDTO, menuVo);
menuVo.setName(null);
menuVo.setMeta(null);
menuVo.setComponent("Layout");
@@ -356,4 +355,24 @@ public class MenuServiceImpl implements MenuService {
}});
redisUtils.delByKeys(CacheKey.ROLE_ID, roles.stream().map(Role::getId).collect(Collectors.toSet()));
}
+
+ /**
+ * 构建前端路由
+ * @param menuDTO /
+ * @param menuVo /
+ * @return /
+ */
+ private static MenuVo getMenuVo(MenuDto menuDTO, MenuVo menuVo) {
+ MenuVo menuVo1 = new MenuVo();
+ menuVo1.setMeta(menuVo.getMeta());
+ // 非外链
+ if(!menuDTO.getIFrame()){
+ menuVo1.setPath("index");
+ menuVo1.setName(menuVo.getName());
+ menuVo1.setComponent(menuVo.getComponent());
+ } else {
+ menuVo1.setPath(menuDTO.getPath());
+ }
+ return menuVo1;
+ }
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MonitorServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MonitorServiceImpl.java
index aa06c91a..a5995345 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MonitorServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/MonitorServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@ package me.zhengjie.modules.system.service.impl;
import cn.hutool.core.date.BetweenFormatter.Level;
import cn.hutool.core.date.DateUtil;
+import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.system.service.MonitorService;
import me.zhengjie.utils.ElConstant;
import me.zhengjie.utils.FileUtil;
@@ -37,6 +38,7 @@ import java.util.*;
* @author Zheng Jie
* @date 2020-05-02
*/
+@Slf4j
@Service
public class MonitorServiceImpl implements MonitorService {
@@ -61,7 +63,7 @@ public class MonitorServiceImpl implements MonitorService {
resultMap.put("disk", getDiskInfo(os));
resultMap.put("time", DateUtil.format(new Date(), "HH:mm:ss"));
} catch (Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
return resultMap;
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java
index e416aa89..f43096f4 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/RoleServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.modules.system.service.impl;
+import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
@@ -34,8 +35,6 @@ import me.zhengjie.modules.system.service.dto.UserDto;
import me.zhengjie.modules.system.service.mapstruct.RoleMapper;
import me.zhengjie.modules.system.service.mapstruct.RoleSmallMapper;
import me.zhengjie.utils.*;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
@@ -44,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@@ -52,7 +52,6 @@ import java.util.stream.Collectors;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "role")
public class RoleServiceImpl implements RoleService {
private final RoleRepository roleRepository;
@@ -80,11 +79,14 @@ public class RoleServiceImpl implements RoleService {
}
@Override
- @Cacheable(key = "'id:' + #p0")
- @Transactional(rollbackFor = Exception.class)
public RoleDto findById(long id) {
- Role role = roleRepository.findById(id).orElseGet(Role::new);
- ValidationUtil.isNull(role.getId(), "Role", "id", id);
+ String key = CacheKey.ROLE_ID + id;
+ Role role = redisUtils.get(key, Role.class);
+ if (role == null) {
+ role = roleRepository.findById(id).orElseGet(Role::new);
+ ValidationUtil.isNull(role.getId(), "Role", "id", id);
+ redisUtils.set(key, role, 1, TimeUnit.DAYS);
+ }
return roleMapper.toDto(role);
}
@@ -152,7 +154,7 @@ public class RoleServiceImpl implements RoleService {
@Override
public Integer findByRoles(Set roles) {
- if (roles.size() == 0) {
+ if (roles.isEmpty()) {
return Integer.MAX_VALUE;
}
Set roleDtos = new HashSet<>();
@@ -163,21 +165,26 @@ public class RoleServiceImpl implements RoleService {
}
@Override
- @Cacheable(key = "'auth:' + #p0.id")
- public List mapToGrantedAuthorities(UserDto user) {
- Set permissions = new HashSet<>();
- // 如果是管理员直接返回
- if (user.getIsAdmin()) {
- permissions.add("admin");
- return permissions.stream().map(AuthorityDto::new)
+ public List buildAuthorities(UserDto user) {
+ String key = CacheKey.ROLE_AUTH + user.getId();
+ List authorityDtos = redisUtils.getList(key, AuthorityDto.class);
+ if (CollUtil.isEmpty(authorityDtos)) {
+ Set permissions = new HashSet<>();
+ // 如果是管理员直接返回
+ if (user.getIsAdmin()) {
+ permissions.add("admin");
+ return permissions.stream().map(AuthorityDto::new)
+ .collect(Collectors.toList());
+ }
+ Set roles = roleRepository.findByUserId(user.getId());
+ permissions = roles.stream().flatMap(role -> role.getMenus().stream())
+ .map(Menu::getPermission)
+ .filter(StringUtils::isNotBlank).collect(Collectors.toSet());
+ authorityDtos = permissions.stream().map(AuthorityDto::new)
.collect(Collectors.toList());
+ redisUtils.set(key, authorityDtos, 1, TimeUnit.HOURS);
}
- Set roles = roleRepository.findByUserId(user.getId());
- permissions = roles.stream().flatMap(role -> role.getMenus().stream())
- .map(Menu::getPermission)
- .filter(StringUtils::isNotBlank).collect(Collectors.toSet());
- return permissions.stream().map(AuthorityDto::new)
- .collect(Collectors.toList());
+ return authorityDtos;
}
@Override
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
index 9a6e543b..d4a3d4a7 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package me.zhengjie.modules.system.service.impl;
import lombok.RequiredArgsConstructor;
import me.zhengjie.utils.PageResult;
-import me.zhengjie.config.FileProperties;
+import me.zhengjie.config.properties.FileProperties;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.modules.security.service.UserCacheManager;
@@ -30,8 +30,6 @@ import me.zhengjie.modules.system.service.dto.*;
import me.zhengjie.modules.system.service.mapstruct.UserLoginMapper;
import me.zhengjie.modules.system.service.mapstruct.UserMapper;
import me.zhengjie.utils.*;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
@@ -42,6 +40,7 @@ import javax.validation.constraints.NotBlank;
import java.io.File;
import java.io.IOException;
import java.util.*;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
@@ -50,7 +49,6 @@ import java.util.stream.Collectors;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "user")
public class UserServiceImpl implements UserService {
private final UserRepository userRepository;
@@ -74,11 +72,15 @@ public class UserServiceImpl implements UserService {
}
@Override
- @Cacheable(key = "'id:' + #p0")
@Transactional(rollbackFor = Exception.class)
public UserDto findById(long id) {
- User user = userRepository.findById(id).orElseGet(User::new);
- ValidationUtil.isNull(user.getId(), "User", "id", id);
+ String key = CacheKey.USER_ID + id;
+ User user = redisUtils.get(key, User.class);
+ if (user == null) {
+ user = userRepository.findById(id).orElseGet(User::new);
+ ValidationUtil.isNull(user.getId(), "User", "id", id);
+ redisUtils.set(key, user, 1, TimeUnit.DAYS);
+ }
return userMapper.toDto(user);
}
@@ -183,7 +185,7 @@ public class UserServiceImpl implements UserService {
public UserLoginDto getLoginData(String userName) {
User user = userRepository.findByUsername(userName);
if (user == null) {
- throw new EntityNotFoundException(User.class, "name", userName);
+ return null;
} else {
return userLoginMapper.toDto(user);
}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/VerifyServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/VerifyServiceImpl.java
index 9f8c8ac5..ead7ba5a 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/VerifyServiceImpl.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/VerifyServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public class VerifyServiceImpl implements VerifyService {
// 如果不存在有效的验证码,就创建一个新的
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
Template template = engine.getTemplate("email.ftl");
- Object oldCode = redisUtils.get(redisKey);
+ String oldCode = redisUtils.get(redisKey, String.class);
if(oldCode == null){
String code = RandomUtil.randomNumbers (6);
// 存入缓存
@@ -60,19 +60,18 @@ public class VerifyServiceImpl implements VerifyService {
throw new BadRequestException("服务异常,请联系网站负责人");
}
content = template.render(Dict.create().set("code",code));
- emailVo = new EmailVo(Collections.singletonList(email),"ELADMIN后台管理系统",content);
- // 存在就再次发送原来的验证码
+ // 存在就再次发送原来的验证码
} else {
content = template.render(Dict.create().set("code",oldCode));
- emailVo = new EmailVo(Collections.singletonList(email),"ELADMIN后台管理系统",content);
}
+ emailVo = new EmailVo(Collections.singletonList(email),"ELADMIN后台管理系统",content);
return emailVo;
}
@Override
public void validated(String key, String code) {
- Object value = redisUtils.get(key);
- if(value == null || !value.toString().equals(code)){
+ String value = redisUtils.get(key, String.class);
+ if(!code.equals(value)){
throw new BadRequestException("无效验证码");
} else {
redisUtils.del(key);
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptMapper.java
index b0fb9049..21c19763 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptSmallMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptSmallMapper.java
index 75076001..5b3ba63a 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptSmallMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DeptSmallMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictDetailMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictDetailMapper.java
index 3f9fe84e..52b4020e 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictDetailMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictDetailMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictMapper.java
index 1047b3bb..58818acd 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictSmallMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictSmallMapper.java
index 80ccc4e3..a9707c59 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictSmallMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/DictSmallMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java
index 37719302..1012ab6a 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java
index 36a59cf3..b5ad149e 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/JobSmallMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/MenuMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/MenuMapper.java
index 6d8bffab..666cd6fd 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/MenuMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/MenuMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleMapper.java
index 5dc551df..fdabbe8c 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleSmallMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleSmallMapper.java
index db034b5c..dd8e9586 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleSmallMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/RoleSmallMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserLoginMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserLoginMapper.java
index fbb88139..19b77282 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserLoginMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserLoginMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java
index 510c21b4..9f40d60a 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-system/src/main/java/me/zhengjie/sysrunner/SystemRunner.java b/eladmin-system/src/main/java/me/zhengjie/sysrunner/SystemRunner.java
new file mode 100644
index 00000000..b69aba26
--- /dev/null
+++ b/eladmin-system/src/main/java/me/zhengjie/sysrunner/SystemRunner.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2019-2020 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package me.zhengjie.sysrunner;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author Zheng Jie
+ * @description 程序启动后处理数据
+ * @date 2025-01-13
+ **/
+@Slf4j
+@Component
+@RequiredArgsConstructor
+public class SystemRunner implements ApplicationRunner {
+
+ @Override
+ public void run(ApplicationArguments args) {
+ }
+}
diff --git a/eladmin-system/src/main/resources/config/application-dev.yml b/eladmin-system/src/main/resources/config/application-dev.yml
index 8ed56d53..1707a6ac 100644
--- a/eladmin-system/src/main/resources/config/application-dev.yml
+++ b/eladmin-system/src/main/resources/config/application-dev.yml
@@ -3,25 +3,25 @@ spring:
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
- driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
- url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
- username: ${DB_USER:root}
- password: ${DB_PWD:123456}
- # 初始连接数
- initial-size: 5
- # 最小连接数
- min-idle: 15
- # 最大连接数
- max-active: 30
- # 超时时间(以秒数为单位)
- remove-abandoned-timeout: 180
- # 获取连接超时时间
+ driverClassName: com.p6spy.engine.spy.P6SpyDriver
+ url: jdbc:p6spy:mysql://localhost:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
+ username: root
+ password: 123456
+ # 初始连接数,建议设置为与最小空闲连接数相同
+ initial-size: 20
+ # 最小空闲连接数,保持足够的空闲连接以应对请求
+ min-idle: 20
+ # 最大连接数,根据并发需求适当增加
+ max-active: 50
+ # 获取连接超时时间(毫秒),调整以满足响应时间要求
max-wait: 3000
- # 连接有效性检测时间
+ # 启用KeepAlive机制,保持长连接
+ keep-alive: true
+ # 连接有效性检测间隔时间(毫秒),定期检查连接的健康状态
time-between-eviction-runs-millis: 60000
- # 连接在池中最小生存的时间
+ # 连接在池中最小生存时间(毫秒),确保连接在池中至少存在一段时间
min-evictable-idle-time-millis: 300000
- # 连接在池中最大生存的时间
+ # 连接在池中最大生存时间(毫秒),防止连接在池中停留过长
max-evictable-idle-time-millis: 900000
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
test-while-idle: true
@@ -29,8 +29,10 @@ spring:
test-on-borrow: true
# 是否在归还到池中前进行检验
test-on-return: false
+ # 停用 com_ping 探活机制
+ use-ping-method: false
# 检测连接是否有效
- validation-query: select 1
+ validation-query: SELECT 1
# 配置监控统计
webStatFilter:
enabled: true
@@ -43,7 +45,7 @@ spring:
enabled: true
# 记录慢SQL
log-slow-sql: true
- slow-sql-millis: 1000
+ slow-sql-millis: 2000
merge-sql: true
wall:
config:
@@ -58,7 +60,7 @@ login:
# 存活时间/秒
idle-time: 21600
# 验证码
- login-code:
+ code:
# 验证码类型配置 查看 LoginProperties 类
code-type: arithmetic
# 登录图形验证码有效时间/分钟
@@ -84,9 +86,9 @@ jwt:
# 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
token-validity-in-seconds: 14400000
# 在线用户key
- online-key: "online-token:"
+ online-key: "online_token:"
# 验证码
- code-key: "captcha-code:"
+ code-key: "captcha_code:"
# token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
detect: 1800000
# 续期时间范围,默认1小时,单位毫秒
diff --git a/eladmin-system/src/main/resources/config/application-prod.yml b/eladmin-system/src/main/resources/config/application-prod.yml
index ca64bdf3..421d0358 100644
--- a/eladmin-system/src/main/resources/config/application-prod.yml
+++ b/eladmin-system/src/main/resources/config/application-prod.yml
@@ -3,23 +3,25 @@ spring:
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
- driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
- url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
- username: ${DB_USER:eladmin}
+ driverClassName: com.mysql.cj.jdbc.Driver
+ url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
+ username: ${DB_USER:root}
password: ${DB_PWD:123456}
- # 初始连接数
+ # 初始连接数,建议设置为与最小空闲连接数相同
initial-size: 20
- # 最小连接数
+ # 最小空闲连接数,保持足够的空闲连接以应对请求
min-idle: 20
- # 最大连接数
+ # 最大连接数,根据并发需求适当增加
max-active: 50
- # 获取连接超时时间
- max-wait: 5000
- # 连接有效性检测时间
+ # 获取连接超时时间(毫秒),调整以满足响应时间要求
+ max-wait: 3000
+ # 启用KeepAlive机制,保持长连接
+ keep-alive: true
+ # 连接有效性检测间隔时间(毫秒),定期检查连接的健康状态
time-between-eviction-runs-millis: 60000
- # 连接在池中最小生存的时间
+ # 连接在池中最小生存时间(毫秒),确保连接在池中至少存在一段时间
min-evictable-idle-time-millis: 300000
- # 连接在池中最大生存的时间
+ # 连接在池中最大生存时间(毫秒),防止连接在池中停留过长
max-evictable-idle-time-millis: 900000
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
test-while-idle: true
@@ -27,8 +29,10 @@ spring:
test-on-borrow: true
# 是否在归还到池中前进行检验
test-on-return: false
+ # 停用 com_ping 探活机制
+ use-ping-method: false
# 检测连接是否有效
- validation-query: select 1
+ validation-query: SELECT 1
# 配置监控统计
webStatFilter:
enabled: true
@@ -38,14 +42,14 @@ spring:
# 控制台管理用户名和密码
url-pattern: /druid/*
reset-enable: false
- login-username: jie123
- login-password: jie123
+ login-username: admin
+ login-password: Afaf72fan.aa
filter:
stat:
enabled: true
# 记录慢SQL
log-slow-sql: true
- slow-sql-millis: 1000
+ slow-sql-millis: 2000
merge-sql: true
wall:
config:
@@ -60,7 +64,7 @@ login:
# 存活时间/秒
idle-time: 21600
# 验证码
- login-code:
+ code:
# 验证码类型配置 查看 LoginProperties 类
code-type: arithmetic
# 登录图形验证码有效时间/分钟
@@ -86,9 +90,9 @@ jwt:
# 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
token-validity-in-seconds: 7200000
# 在线用户key
- online-key: "online-token:"
+ online-key: "online_token:"
# 验证码
- code-key: "captcha-code:"
+ code-key: "captcha_code:"
# token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
detect: 1800000
# 续期时间范围,默认 1小时,这里单位毫秒
diff --git a/eladmin-system/src/main/resources/config/application.yml b/eladmin-system/src/main/resources/config/application.yml
index 388371bf..a428714e 100644
--- a/eladmin-system/src/main/resources/config/application.yml
+++ b/eladmin-system/src/main/resources/config/application.yml
@@ -1,8 +1,14 @@
server:
port: 8000
- compression:
+ http2:
+ # 启用 HTTP/2 支持,提升传输效率
enabled: true
- mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json
+ compression:
+ # 启用 GZIP 压缩,减少传输数据量
+ enabled: true
+ # 需要压缩的 MIME 类型
+ mime-types: text/html, text/xml, text/plain, application/json
+ # 最小压缩响应大小(字节)
spring:
freemarker:
@@ -34,6 +40,17 @@ spring:
password: ${REDIS_PWD:}
#连接超时时间
timeout: 5000
+ # 连接池配置
+ lettuce:
+ pool:
+ # 连接池最大连接数
+ max-active: 30
+ # 连接池最大阻塞等待时间(毫秒),负值表示没有限制
+ max-wait: -1
+ # 连接池中的最大空闲连接数
+ max-idle: 20
+ # 连接池中的最小空闲连接数
+ min-idle: 1
task:
pool:
diff --git a/eladmin-system/src/main/resources/log4jdbc.log4j2.properties b/eladmin-system/src/main/resources/log4jdbc.log4j2.properties
deleted file mode 100644
index 302525ff..00000000
--- a/eladmin-system/src/main/resources/log4jdbc.log4j2.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
-log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
-log4jdbc.auto.load.popular.drivers=false
-log4jdbc.drivers=com.mysql.cj.jdbc.Driver
\ No newline at end of file
diff --git a/eladmin-system/src/main/resources/logback.xml b/eladmin-system/src/main/resources/logback.xml
index 3f8f9d8f..f991c414 100644
--- a/eladmin-system/src/main/resources/logback.xml
+++ b/eladmin-system/src/main/resources/logback.xml
@@ -17,29 +17,10 @@
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
diff --git a/eladmin-system/src/main/resources/spy.properties b/eladmin-system/src/main/resources/spy.properties
new file mode 100644
index 00000000..7b60caf6
--- /dev/null
+++ b/eladmin-system/src/main/resources/spy.properties
@@ -0,0 +1,29 @@
+# 应用的拦截模块
+modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
+
+# 自定义日志打印
+logMessageFormat=me.zhengjie.config.CustomP6SpyLogger
+
+# 日志输出到控制台
+appender=com.p6spy.engine.spy.appender.Slf4JLogger
+
+# 日期格式
+dateformat=yyyy-MM-dd HH:mm:ss
+
+# 实际驱动可多个
+driverlist=com.mysql.cj.jdbc.Driver
+
+# 是否开启慢SQL记录
+outagedetection=true
+
+# 慢SQL记录标准 2 秒
+outagedetectioninterval=2
+
+# 是否过滤 Log
+filter=true
+
+# 过滤 Log 时所排除的 sql 关键字,以逗号分隔
+exclude=select 1
+
+# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
+excludecategories=info,debug,result,commit,resultset
\ No newline at end of file
diff --git a/eladmin-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java b/eladmin-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java
index def695d9..deabb360 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/domain/EmailConfig.java b/eladmin-tools/src/main/java/me/zhengjie/domain/EmailConfig.java
index b4fc1e6d..3f8bd18b 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/domain/EmailConfig.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/domain/EmailConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/domain/LocalStorage.java b/eladmin-tools/src/main/java/me/zhengjie/domain/LocalStorage.java
index 59fd0ab8..51d5cf6c 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/domain/LocalStorage.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/domain/LocalStorage.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java b/eladmin-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java
index 0247e673..f9140b1d 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/domain/QiniuContent.java b/eladmin-tools/src/main/java/me/zhengjie/domain/QiniuContent.java
index db69a6a6..b7511db0 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/domain/QiniuContent.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/domain/QiniuContent.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java b/eladmin-tools/src/main/java/me/zhengjie/domain/enums/AliPayStatusEnum.java
similarity index 94%
rename from eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java
rename to eladmin-tools/src/main/java/me/zhengjie/domain/enums/AliPayStatusEnum.java
index c114fd16..23870f89 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/domain/enums/AliPayStatusEnum.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package me.zhengjie.utils;
+package me.zhengjie.domain.enums;
/**
* 支付状态
diff --git a/eladmin-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java b/eladmin-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java
index 1fb759f5..40896e70 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.domain.vo;
+import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -32,13 +33,15 @@ import java.util.List;
@NoArgsConstructor
public class EmailVo {
- /** 收件人,支持多个收件人 */
@NotEmpty
+ @ApiModelProperty(value = "收件人")
private List tos;
@NotBlank
+ @ApiModelProperty(value = "主题")
private String subject;
@NotBlank
+ @ApiModelProperty(value = "内容")
private String content;
}
diff --git a/eladmin-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java b/eladmin-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java
index 01c1c2fd..b8f5e6c8 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,35 +29,30 @@ import java.sql.Timestamp;
@Data
public class TradeVo {
- /** (必填)商品描述 */
@NotBlank
+ @ApiModelProperty(value = "商品描述")
private String body;
- /** (必填)商品名称 */
@NotBlank
+ @ApiModelProperty(value = "商品名称")
private String subject;
- /** (必填)商户订单号,应该由后台生成 */
- @ApiModelProperty(hidden = true)
+ @ApiModelProperty(value = "商户订单号", hidden = true)
private String outTradeNo;
- /** (必填)第三方订单号 */
- @ApiModelProperty(hidden = true)
+ @ApiModelProperty(value = "第三方订单号", hidden = true)
private String tradeNo;
- /** (必填)价格 */
@NotBlank
+ @ApiModelProperty(value = "价格")
private String totalAmount;
- /** 订单状态,已支付,未支付,作废 */
- @ApiModelProperty(hidden = true)
+ @ApiModelProperty(value = "订单状态,已支付,未支付,作废", hidden = true)
private String state;
- /** 创建时间,存入数据库时需要 */
- @ApiModelProperty(hidden = true)
+ @ApiModelProperty(value = "创建时间", hidden = true)
private Timestamp createTime;
- /** 作废时间,存入数据库时需要 */
- @ApiModelProperty(hidden = true)
+ @ApiModelProperty(value = "作废时间", hidden = true)
private Date cancelTime;
}
diff --git a/eladmin-tools/src/main/java/me/zhengjie/repository/AliPayRepository.java b/eladmin-tools/src/main/java/me/zhengjie/repository/AliPayRepository.java
index 61183b43..4d8e36f4 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/repository/AliPayRepository.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/repository/AliPayRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/repository/EmailRepository.java b/eladmin-tools/src/main/java/me/zhengjie/repository/EmailRepository.java
index 7765602c..ba8d1da2 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/repository/EmailRepository.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/repository/EmailRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java b/eladmin-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java
index 8c1e85af..8978b4fb 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java b/eladmin-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java
index 9379f55b..eb9045a8 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public interface QiNiuConfigRepository extends JpaRepository {
/**
* 编辑类型
- * @param type
+ * @param type /
*/
@Modifying
@Query(value = "update QiniuConfig set type = ?1")
diff --git a/eladmin-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java b/eladmin-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java
index 55f813f5..10b0e157 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java b/eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java
index 0c03d0ae..7a065f19 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,12 +19,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
-import me.zhengjie.annotation.AnonymousAccess;
+import me.zhengjie.annotation.rest.AnonymousAccess;
import me.zhengjie.annotation.Log;
import me.zhengjie.annotation.rest.AnonymousGetMapping;
import me.zhengjie.domain.vo.TradeVo;
import me.zhengjie.domain.AlipayConfig;
-import me.zhengjie.utils.AliPayStatusEnum;
+import me.zhengjie.domain.enums.AliPayStatusEnum;
import me.zhengjie.utils.AlipayUtils;
import me.zhengjie.service.AliPayService;
import org.springframework.http.HttpStatus;
diff --git a/eladmin-tools/src/main/java/me/zhengjie/rest/EmailController.java b/eladmin-tools/src/main/java/me/zhengjie/rest/EmailController.java
index eb7832c8..9ce5258c 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/rest/EmailController.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/rest/EmailController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java b/eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java
index 2b61260d..beb0ec3c 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java b/eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java
index 2988c726..f17ce3bb 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/AliPayService.java b/eladmin-tools/src/main/java/me/zhengjie/service/AliPayService.java
index be19c905..51e8951c 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/AliPayService.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/AliPayService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/EmailService.java b/eladmin-tools/src/main/java/me/zhengjie/service/EmailService.java
index d62cadc2..d055eed0 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/EmailService.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/EmailService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/LocalStorageService.java b/eladmin-tools/src/main/java/me/zhengjie/service/LocalStorageService.java
index 71c57d27..08e72270 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/LocalStorageService.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/LocalStorageService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ public interface LocalStorageService {
* 上传
* @param name 文件名称
* @param file 文件
- * @return
+ * @return /
*/
LocalStorage create(String name, MultipartFile file);
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/QiNiuService.java b/eladmin-tools/src/main/java/me/zhengjie/service/QiNiuService.java
index 5321208e..b75a5aa1 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/QiNiuService.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/QiNiuService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java b/eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java
index 14221c2a..32642b3e 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDto.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
@@ -28,15 +29,21 @@ import java.io.Serializable;
@Setter
public class LocalStorageDto extends BaseDTO implements Serializable {
+ @ApiModelProperty(value = "ID")
private Long id;
+ @ApiModelProperty(value = "真实文件名")
private String realName;
+ @ApiModelProperty(value = "文件名")
private String name;
+ @ApiModelProperty(value = "后缀")
private String suffix;
+ @ApiModelProperty(value = "文件类型")
private String type;
+ @ApiModelProperty(value = "文件大小")
private String size;
}
\ No newline at end of file
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java b/eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java
index bea1cc7c..ae939945 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.sql.Timestamp;
import java.util.List;
@@ -28,9 +29,11 @@ import me.zhengjie.annotation.Query;
@Data
public class LocalStorageQueryCriteria{
+ @ApiModelProperty(value = "模糊查询")
@Query(blurry = "name,suffix,type,createBy,size")
private String blurry;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
\ No newline at end of file
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java b/eladmin-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java
deleted file mode 100644
index e7d4f1b1..00000000
--- a/eladmin-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2019-2020 Zheng Jie
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package me.zhengjie.service.dto;
-
-import lombok.Data;
-import me.zhengjie.annotation.Query;
-import java.sql.Timestamp;
-import java.util.List;
-
-/**
- * sm.ms图床
- *
- * @author Zheng Jie
- * @date 2019-6-4 09:52:09
- */
-@Data
-public class PictureQueryCriteria{
-
- @Query(type = Query.Type.INNER_LIKE)
- private String filename;
-
- @Query(type = Query.Type.INNER_LIKE)
- private String username;
-
- @Query(type = Query.Type.BETWEEN)
- private List createTime;
-}
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java b/eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java
index f5c2240b..fab27714 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package me.zhengjie.service.dto;
+import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.annotation.Query;
@@ -28,9 +29,11 @@ import java.util.List;
@Data
public class QiniuQueryCriteria{
+ @ApiModelProperty(value = "名称查询")
@Query(type = Query.Type.INNER_LIKE)
private String key;
+ @ApiModelProperty(value = "创建时间")
@Query(type = Query.Type.BETWEEN)
private List createTime;
}
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/impl/AliPayServiceImpl.java b/eladmin-tools/src/main/java/me/zhengjie/service/impl/AliPayServiceImpl.java
index 0625ba42..d065d508 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/impl/AliPayServiceImpl.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/impl/AliPayServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ import java.util.Optional;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "aliPay")
+@CacheConfig(cacheNames = "aliPay", keyGenerator = "keyGenerator")
public class AliPayServiceImpl implements AliPayService {
private final AliPayRepository alipayRepository;
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java b/eladmin-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java
index aa567327..2403877c 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ import java.util.Optional;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "email")
+@CacheConfig(cacheNames = "email", keyGenerator = "keyGenerator")
public class EmailServiceImpl implements EmailService {
private final EmailRepository emailRepository;
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java b/eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java
index 94548538..5ef939d3 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@ package me.zhengjie.service.impl;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
-import me.zhengjie.config.FileProperties;
+import me.zhengjie.config.properties.FileProperties;
import me.zhengjie.domain.LocalStorage;
import me.zhengjie.service.dto.LocalStorageDto;
import me.zhengjie.service.dto.LocalStorageQueryCriteria;
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java b/eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
index 60093d7b..01229feb 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@ import java.util.*;
*/
@Service
@RequiredArgsConstructor
-@CacheConfig(cacheNames = "qiNiu")
+@CacheConfig(cacheNames = "qiNiu", keyGenerator = "keyGenerator")
public class QiNiuServiceImpl implements QiNiuService {
private final QiNiuConfigRepository qiNiuConfigRepository;
diff --git a/eladmin-tools/src/main/java/me/zhengjie/service/mapstruct/LocalStorageMapper.java b/eladmin-tools/src/main/java/me/zhengjie/service/mapstruct/LocalStorageMapper.java
index 4c6d9555..0d54c53e 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/service/mapstruct/LocalStorageMapper.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/service/mapstruct/LocalStorageMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java b/eladmin-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java
index 203f7db7..1ae60382 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/eladmin-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java b/eladmin-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java
index 8091a95d..9d9ed895 100644
--- a/eladmin-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java
+++ b/eladmin-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2019-2020 Zheng Jie
+ * Copyright 2019-2025 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/pom.xml b/pom.xml
index 979ad6ef..ec0bfe5b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,7 +1,5 @@
-
+
4.0.0
me.zhengjie
@@ -23,7 +21,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.6.4
+ 2.6.6
@@ -32,10 +30,9 @@
UTF-8
UTF-8
1.8
- 1.16
2.9.2
1.2.83
- 1.2.8
+ 1.2.19
2.11.1
1.4.2.Final
@@ -47,6 +44,12 @@
spring-boot-starter-data-jpa
+
+
+ org.springframework.boot
+ spring-boot-starter-websocket
+
+
org.springframework.boot
@@ -78,6 +81,13 @@
spring-boot-starter-data-redis
+
+
+ org.redisson
+ redisson-spring-boot-starter
+ 3.17.1
+
+
@@ -92,9 +102,9 @@
- org.bgee.log4jdbc-log4j2
- log4jdbc-log4j2-jdbc4.1
- ${log4jdbc.version}
+ p6spy
+ p6spy
+ 3.9.1
diff --git a/sql/eladmin.sql b/sql/eladmin.sql
index 2711d6e9..166afc37 100644
--- a/sql/eladmin.sql
+++ b/sql/eladmin.sql
@@ -1,50 +1,56 @@
/*
- Navicat Premium Data Transfer
+ Navicat Premium Dump SQL
Source Server : localhost
Source Server Type : MySQL
- Source Server Version : 100505
+ Source Server Version : 110206 (11.2.6-MariaDB)
Source Host : localhost:3306
Source Schema : eladmin
Target Server Type : MySQL
- Target Server Version : 100505
+ Target Server Version : 110206 (11.2.6-MariaDB)
File Encoding : 65001
- Date: 05/09/2020 10:49:19
+ Date: 15/01/2025 18:20:01
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
--- Table structure for code_column_config
+-- Table structure for code_column
-- ----------------------------
-DROP TABLE IF EXISTS `code_column_config`;
-CREATE TABLE `code_column_config` (
+DROP TABLE IF EXISTS `code_column`;
+CREATE TABLE `code_column` (
`column_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `table_name` varchar(180) DEFAULT NULL,
- `column_name` varchar(255) DEFAULT NULL,
- `column_type` varchar(255) DEFAULT NULL,
- `dict_name` varchar(255) DEFAULT NULL,
- `extra` varchar(255) DEFAULT NULL,
- `form_show` bit(1) DEFAULT NULL,
- `form_type` varchar(255) DEFAULT NULL,
- `key_type` varchar(255) DEFAULT NULL,
- `list_show` bit(1) DEFAULT NULL,
- `not_null` bit(1) DEFAULT NULL,
- `query_type` varchar(255) DEFAULT NULL,
- `remark` varchar(255) DEFAULT NULL,
- `date_annotation` varchar(255) DEFAULT NULL,
+ `table_name` varchar(180) DEFAULT NULL COMMENT '表名',
+ `column_name` varchar(255) DEFAULT NULL COMMENT '数据库字段名称',
+ `column_type` varchar(255) DEFAULT NULL COMMENT '数据库字段类型',
+ `dict_name` varchar(255) DEFAULT NULL COMMENT '字典名称',
+ `extra` varchar(255) DEFAULT NULL COMMENT '字段额外的参数',
+ `form_show` bit(1) DEFAULT NULL COMMENT '是否表单显示',
+ `form_type` varchar(255) DEFAULT NULL COMMENT '表单类型',
+ `key_type` varchar(255) DEFAULT NULL COMMENT '数据库字段键类型',
+ `list_show` bit(1) DEFAULT NULL COMMENT '是否在列表显示',
+ `not_null` bit(1) DEFAULT NULL COMMENT '是否为空',
+ `query_type` varchar(255) DEFAULT NULL COMMENT '查询类型',
+ `remark` varchar(255) DEFAULT NULL COMMENT '描述',
+ `date_annotation` varchar(255) DEFAULT NULL COMMENT '日期注解',
PRIMARY KEY (`column_id`) USING BTREE,
KEY `idx_table_name` (`table_name`)
-) ENGINE=InnoDB AUTO_INCREMENT=191 ROW_FORMAT=COMPACT COMMENT='代码生成字段信息存储';
+) ENGINE=InnoDB AUTO_INCREMENT=259 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='代码生成字段信息存储';
-- ----------------------------
--- Table structure for code_gen_config
+-- Records of code_column
-- ----------------------------
-DROP TABLE IF EXISTS `code_gen_config`;
-CREATE TABLE `code_gen_config` (
+BEGIN;
+COMMIT;
+
+-- ----------------------------
+-- Table structure for code_config
+-- ----------------------------
+DROP TABLE IF EXISTS `code_config`;
+CREATE TABLE `code_config` (
`config_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`table_name` varchar(255) DEFAULT NULL COMMENT '表名',
`author` varchar(255) DEFAULT NULL COMMENT '作者',
@@ -57,7 +63,13 @@ CREATE TABLE `code_gen_config` (
`api_alias` varchar(255) DEFAULT NULL COMMENT '接口名称',
PRIMARY KEY (`config_id`) USING BTREE,
KEY `idx_table_name` (`table_name`(100))
-) ENGINE=InnoDB AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='代码生成器配置';
+) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='代码生成器配置';
+
+-- ----------------------------
+-- Records of code_config
+-- ----------------------------
+BEGIN;
+COMMIT;
-- ----------------------------
-- Table structure for mnt_app
@@ -77,7 +89,7 @@ CREATE TABLE `mnt_app` (
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`app_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='应用管理';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='应用管理';
-- ----------------------------
-- Records of mnt_app
@@ -100,7 +112,7 @@ CREATE TABLE `mnt_database` (
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`db_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='数据库管理';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='数据库管理';
-- ----------------------------
-- Records of mnt_database
@@ -120,8 +132,8 @@ CREATE TABLE `mnt_deploy` (
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`deploy_id`) USING BTREE,
- KEY `FK6sy157pseoxx4fmcqr1vnvvhy` (`app_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='部署管理';
+ KEY `idx_app_id` (`app_id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='部署管理';
-- ----------------------------
-- Records of mnt_deploy
@@ -141,7 +153,7 @@ CREATE TABLE `mnt_deploy_history` (
`ip` varchar(20) NOT NULL COMMENT '服务器IP',
`deploy_id` bigint(20) DEFAULT NULL COMMENT '部署编号',
PRIMARY KEY (`history_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='部署历史管理';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='部署历史管理';
-- ----------------------------
-- Records of mnt_deploy_history
@@ -157,8 +169,9 @@ CREATE TABLE `mnt_deploy_server` (
`deploy_id` bigint(20) NOT NULL COMMENT '部署ID',
`server_id` bigint(20) NOT NULL COMMENT '服务ID',
PRIMARY KEY (`deploy_id`,`server_id`) USING BTREE,
- KEY `FKeaaha7jew9a02b3bk9ghols53` (`server_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='应用与服务器关联';
+ KEY `idx_deploy_id` (`deploy_id`),
+ KEY `idx_server_id` (`server_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='应用与服务器关联';
-- ----------------------------
-- Records of mnt_deploy_server
@@ -183,7 +196,13 @@ CREATE TABLE `mnt_server` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`server_id`) USING BTREE,
KEY `idx_ip` (`ip`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 ROW_FORMAT=COMPACT COMMENT='服务器管理';
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='服务器管理';
+
+-- ----------------------------
+-- Records of mnt_server
+-- ----------------------------
+BEGIN;
+COMMIT;
-- ----------------------------
-- Table structure for sys_dept
@@ -201,21 +220,21 @@ CREATE TABLE `sys_dept` (
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`dept_id`) USING BTREE,
- KEY `inx_pid` (`pid`),
- KEY `inx_enabled` (`enabled`)
-) ENGINE=InnoDB AUTO_INCREMENT=18 ROW_FORMAT=COMPACT COMMENT='部门';
+ KEY `idx_pid` (`pid`),
+ KEY `idx_enabled` (`enabled`)
+) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='部门';
-- ----------------------------
-- Records of sys_dept
-- ----------------------------
BEGIN;
-INSERT INTO `sys_dept` VALUES (2, 7, 1, '研发部', 3, b'1', 'admin', 'admin', '2019-03-25 09:15:32', '2020-08-02 14:48:47');
-INSERT INTO `sys_dept` VALUES (5, 7, 0, '运维部', 4, b'1', 'admin', 'admin', '2019-03-25 09:20:44', '2020-05-17 14:27:27');
-INSERT INTO `sys_dept` VALUES (6, 8, 0, '测试部', 6, b'1', 'admin', 'admin', '2019-03-25 09:52:18', '2020-06-08 11:59:21');
-INSERT INTO `sys_dept` VALUES (7, NULL, 2, '华南分部', 0, b'1', 'admin', 'admin', '2019-03-25 11:04:50', '2020-06-08 12:08:56');
-INSERT INTO `sys_dept` VALUES (8, NULL, 2, '华北分部', 1, b'1', 'admin', 'admin', '2019-03-25 11:04:53', '2020-05-14 12:54:00');
-INSERT INTO `sys_dept` VALUES (15, 8, 0, 'UI部门', 7, b'1', 'admin', 'admin', '2020-05-13 22:56:53', '2020-05-14 12:54:13');
-INSERT INTO `sys_dept` VALUES (17, 2, 0, '研发一组', 999, b'1', 'admin', 'admin', '2020-08-02 14:49:07', '2020-08-02 14:49:07');
+INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, 7, 1, '研发部', 3, b'1', 'admin', 'admin', '2019-03-25 09:15:32', '2020-08-02 14:48:47');
+INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 7, 0, '运维部', 4, b'1', 'admin', 'admin', '2019-03-25 09:20:44', '2020-05-17 14:27:27');
+INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (6, 8, 0, '测试部', 6, b'1', 'admin', 'admin', '2019-03-25 09:52:18', '2020-06-08 11:59:21');
+INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (7, NULL, 2, '华南分部', 0, b'1', 'admin', 'admin', '2019-03-25 11:04:50', '2020-06-08 12:08:56');
+INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (8, NULL, 2, '华北分部', 1, b'1', 'admin', 'admin', '2019-03-25 11:04:53', '2020-05-14 12:54:00');
+INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (15, 8, 0, 'UI部门', 7, b'1', 'admin', 'admin', '2020-05-13 22:56:53', '2020-05-14 12:54:13');
+INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (17, 2, 0, '研发一组', 999, b'1', 'admin', 'admin', '2020-08-02 14:49:07', '2020-08-02 14:49:07');
COMMIT;
-- ----------------------------
@@ -231,15 +250,15 @@ CREATE TABLE `sys_dict` (
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`dict_id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=6 ROW_FORMAT=COMPACT COMMENT='数据字典';
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='数据字典';
-- ----------------------------
-- Records of sys_dict
-- ----------------------------
BEGIN;
-INSERT INTO `sys_dict` VALUES (1, 'user_status', '用户状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
-INSERT INTO `sys_dict` VALUES (4, 'dept_status', '部门状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
-INSERT INTO `sys_dict` VALUES (5, 'job_status', '岗位状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
+INSERT INTO `sys_dict` (`dict_id`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, 'user_status', '用户状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
+INSERT INTO `sys_dict` (`dict_id`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (4, 'dept_status', '部门状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
+INSERT INTO `sys_dict` (`dict_id`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 'job_status', '岗位状态', NULL, 'admin', '2019-10-27 20:31:36', '2025-01-14 15:48:29');
COMMIT;
-- ----------------------------
@@ -257,19 +276,19 @@ CREATE TABLE `sys_dict_detail` (
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`detail_id`) USING BTREE,
- KEY `FK5tpkputc6d9nboxojdbgnpmyb` (`dict_id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='数据字典详情';
+ KEY `idx_dict_id` (`dict_id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='数据字典详情';
-- ----------------------------
-- Records of sys_dict_detail
-- ----------------------------
BEGIN;
-INSERT INTO `sys_dict_detail` VALUES (1, 1, '激活', 'true', 1, NULL, NULL, '2019-10-27 20:31:36', NULL);
-INSERT INTO `sys_dict_detail` VALUES (2, 1, '禁用', 'false', 2, NULL, NULL, NULL, NULL);
-INSERT INTO `sys_dict_detail` VALUES (3, 4, '启用', 'true', 1, NULL, NULL, NULL, NULL);
-INSERT INTO `sys_dict_detail` VALUES (4, 4, '停用', 'false', 2, NULL, NULL, '2019-10-27 20:31:36', NULL);
-INSERT INTO `sys_dict_detail` VALUES (5, 5, '启用', 'true', 1, NULL, NULL, NULL, NULL);
-INSERT INTO `sys_dict_detail` VALUES (6, 5, '停用', 'false', 2, NULL, NULL, '2019-10-27 20:31:36', NULL);
+INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, 1, '激活', 'true', 1, NULL, NULL, '2019-10-27 20:31:36', NULL);
+INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, 1, '禁用', 'false', 2, NULL, NULL, NULL, NULL);
+INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (3, 4, '启用', 'true', 1, NULL, NULL, NULL, NULL);
+INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (4, 4, '停用', 'false', 2, NULL, NULL, '2019-10-27 20:31:36', NULL);
+INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 5, '启用', 'true', 1, NULL, NULL, NULL, NULL);
+INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (6, 5, '停用', 'false', 2, NULL, NULL, '2019-10-27 20:31:36', NULL);
COMMIT;
-- ----------------------------
@@ -287,17 +306,17 @@ CREATE TABLE `sys_job` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`job_id`) USING BTREE,
UNIQUE KEY `uniq_name` (`name`),
- KEY `inx_enabled` (`enabled`)
-) ENGINE=InnoDB AUTO_INCREMENT=13 ROW_FORMAT=COMPACT COMMENT='岗位';
+ KEY `idx_enabled` (`enabled`)
+) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='岗位';
-- ----------------------------
-- Records of sys_job
-- ----------------------------
BEGIN;
-INSERT INTO `sys_job` VALUES (8, '人事专员', b'1', 3, NULL, NULL, '2019-03-29 14:52:28', NULL);
-INSERT INTO `sys_job` VALUES (10, '产品经理', b'1', 4, NULL, NULL, '2019-03-29 14:55:51', NULL);
-INSERT INTO `sys_job` VALUES (11, '全栈开发', b'1', 2, NULL, 'admin', '2019-03-31 13:39:30', '2020-05-05 11:33:43');
-INSERT INTO `sys_job` VALUES (12, '软件测试', b'1', 5, NULL, 'admin', '2019-03-31 13:39:43', '2020-05-10 19:56:26');
+INSERT INTO `sys_job` (`job_id`, `name`, `enabled`, `job_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (8, '人事专员', b'1', 3, NULL, NULL, '2019-03-29 14:52:28', NULL);
+INSERT INTO `sys_job` (`job_id`, `name`, `enabled`, `job_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (10, '产品经理', b'1', 4, NULL, NULL, '2019-03-29 14:55:51', NULL);
+INSERT INTO `sys_job` (`job_id`, `name`, `enabled`, `job_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (11, '全栈开发', b'1', 2, NULL, 'admin', '2019-03-31 13:39:30', '2020-05-05 11:33:43');
+INSERT INTO `sys_job` (`job_id`, `name`, `enabled`, `job_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (12, '软件测试', b'1', 5, NULL, 'admin', '2019-03-31 13:39:43', '2020-05-10 19:56:26');
COMMIT;
-- ----------------------------
@@ -306,21 +325,27 @@ COMMIT;
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
`log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `description` varchar(255) DEFAULT NULL,
- `log_type` varchar(10) DEFAULT NULL,
- `method` varchar(255) DEFAULT NULL,
- `params` text DEFAULT NULL,
- `request_ip` varchar(255) DEFAULT NULL,
- `time` bigint(20) DEFAULT NULL,
- `username` varchar(255) DEFAULT NULL,
- `address` varchar(255) DEFAULT NULL,
- `browser` varchar(255) DEFAULT NULL,
- `exception_detail` text DEFAULT NULL,
- `create_time` datetime DEFAULT NULL,
+ `description` varchar(255) DEFAULT NULL COMMENT '描述',
+ `log_type` varchar(10) NOT NULL COMMENT '日志类型:INFI/ERROR',
+ `method` varchar(255) DEFAULT NULL COMMENT '方法名',
+ `params` text DEFAULT NULL COMMENT '参数',
+ `request_ip` varchar(255) DEFAULT NULL COMMENT '请求IP',
+ `time` bigint(20) DEFAULT NULL COMMENT '执行时间',
+ `username` varchar(255) DEFAULT NULL COMMENT '用户名',
+ `address` varchar(255) DEFAULT NULL COMMENT '地址',
+ `browser` varchar(255) DEFAULT NULL COMMENT '浏览器',
+ `exception_detail` text DEFAULT NULL COMMENT '异常',
+ `create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`log_id`) USING BTREE,
- KEY `log_create_time_index` (`create_time`),
- KEY `inx_log_type` (`log_type`)
-) ENGINE=InnoDB AUTO_INCREMENT=3537 ROW_FORMAT=COMPACT COMMENT='系统日志';
+ KEY `idx_create_time_index` (`create_time`),
+ KEY `idx_log_type` (`log_type`)
+) ENGINE=InnoDB AUTO_INCREMENT=3636 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='系统日志';
+
+-- ----------------------------
+-- Records of sys_log
+-- ----------------------------
+BEGIN;
+COMMIT;
-- ----------------------------
-- Table structure for sys_menu
@@ -346,91 +371,87 @@ CREATE TABLE `sys_menu` (
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`menu_id`) USING BTREE,
- UNIQUE KEY `uniq_title` (`title`),
UNIQUE KEY `uniq_name` (`name`),
- KEY `inx_pid` (`pid`)
-) ENGINE=InnoDB AUTO_INCREMENT=118 ROW_FORMAT=COMPACT COMMENT='系统菜单';
+ UNIQUE KEY `uniq_title` (`title`),
+ KEY `idx_pid` (`pid`)
+) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='系统菜单';
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
-INSERT INTO `sys_menu` VALUES (1, NULL, 7, 0, '系统管理', NULL, NULL, 1, 'system', 'system', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:11:29', NULL);
-INSERT INTO `sys_menu` VALUES (2, 1, 3, 1, '用户管理', 'User', 'system/user/index', 2, 'peoples', 'user', b'0', b'0', b'0', 'user:list', NULL, NULL, '2018-12-18 15:14:44', NULL);
-INSERT INTO `sys_menu` VALUES (3, 1, 3, 1, '角色管理', 'Role', 'system/role/index', 3, 'role', 'role', b'0', b'0', b'0', 'roles:list', NULL, NULL, '2018-12-18 15:16:07', NULL);
-INSERT INTO `sys_menu` VALUES (5, 1, 3, 1, '菜单管理', 'Menu', 'system/menu/index', 5, 'menu', 'menu', b'0', b'0', b'0', 'menu:list', NULL, NULL, '2018-12-18 15:17:28', NULL);
-INSERT INTO `sys_menu` VALUES (6, NULL, 5, 0, '系统监控', NULL, NULL, 10, 'monitor', 'monitor', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:17:48', NULL);
-INSERT INTO `sys_menu` VALUES (7, 6, 0, 1, '操作日志', 'Log', 'monitor/log/index', 11, 'log', 'logs', b'0', b'1', b'0', NULL, NULL, 'admin', '2018-12-18 15:18:26', '2020-06-06 13:11:57');
-INSERT INTO `sys_menu` VALUES (9, 6, 0, 1, 'SQL监控', 'Sql', 'monitor/sql/index', 18, 'sqlMonitor', 'druid', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:19:34', NULL);
-INSERT INTO `sys_menu` VALUES (10, NULL, 5, 0, '组件管理', NULL, NULL, 50, 'zujian', 'components', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-19 13:38:16', NULL);
-INSERT INTO `sys_menu` VALUES (11, 10, 0, 1, '图标库', 'Icons', 'components/icons/index', 51, 'icon', 'icon', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-19 13:38:49', NULL);
-INSERT INTO `sys_menu` VALUES (14, 36, 0, 1, '邮件工具', 'Email', 'tools/email/index', 35, 'email', 'email', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-27 10:13:09', NULL);
-INSERT INTO `sys_menu` VALUES (15, 10, 0, 1, '富文本', 'Editor', 'components/Editor', 52, 'fwb', 'tinymce', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-27 11:58:25', NULL);
-INSERT INTO `sys_menu` VALUES (18, 36, 3, 1, '存储管理', 'Storage', 'tools/storage/index', 34, 'qiniu', 'storage', b'0', b'0', b'0', 'storage:list', NULL, NULL, '2018-12-31 11:12:15', NULL);
-INSERT INTO `sys_menu` VALUES (19, 36, 0, 1, '支付宝工具', 'AliPay', 'tools/aliPay/index', 37, 'alipay', 'aliPay', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-31 14:52:38', NULL);
-INSERT INTO `sys_menu` VALUES (21, NULL, 2, 0, '多级菜单', NULL, '', 900, 'menu', 'nested', b'0', b'0', b'0', NULL, NULL, 'admin', '2019-01-04 16:22:03', '2020-06-21 17:27:35');
-INSERT INTO `sys_menu` VALUES (22, 21, 2, 0, '二级菜单1', NULL, '', 999, 'menu', 'menu1', b'0', b'0', b'0', NULL, NULL, 'admin', '2019-01-04 16:23:29', '2020-06-21 17:27:20');
-INSERT INTO `sys_menu` VALUES (23, 21, 0, 1, '二级菜单2', NULL, 'nested/menu2/index', 999, 'menu', 'menu2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-04 16:23:57', NULL);
-INSERT INTO `sys_menu` VALUES (24, 22, 0, 1, '三级菜单1', 'Test', 'nested/menu1/menu1-1', 999, 'menu', 'menu1-1', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-04 16:24:48', NULL);
-INSERT INTO `sys_menu` VALUES (27, 22, 0, 1, '三级菜单2', NULL, 'nested/menu1/menu1-2', 999, 'menu', 'menu1-2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-07 17:27:32', NULL);
-INSERT INTO `sys_menu` VALUES (28, 1, 3, 1, '任务调度', 'Timing', 'system/timing/index', 999, 'timing', 'timing', b'0', b'0', b'0', 'timing:list', NULL, NULL, '2019-01-07 20:34:40', NULL);
-INSERT INTO `sys_menu` VALUES (30, 36, 0, 1, '代码生成', 'GeneratorIndex', 'generator/index', 32, 'dev', 'generator', b'0', b'1', b'0', NULL, NULL, NULL, '2019-01-11 15:45:55', NULL);
-INSERT INTO `sys_menu` VALUES (32, 6, 0, 1, '异常日志', 'ErrorLog', 'monitor/log/errorLog', 12, 'error', 'errorLog', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-13 13:49:03', NULL);
-INSERT INTO `sys_menu` VALUES (33, 10, 0, 1, 'Markdown', 'Markdown', 'components/MarkDown', 53, 'markdown', 'markdown', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-08 13:46:44', NULL);
-INSERT INTO `sys_menu` VALUES (34, 10, 0, 1, 'Yaml编辑器', 'YamlEdit', 'components/YamlEdit', 54, 'dev', 'yaml', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-08 15:49:40', NULL);
-INSERT INTO `sys_menu` VALUES (35, 1, 3, 1, '部门管理', 'Dept', 'system/dept/index', 6, 'dept', 'dept', b'0', b'0', b'0', 'dept:list', NULL, NULL, '2019-03-25 09:46:00', NULL);
-INSERT INTO `sys_menu` VALUES (36, NULL, 7, 0, '系统工具', NULL, '', 30, 'sys-tools', 'sys-tools', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-29 10:57:35', NULL);
-INSERT INTO `sys_menu` VALUES (37, 1, 3, 1, '岗位管理', 'Job', 'system/job/index', 7, 'Steve-Jobs', 'job', b'0', b'0', b'0', 'job:list', NULL, NULL, '2019-03-29 13:51:18', NULL);
-INSERT INTO `sys_menu` VALUES (38, 36, 0, 1, '接口文档', 'Swagger', 'tools/swagger/index', 36, 'swagger', 'swagger2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-29 19:57:53', NULL);
-INSERT INTO `sys_menu` VALUES (39, 1, 3, 1, '字典管理', 'Dict', 'system/dict/index', 8, 'dictionary', 'dict', b'0', b'0', b'0', 'dict:list', NULL, NULL, '2019-04-10 11:49:04', NULL);
-INSERT INTO `sys_menu` VALUES (41, 6, 0, 1, '在线用户', 'OnlineUser', 'monitor/online/index', 10, 'Steve-Jobs', 'online', b'0', b'0', b'0', NULL, NULL, NULL, '2019-10-26 22:08:43', NULL);
-INSERT INTO `sys_menu` VALUES (44, 2, 0, 2, '用户新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'user:add', NULL, NULL, '2019-10-29 10:59:46', NULL);
-INSERT INTO `sys_menu` VALUES (45, 2, 0, 2, '用户编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'user:edit', NULL, NULL, '2019-10-29 11:00:08', NULL);
-INSERT INTO `sys_menu` VALUES (46, 2, 0, 2, '用户删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'user:del', NULL, NULL, '2019-10-29 11:00:23', NULL);
-INSERT INTO `sys_menu` VALUES (48, 3, 0, 2, '角色创建', NULL, '', 2, '', '', b'0', b'0', b'0', 'roles:add', NULL, NULL, '2019-10-29 12:45:34', NULL);
-INSERT INTO `sys_menu` VALUES (49, 3, 0, 2, '角色修改', NULL, '', 3, '', '', b'0', b'0', b'0', 'roles:edit', NULL, NULL, '2019-10-29 12:46:16', NULL);
-INSERT INTO `sys_menu` VALUES (50, 3, 0, 2, '角色删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'roles:del', NULL, NULL, '2019-10-29 12:46:51', NULL);
-INSERT INTO `sys_menu` VALUES (52, 5, 0, 2, '菜单新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'menu:add', NULL, NULL, '2019-10-29 12:55:07', NULL);
-INSERT INTO `sys_menu` VALUES (53, 5, 0, 2, '菜单编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'menu:edit', NULL, NULL, '2019-10-29 12:55:40', NULL);
-INSERT INTO `sys_menu` VALUES (54, 5, 0, 2, '菜单删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'menu:del', NULL, NULL, '2019-10-29 12:56:00', NULL);
-INSERT INTO `sys_menu` VALUES (56, 35, 0, 2, '部门新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'dept:add', NULL, NULL, '2019-10-29 12:57:09', NULL);
-INSERT INTO `sys_menu` VALUES (57, 35, 0, 2, '部门编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'dept:edit', NULL, NULL, '2019-10-29 12:57:27', NULL);
-INSERT INTO `sys_menu` VALUES (58, 35, 0, 2, '部门删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'dept:del', NULL, NULL, '2019-10-29 12:57:41', NULL);
-INSERT INTO `sys_menu` VALUES (60, 37, 0, 2, '岗位新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'job:add', NULL, NULL, '2019-10-29 12:58:27', NULL);
-INSERT INTO `sys_menu` VALUES (61, 37, 0, 2, '岗位编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'job:edit', NULL, NULL, '2019-10-29 12:58:45', NULL);
-INSERT INTO `sys_menu` VALUES (62, 37, 0, 2, '岗位删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'job:del', NULL, NULL, '2019-10-29 12:59:04', NULL);
-INSERT INTO `sys_menu` VALUES (64, 39, 0, 2, '字典新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'dict:add', NULL, NULL, '2019-10-29 13:00:17', NULL);
-INSERT INTO `sys_menu` VALUES (65, 39, 0, 2, '字典编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'dict:edit', NULL, NULL, '2019-10-29 13:00:42', NULL);
-INSERT INTO `sys_menu` VALUES (66, 39, 0, 2, '字典删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'dict:del', NULL, NULL, '2019-10-29 13:00:59', NULL);
-INSERT INTO `sys_menu` VALUES (73, 28, 0, 2, '任务新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'timing:add', NULL, NULL, '2019-10-29 13:07:28', NULL);
-INSERT INTO `sys_menu` VALUES (74, 28, 0, 2, '任务编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'timing:edit', NULL, NULL, '2019-10-29 13:07:41', NULL);
-INSERT INTO `sys_menu` VALUES (75, 28, 0, 2, '任务删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'timing:del', NULL, NULL, '2019-10-29 13:07:54', NULL);
-INSERT INTO `sys_menu` VALUES (77, 18, 0, 2, '上传文件', NULL, '', 2, '', '', b'0', b'0', b'0', 'storage:add', NULL, NULL, '2019-10-29 13:09:09', NULL);
-INSERT INTO `sys_menu` VALUES (78, 18, 0, 2, '文件编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'storage:edit', NULL, NULL, '2019-10-29 13:09:22', NULL);
-INSERT INTO `sys_menu` VALUES (79, 18, 0, 2, '文件删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'storage:del', NULL, NULL, '2019-10-29 13:09:34', NULL);
-INSERT INTO `sys_menu` VALUES (80, 6, 0, 1, '服务监控', 'ServerMonitor', 'monitor/server/index', 14, 'codeConsole', 'server', b'0', b'0', b'0', 'monitor:list', NULL, 'admin', '2019-11-07 13:06:39', '2020-05-04 18:20:50');
-INSERT INTO `sys_menu` VALUES (82, 36, 0, 1, '生成配置', 'GeneratorConfig', 'generator/config', 33, 'dev', 'generator/config/:tableName', b'0', b'1', b'1', '', NULL, NULL, '2019-11-17 20:08:56', NULL);
-INSERT INTO `sys_menu` VALUES (83, 10, 0, 1, '图表库', 'Echarts', 'components/Echarts', 50, 'chart', 'echarts', b'0', b'1', b'0', '', NULL, NULL, '2019-11-21 09:04:32', NULL);
-INSERT INTO `sys_menu` VALUES (90, NULL, 5, 1, '运维管理', 'Mnt', '', 20, 'mnt', 'mnt', b'0', b'0', b'0', NULL, NULL, NULL, '2019-11-09 10:31:08', NULL);
-INSERT INTO `sys_menu` VALUES (92, 90, 3, 1, '服务器', 'ServerDeploy', 'mnt/server/index', 22, 'server', 'mnt/serverDeploy', b'0', b'0', b'0', 'serverDeploy:list', NULL, NULL, '2019-11-10 10:29:25', NULL);
-INSERT INTO `sys_menu` VALUES (93, 90, 3, 1, '应用管理', 'App', 'mnt/app/index', 23, 'app', 'mnt/app', b'0', b'0', b'0', 'app:list', NULL, NULL, '2019-11-10 11:05:16', NULL);
-INSERT INTO `sys_menu` VALUES (94, 90, 3, 1, '部署管理', 'Deploy', 'mnt/deploy/index', 24, 'deploy', 'mnt/deploy', b'0', b'0', b'0', 'deploy:list', NULL, NULL, '2019-11-10 15:56:55', NULL);
-INSERT INTO `sys_menu` VALUES (97, 90, 1, 1, '部署备份', 'DeployHistory', 'mnt/deployHistory/index', 25, 'backup', 'mnt/deployHistory', b'0', b'0', b'0', 'deployHistory:list', NULL, NULL, '2019-11-10 16:49:44', NULL);
-INSERT INTO `sys_menu` VALUES (98, 90, 3, 1, '数据库管理', 'Database', 'mnt/database/index', 26, 'database', 'mnt/database', b'0', b'0', b'0', 'database:list', NULL, NULL, '2019-11-10 20:40:04', NULL);
-INSERT INTO `sys_menu` VALUES (102, 97, 0, 2, '删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'deployHistory:del', NULL, NULL, '2019-11-17 09:32:48', NULL);
-INSERT INTO `sys_menu` VALUES (103, 92, 0, 2, '服务器新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:add', NULL, NULL, '2019-11-17 11:08:33', NULL);
-INSERT INTO `sys_menu` VALUES (104, 92, 0, 2, '服务器编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:edit', NULL, NULL, '2019-11-17 11:08:57', NULL);
-INSERT INTO `sys_menu` VALUES (105, 92, 0, 2, '服务器删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:del', NULL, NULL, '2019-11-17 11:09:15', NULL);
-INSERT INTO `sys_menu` VALUES (106, 93, 0, 2, '应用新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:add', NULL, NULL, '2019-11-17 11:10:03', NULL);
-INSERT INTO `sys_menu` VALUES (107, 93, 0, 2, '应用编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:edit', NULL, NULL, '2019-11-17 11:10:28', NULL);
-INSERT INTO `sys_menu` VALUES (108, 93, 0, 2, '应用删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:del', NULL, NULL, '2019-11-17 11:10:55', NULL);
-INSERT INTO `sys_menu` VALUES (109, 94, 0, 2, '部署新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:add', NULL, NULL, '2019-11-17 11:11:22', NULL);
-INSERT INTO `sys_menu` VALUES (110, 94, 0, 2, '部署编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:edit', NULL, NULL, '2019-11-17 11:11:41', NULL);
-INSERT INTO `sys_menu` VALUES (111, 94, 0, 2, '部署删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:del', NULL, NULL, '2019-11-17 11:12:01', NULL);
-INSERT INTO `sys_menu` VALUES (112, 98, 0, 2, '数据库新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'database:add', NULL, NULL, '2019-11-17 11:12:43', NULL);
-INSERT INTO `sys_menu` VALUES (113, 98, 0, 2, '数据库编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'database:edit', NULL, NULL, '2019-11-17 11:12:58', NULL);
-INSERT INTO `sys_menu` VALUES (114, 98, 0, 2, '数据库删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'database:del', NULL, NULL, '2019-11-17 11:13:14', NULL);
-INSERT INTO `sys_menu` VALUES (116, 36, 0, 1, '生成预览', 'Preview', 'generator/preview', 999, 'java', 'generator/preview/:tableName', b'0', b'1', b'1', NULL, NULL, NULL, '2019-11-26 14:54:36', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, NULL, 7, 0, '系统管理', NULL, NULL, 1, 'system', 'system', b'0', b'0', b'0', NULL, NULL, 'admin', '2018-12-18 15:11:29', '2025-01-14 15:48:18');
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, 1, 3, 1, '用户管理', 'User', 'system/user/index', 2, 'peoples', 'user', b'0', b'0', b'0', 'user:list', NULL, NULL, '2018-12-18 15:14:44', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (3, 1, 3, 1, '角色管理', 'Role', 'system/role/index', 3, 'role', 'role', b'0', b'0', b'0', 'roles:list', NULL, NULL, '2018-12-18 15:16:07', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 1, 3, 1, '菜单管理', 'Menu', 'system/menu/index', 5, 'menu', 'menu', b'0', b'0', b'0', 'menu:list', NULL, NULL, '2018-12-18 15:17:28', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (6, NULL, 5, 0, '系统监控', NULL, NULL, 10, 'monitor', 'monitor', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:17:48', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (7, 6, 0, 1, '操作日志', 'Log', 'monitor/log/index', 11, 'log', 'logs', b'0', b'1', b'0', NULL, NULL, 'admin', '2018-12-18 15:18:26', '2020-06-06 13:11:57');
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (9, 6, 0, 1, 'SQL监控', 'Sql', 'monitor/sql/index', 18, 'sqlMonitor', 'druid', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:19:34', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (10, NULL, 5, 0, '组件管理', NULL, NULL, 50, 'zujian', 'components', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-19 13:38:16', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (11, 10, 0, 1, '图标库', 'Icons', 'components/icons/index', 51, 'icon', 'icon', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-19 13:38:49', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (14, 36, 0, 1, '邮件工具', 'Email', 'tools/email/index', 35, 'email', 'email', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-27 10:13:09', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (15, 10, 0, 1, '富文本', 'Editor', 'components/Editor', 52, 'fwb', 'tinymce', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-27 11:58:25', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (18, 36, 3, 1, '存储管理', 'Storage', 'tools/storage/index', 34, 'qiniu', 'storage', b'0', b'0', b'0', 'storage:list', NULL, NULL, '2018-12-31 11:12:15', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (19, 36, 0, 1, '支付宝工具', 'AliPay', 'tools/aliPay/index', 37, 'alipay', 'aliPay', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-31 14:52:38', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (21, NULL, 2, 0, '多级菜单', NULL, '', 900, 'menu', 'nested', b'0', b'0', b'0', NULL, NULL, 'admin', '2019-01-04 16:22:03', '2020-06-21 17:27:35');
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (22, 21, 2, 0, '二级菜单1', NULL, '', 999, 'menu', 'menu1', b'0', b'0', b'0', NULL, NULL, 'admin', '2019-01-04 16:23:29', '2020-06-21 17:27:20');
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (23, 21, 0, 1, '二级菜单2', NULL, 'nested/menu2/index', 999, 'menu', 'menu2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-04 16:23:57', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (24, 22, 0, 1, '三级菜单1', 'Test', 'nested/menu1/menu1-1', 999, 'menu', 'menu1-1', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-04 16:24:48', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (27, 22, 0, 1, '三级菜单2', NULL, 'nested/menu1/menu1-2', 999, 'menu', 'menu1-2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-07 17:27:32', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (28, 1, 3, 1, '任务调度', 'Timing', 'system/timing/index', 999, 'timing', 'timing', b'0', b'0', b'0', 'timing:list', NULL, NULL, '2019-01-07 20:34:40', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (30, 36, 0, 1, '代码生成', 'GeneratorIndex', 'generator/index', 32, 'dev', 'generator', b'0', b'1', b'0', NULL, NULL, NULL, '2019-01-11 15:45:55', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (32, 6, 0, 1, '异常日志', 'ErrorLog', 'monitor/log/errorLog', 12, 'error', 'errorLog', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-13 13:49:03', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (33, 10, 0, 1, 'Markdown', 'Markdown', 'components/MarkDown', 53, 'markdown', 'markdown', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-08 13:46:44', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (34, 10, 0, 1, 'Yaml编辑器', 'YamlEdit', 'components/YamlEdit', 54, 'dev', 'yaml', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-08 15:49:40', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (35, 1, 3, 1, '部门管理', 'Dept', 'system/dept/index', 6, 'dept', 'dept', b'0', b'0', b'0', 'dept:list', NULL, NULL, '2019-03-25 09:46:00', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (36, NULL, 6, 0, '系统工具', NULL, '', 30, 'sys-tools', 'sys-tools', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-29 10:57:35', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (37, 1, 3, 1, '岗位管理', 'Job', 'system/job/index', 7, 'Steve-Jobs', 'job', b'0', b'0', b'0', 'job:list', NULL, NULL, '2019-03-29 13:51:18', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (39, 1, 3, 1, '字典管理', 'Dict', 'system/dict/index', 8, 'dictionary', 'dict', b'0', b'0', b'0', 'dict:list', NULL, NULL, '2019-04-10 11:49:04', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (41, 6, 0, 1, '在线用户', 'OnlineUser', 'monitor/online/index', 10, 'Steve-Jobs', 'online', b'0', b'0', b'0', NULL, NULL, NULL, '2019-10-26 22:08:43', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (44, 2, 0, 2, '用户新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'user:add', NULL, NULL, '2019-10-29 10:59:46', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (45, 2, 0, 2, '用户编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'user:edit', NULL, NULL, '2019-10-29 11:00:08', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (46, 2, 0, 2, '用户删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'user:del', NULL, NULL, '2019-10-29 11:00:23', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (48, 3, 0, 2, '角色创建', NULL, '', 2, '', '', b'0', b'0', b'0', 'roles:add', NULL, NULL, '2019-10-29 12:45:34', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (49, 3, 0, 2, '角色修改', NULL, '', 3, '', '', b'0', b'0', b'0', 'roles:edit', NULL, NULL, '2019-10-29 12:46:16', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (50, 3, 0, 2, '角色删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'roles:del', NULL, NULL, '2019-10-29 12:46:51', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (52, 5, 0, 2, '菜单新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'menu:add', NULL, NULL, '2019-10-29 12:55:07', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (53, 5, 0, 2, '菜单编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'menu:edit', NULL, NULL, '2019-10-29 12:55:40', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (54, 5, 0, 2, '菜单删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'menu:del', NULL, NULL, '2019-10-29 12:56:00', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (56, 35, 0, 2, '部门新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'dept:add', NULL, NULL, '2019-10-29 12:57:09', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (57, 35, 0, 2, '部门编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'dept:edit', NULL, NULL, '2019-10-29 12:57:27', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (58, 35, 0, 2, '部门删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'dept:del', NULL, NULL, '2019-10-29 12:57:41', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (60, 37, 0, 2, '岗位新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'job:add', NULL, NULL, '2019-10-29 12:58:27', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (61, 37, 0, 2, '岗位编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'job:edit', NULL, NULL, '2019-10-29 12:58:45', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (62, 37, 0, 2, '岗位删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'job:del', NULL, NULL, '2019-10-29 12:59:04', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (64, 39, 0, 2, '字典新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'dict:add', NULL, NULL, '2019-10-29 13:00:17', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (65, 39, 0, 2, '字典编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'dict:edit', NULL, NULL, '2019-10-29 13:00:42', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (66, 39, 0, 2, '字典删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'dict:del', NULL, NULL, '2019-10-29 13:00:59', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (73, 28, 0, 2, '任务新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'timing:add', NULL, NULL, '2019-10-29 13:07:28', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (74, 28, 0, 2, '任务编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'timing:edit', NULL, NULL, '2019-10-29 13:07:41', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (75, 28, 0, 2, '任务删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'timing:del', NULL, NULL, '2019-10-29 13:07:54', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (77, 18, 0, 2, '上传文件', NULL, '', 2, '', '', b'0', b'0', b'0', 'storage:add', NULL, NULL, '2019-10-29 13:09:09', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (78, 18, 0, 2, '文件编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'storage:edit', NULL, NULL, '2019-10-29 13:09:22', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (79, 18, 0, 2, '文件删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'storage:del', NULL, NULL, '2019-10-29 13:09:34', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (80, 6, 0, 1, '服务监控', 'ServerMonitor', 'monitor/server/index', 14, 'codeConsole', 'server', b'0', b'0', b'0', 'monitor:list', NULL, 'admin', '2019-11-07 13:06:39', '2020-05-04 18:20:50');
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (82, 36, 0, 1, '生成配置', 'GeneratorConfig', 'generator/config', 33, 'dev', 'generator/config/:tableName', b'0', b'1', b'1', '', NULL, NULL, '2019-11-17 20:08:56', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (83, 10, 0, 1, '图表库', 'Echarts', 'components/Echarts', 50, 'chart', 'echarts', b'0', b'1', b'0', '', NULL, NULL, '2019-11-21 09:04:32', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (90, NULL, 5, 1, '运维管理', 'Mnt', '', 20, 'mnt', 'mnt', b'0', b'0', b'0', NULL, NULL, NULL, '2019-11-09 10:31:08', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (92, 90, 3, 1, '服务器', 'ServerDeploy', 'maint/server/index', 22, 'server', 'maint/serverDeploy', b'0', b'0', b'0', 'serverDeploy:list', NULL, NULL, '2019-11-10 10:29:25', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (93, 90, 3, 1, '应用管理', 'App', 'maint/app/index', 23, 'app', 'maint/app', b'0', b'0', b'0', 'app:list', NULL, NULL, '2019-11-10 11:05:16', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (94, 90, 3, 1, '部署管理', 'Deploy', 'maint/deploy/index', 24, 'deploy', 'maint/deploy', b'0', b'0', b'0', 'deploy:list', NULL, NULL, '2019-11-10 15:56:55', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (97, 90, 1, 1, '部署备份', 'DeployHistory', 'maint/deployHistory/index', 25, 'backup', 'maint/deployHistory', b'0', b'0', b'0', 'deployHistory:list', NULL, NULL, '2019-11-10 16:49:44', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (98, 90, 3, 1, '数据库管理', 'Database', 'maint/database/index', 26, 'database', 'maint/database', b'0', b'0', b'0', 'database:list', NULL, NULL, '2019-11-10 20:40:04', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (102, 97, 0, 2, '删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'deployHistory:del', NULL, NULL, '2019-11-17 09:32:48', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (103, 92, 0, 2, '服务器新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:add', NULL, NULL, '2019-11-17 11:08:33', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (104, 92, 0, 2, '服务器编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:edit', NULL, NULL, '2019-11-17 11:08:57', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (105, 92, 0, 2, '服务器删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:del', NULL, NULL, '2019-11-17 11:09:15', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (106, 93, 0, 2, '应用新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:add', NULL, NULL, '2019-11-17 11:10:03', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (107, 93, 0, 2, '应用编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:edit', NULL, NULL, '2019-11-17 11:10:28', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (108, 93, 0, 2, '应用删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:del', NULL, NULL, '2019-11-17 11:10:55', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (109, 94, 0, 2, '部署新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:add', NULL, NULL, '2019-11-17 11:11:22', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (110, 94, 0, 2, '部署编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:edit', NULL, NULL, '2019-11-17 11:11:41', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (111, 94, 0, 2, '部署删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:del', NULL, NULL, '2019-11-17 11:12:01', NULL);
+INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (116, 36, 0, 1, '生成预览', 'Preview', 'generator/preview', 999, 'java', 'generator/preview/:tableName', b'0', b'1', b'1', NULL, NULL, NULL, '2019-11-26 14:54:36', NULL);
COMMIT;
-- ----------------------------
@@ -455,17 +476,17 @@ CREATE TABLE `sys_quartz_job` (
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`job_id`) USING BTREE,
- KEY `inx_is_pause` (`is_pause`)
-) ENGINE=InnoDB AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='定时任务';
+ KEY `idx_is_pause` (`is_pause`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='定时任务';
-- ----------------------------
-- Records of sys_quartz_job
-- ----------------------------
BEGIN;
-INSERT INTO `sys_quartz_job` VALUES (2, 'testTask', '0/5 * * * * ?', b'1', '测试1', 'run1', 'test', '带参测试,多参使用json', '测试', NULL, NULL, NULL, NULL, 'admin', '2019-08-22 14:08:29', '2020-05-24 13:58:33');
-INSERT INTO `sys_quartz_job` VALUES (3, 'testTask', '0/5 * * * * ?', b'1', '测试', 'run', '', '不带参测试', 'Zheng Jie', '', '5,6', b'1', NULL, 'admin', '2019-09-26 16:44:39', '2020-05-24 14:48:12');
-INSERT INTO `sys_quartz_job` VALUES (5, 'Test', '0/5 * * * * ?', b'1', '任务告警测试', 'run', NULL, '测试', 'test', '', NULL, b'1', 'admin', 'admin', '2020-05-05 20:32:41', '2020-05-05 20:36:13');
-INSERT INTO `sys_quartz_job` VALUES (6, 'testTask', '0/5 * * * * ?', b'1', '测试3', 'run2', NULL, '测试3', 'Zheng Jie', '', NULL, b'1', 'admin', 'admin', '2020-05-05 20:35:41', '2020-05-05 20:36:07');
+INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, 'testTask', '0/5 * * * * ?', b'1', '测试1', 'run1', 'test', '带参测试,多参使用json', '测试', NULL, NULL, NULL, NULL, 'admin', '2019-08-22 14:08:29', '2020-05-24 13:58:33');
+INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (3, 'testTask', '0/5 * * * * ?', b'1', '测试', 'run', '', '不带参测试', 'Zheng Jie', '', '6', b'1', NULL, 'admin', '2019-09-26 16:44:39', '2020-05-24 14:48:12');
+INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 'Test', '0/5 * * * * ?', b'1', '任务告警测试', 'run', NULL, '测试', 'test', '', NULL, b'1', 'admin', 'admin', '2020-05-05 20:32:41', '2020-05-05 20:36:13');
+INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (6, 'testTask', '0/5 * * * * ?', b'1', '测试3', 'run2', NULL, '测试3', 'Zheng Jie', '', NULL, b'1', 'admin', 'admin', '2020-05-05 20:35:41', '2020-05-05 20:36:07');
COMMIT;
-- ----------------------------
@@ -474,17 +495,23 @@ COMMIT;
DROP TABLE IF EXISTS `sys_quartz_log`;
CREATE TABLE `sys_quartz_log` (
`log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `bean_name` varchar(255) DEFAULT NULL,
- `create_time` datetime DEFAULT NULL,
- `cron_expression` varchar(255) DEFAULT NULL,
- `exception_detail` text DEFAULT NULL,
- `is_success` bit(1) DEFAULT NULL,
- `job_name` varchar(255) DEFAULT NULL,
- `method_name` varchar(255) DEFAULT NULL,
- `params` varchar(255) DEFAULT NULL,
- `time` bigint(20) DEFAULT NULL,
+ `bean_name` varchar(255) DEFAULT NULL COMMENT 'Bean名称',
+ `cron_expression` varchar(255) DEFAULT NULL COMMENT 'cron 表达式',
+ `is_success` bit(1) DEFAULT NULL COMMENT '是否执行成功',
+ `job_name` varchar(255) DEFAULT NULL COMMENT '任务名称',
+ `method_name` varchar(255) DEFAULT NULL COMMENT '方法名称',
+ `params` varchar(255) DEFAULT NULL COMMENT '参数',
+ `time` bigint(20) DEFAULT NULL COMMENT '执行耗时',
+ `exception_detail` text DEFAULT NULL COMMENT '异常详情',
+ `create_time` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`log_id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=151 ROW_FORMAT=COMPACT COMMENT='定时任务日志';
+) ENGINE=InnoDB AUTO_INCREMENT=262 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='定时任务日志';
+
+-- ----------------------------
+-- Records of sys_quartz_log
+-- ----------------------------
+BEGIN;
+COMMIT;
-- ----------------------------
-- Table structure for sys_role
@@ -502,15 +529,15 @@ CREATE TABLE `sys_role` (
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`role_id`) USING BTREE,
UNIQUE KEY `uniq_name` (`name`),
- KEY `role_name_index` (`name`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 ROW_FORMAT=COMPACT COMMENT='角色表';
+ KEY `idx_level` (`level`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='角色表';
-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
-INSERT INTO `sys_role` VALUES (1, '超级管理员', 1, '-', '全部', NULL, 'admin', '2018-11-23 11:04:37', '2020-08-06 16:10:24');
-INSERT INTO `sys_role` VALUES (2, '普通用户', 2, '-', '本级', NULL, 'admin', '2018-11-23 13:09:06', '2020-09-05 10:45:12');
+INSERT INTO `sys_role` (`role_id`, `name`, `level`, `description`, `data_scope`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, '超级管理员', 1, '-', '全部', NULL, 'admin', '2018-11-23 11:04:37', '2020-08-06 16:10:24');
+INSERT INTO `sys_role` (`role_id`, `name`, `level`, `description`, `data_scope`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, '普通用户', 2, '-', '本级', NULL, 'admin', '2018-11-23 13:09:06', '2020-09-05 10:45:12');
COMMIT;
-- ----------------------------
@@ -518,11 +545,18 @@ COMMIT;
-- ----------------------------
DROP TABLE IF EXISTS `sys_roles_depts`;
CREATE TABLE `sys_roles_depts` (
- `role_id` bigint(20) NOT NULL,
- `dept_id` bigint(20) NOT NULL,
+ `role_id` bigint(20) NOT NULL COMMENT '角色ID',
+ `dept_id` bigint(20) NOT NULL COMMENT '部门ID',
PRIMARY KEY (`role_id`,`dept_id`) USING BTREE,
- KEY `FK7qg6itn5ajdoa9h9o78v9ksur` (`dept_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='角色部门关联';
+ KEY `idx_role_id` (`role_id`),
+ KEY `idx_dept_id` (`dept_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='角色部门关联';
+
+-- ----------------------------
+-- Records of sys_roles_depts
+-- ----------------------------
+BEGIN;
+COMMIT;
-- ----------------------------
-- Table structure for sys_roles_menus
@@ -532,113 +566,110 @@ CREATE TABLE `sys_roles_menus` (
`menu_id` bigint(20) NOT NULL COMMENT '菜单ID',
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`menu_id`,`role_id`) USING BTREE,
- KEY `FKcngg2qadojhi3a651a5adkvbq` (`role_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='角色菜单关联';
+ KEY `idx_menu_id` (`menu_id`),
+ KEY `idx_role_id` (`role_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='角色菜单关联';
-- ----------------------------
-- Records of sys_roles_menus
-- ----------------------------
BEGIN;
-INSERT INTO `sys_roles_menus` VALUES (1, 1);
-INSERT INTO `sys_roles_menus` VALUES (2, 1);
-INSERT INTO `sys_roles_menus` VALUES (3, 1);
-INSERT INTO `sys_roles_menus` VALUES (5, 1);
-INSERT INTO `sys_roles_menus` VALUES (6, 1);
-INSERT INTO `sys_roles_menus` VALUES (7, 1);
-INSERT INTO `sys_roles_menus` VALUES (9, 1);
-INSERT INTO `sys_roles_menus` VALUES (10, 1);
-INSERT INTO `sys_roles_menus` VALUES (11, 1);
-INSERT INTO `sys_roles_menus` VALUES (14, 1);
-INSERT INTO `sys_roles_menus` VALUES (15, 1);
-INSERT INTO `sys_roles_menus` VALUES (18, 1);
-INSERT INTO `sys_roles_menus` VALUES (19, 1);
-INSERT INTO `sys_roles_menus` VALUES (21, 1);
-INSERT INTO `sys_roles_menus` VALUES (22, 1);
-INSERT INTO `sys_roles_menus` VALUES (23, 1);
-INSERT INTO `sys_roles_menus` VALUES (24, 1);
-INSERT INTO `sys_roles_menus` VALUES (27, 1);
-INSERT INTO `sys_roles_menus` VALUES (28, 1);
-INSERT INTO `sys_roles_menus` VALUES (30, 1);
-INSERT INTO `sys_roles_menus` VALUES (32, 1);
-INSERT INTO `sys_roles_menus` VALUES (33, 1);
-INSERT INTO `sys_roles_menus` VALUES (34, 1);
-INSERT INTO `sys_roles_menus` VALUES (35, 1);
-INSERT INTO `sys_roles_menus` VALUES (36, 1);
-INSERT INTO `sys_roles_menus` VALUES (37, 1);
-INSERT INTO `sys_roles_menus` VALUES (38, 1);
-INSERT INTO `sys_roles_menus` VALUES (39, 1);
-INSERT INTO `sys_roles_menus` VALUES (41, 1);
-INSERT INTO `sys_roles_menus` VALUES (44, 1);
-INSERT INTO `sys_roles_menus` VALUES (45, 1);
-INSERT INTO `sys_roles_menus` VALUES (46, 1);
-INSERT INTO `sys_roles_menus` VALUES (48, 1);
-INSERT INTO `sys_roles_menus` VALUES (49, 1);
-INSERT INTO `sys_roles_menus` VALUES (50, 1);
-INSERT INTO `sys_roles_menus` VALUES (52, 1);
-INSERT INTO `sys_roles_menus` VALUES (53, 1);
-INSERT INTO `sys_roles_menus` VALUES (54, 1);
-INSERT INTO `sys_roles_menus` VALUES (56, 1);
-INSERT INTO `sys_roles_menus` VALUES (57, 1);
-INSERT INTO `sys_roles_menus` VALUES (58, 1);
-INSERT INTO `sys_roles_menus` VALUES (60, 1);
-INSERT INTO `sys_roles_menus` VALUES (61, 1);
-INSERT INTO `sys_roles_menus` VALUES (62, 1);
-INSERT INTO `sys_roles_menus` VALUES (64, 1);
-INSERT INTO `sys_roles_menus` VALUES (65, 1);
-INSERT INTO `sys_roles_menus` VALUES (66, 1);
-INSERT INTO `sys_roles_menus` VALUES (73, 1);
-INSERT INTO `sys_roles_menus` VALUES (74, 1);
-INSERT INTO `sys_roles_menus` VALUES (75, 1);
-INSERT INTO `sys_roles_menus` VALUES (77, 1);
-INSERT INTO `sys_roles_menus` VALUES (78, 1);
-INSERT INTO `sys_roles_menus` VALUES (79, 1);
-INSERT INTO `sys_roles_menus` VALUES (80, 1);
-INSERT INTO `sys_roles_menus` VALUES (82, 1);
-INSERT INTO `sys_roles_menus` VALUES (83, 1);
-INSERT INTO `sys_roles_menus` VALUES (90, 1);
-INSERT INTO `sys_roles_menus` VALUES (92, 1);
-INSERT INTO `sys_roles_menus` VALUES (93, 1);
-INSERT INTO `sys_roles_menus` VALUES (94, 1);
-INSERT INTO `sys_roles_menus` VALUES (97, 1);
-INSERT INTO `sys_roles_menus` VALUES (98, 1);
-INSERT INTO `sys_roles_menus` VALUES (102, 1);
-INSERT INTO `sys_roles_menus` VALUES (103, 1);
-INSERT INTO `sys_roles_menus` VALUES (104, 1);
-INSERT INTO `sys_roles_menus` VALUES (105, 1);
-INSERT INTO `sys_roles_menus` VALUES (106, 1);
-INSERT INTO `sys_roles_menus` VALUES (107, 1);
-INSERT INTO `sys_roles_menus` VALUES (108, 1);
-INSERT INTO `sys_roles_menus` VALUES (109, 1);
-INSERT INTO `sys_roles_menus` VALUES (110, 1);
-INSERT INTO `sys_roles_menus` VALUES (111, 1);
-INSERT INTO `sys_roles_menus` VALUES (112, 1);
-INSERT INTO `sys_roles_menus` VALUES (113, 1);
-INSERT INTO `sys_roles_menus` VALUES (114, 1);
-INSERT INTO `sys_roles_menus` VALUES (116, 1);
-INSERT INTO `sys_roles_menus` VALUES (1, 2);
-INSERT INTO `sys_roles_menus` VALUES (2, 2);
-INSERT INTO `sys_roles_menus` VALUES (6, 2);
-INSERT INTO `sys_roles_menus` VALUES (7, 2);
-INSERT INTO `sys_roles_menus` VALUES (9, 2);
-INSERT INTO `sys_roles_menus` VALUES (10, 2);
-INSERT INTO `sys_roles_menus` VALUES (11, 2);
-INSERT INTO `sys_roles_menus` VALUES (14, 2);
-INSERT INTO `sys_roles_menus` VALUES (15, 2);
-INSERT INTO `sys_roles_menus` VALUES (19, 2);
-INSERT INTO `sys_roles_menus` VALUES (21, 2);
-INSERT INTO `sys_roles_menus` VALUES (22, 2);
-INSERT INTO `sys_roles_menus` VALUES (23, 2);
-INSERT INTO `sys_roles_menus` VALUES (24, 2);
-INSERT INTO `sys_roles_menus` VALUES (27, 2);
-INSERT INTO `sys_roles_menus` VALUES (30, 2);
-INSERT INTO `sys_roles_menus` VALUES (32, 2);
-INSERT INTO `sys_roles_menus` VALUES (33, 2);
-INSERT INTO `sys_roles_menus` VALUES (34, 2);
-INSERT INTO `sys_roles_menus` VALUES (36, 2);
-INSERT INTO `sys_roles_menus` VALUES (80, 2);
-INSERT INTO `sys_roles_menus` VALUES (82, 2);
-INSERT INTO `sys_roles_menus` VALUES (83, 2);
-INSERT INTO `sys_roles_menus` VALUES (116, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (1, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (1, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (2, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (2, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (3, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (5, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (6, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (6, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (7, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (7, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (9, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (9, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (10, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (10, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (11, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (11, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (14, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (14, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (15, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (15, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (18, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (19, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (19, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (21, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (21, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (22, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (22, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (23, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (23, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (24, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (24, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (27, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (27, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (28, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (30, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (30, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (32, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (32, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (33, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (33, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (34, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (34, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (35, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (36, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (36, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (37, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (39, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (41, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (44, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (45, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (46, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (48, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (49, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (50, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (52, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (53, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (54, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (56, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (57, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (58, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (60, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (61, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (62, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (64, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (65, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (66, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (73, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (74, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (75, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (77, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (78, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (79, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (80, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (80, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (82, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (82, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (83, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (83, 2);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (90, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (92, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (93, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (94, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (97, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (98, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (102, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (103, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (104, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (105, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (106, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (107, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (108, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (109, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (110, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (111, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (116, 1);
+INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (116, 2);
COMMIT;
-- ----------------------------
@@ -657,27 +688,25 @@ CREATE TABLE `sys_user` (
`avatar_path` varchar(255) DEFAULT NULL COMMENT '头像真实路径',
`password` varchar(255) DEFAULT NULL COMMENT '密码',
`is_admin` bit(1) DEFAULT b'0' COMMENT '是否为admin账号',
- `enabled` bit(1) DEFAULT NULL COMMENT '状态:1启用、0禁用',
+ `enabled` bit(1) DEFAULT NULL COMMENT '状态:1启用、0禁用',
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
`update_by` varchar(255) DEFAULT NULL COMMENT '更新者',
`pwd_reset_time` datetime DEFAULT NULL COMMENT '修改密码的时间',
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`user_id`) USING BTREE,
- UNIQUE KEY `UK_kpubos9gc2cvtkb0thktkbkes` (`email`) USING BTREE,
- UNIQUE KEY `username` (`username`) USING BTREE,
- UNIQUE KEY `uniq_username` (`username`),
- UNIQUE KEY `uniq_email` (`email`),
- KEY `FK5rwmryny6jthaaxkogownknqp` (`dept_id`) USING BTREE,
- KEY `inx_enabled` (`enabled`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 ROW_FORMAT=COMPACT COMMENT='系统用户';
+ UNIQUE KEY `uniq_email` (`email`) USING BTREE,
+ UNIQUE KEY `uniq_username` (`username`) USING BTREE,
+ KEY `idx_dept_id` (`dept_id`) USING BTREE,
+ KEY `idx_enabled` (`enabled`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='系统用户';
-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
-INSERT INTO `sys_user` VALUES (1, 2, 'admin', '管理员', '男', '18888888888', '201507802@qq.com', 'avatar-20200806032259161.png', '/Users/jie/Documents/work/me/admin/eladmin/~/avatar/avatar-20200806032259161.png', '$2a$10$Egp1/gvFlt7zhlXVfEFw4OfWQCGPw0ClmMcc6FjTnvXNRVf9zdMRa', b'1', 1, NULL, 'admin', '2020-05-03 16:38:31', '2018-08-23 09:11:56', '2020-09-05 10:43:31');
-INSERT INTO `sys_user` VALUES (2, 2, 'test', '测试', '男', '19999999999', '231@qq.com', NULL, NULL, '$2a$10$4XcyudOYTSz6fue6KFNMHeUQnCX5jbBQypLEnGk1PmekXt5c95JcK', b'0', 1, 'admin', 'admin', NULL, '2020-05-05 11:15:49', '2020-09-05 10:43:38');
+INSERT INTO `sys_user` (`user_id`, `dept_id`, `username`, `nick_name`, `gender`, `phone`, `email`, `avatar_name`, `avatar_path`, `password`, `is_admin`, `enabled`, `create_by`, `update_by`, `pwd_reset_time`, `create_time`, `update_time`) VALUES (1, 2, 'admin', '管理员', '男', '18888888888', '201507802@qq.com', 'avatar-20250114101539224.png', '/Users/jie/Documents/work/me/admin/eladmin-mp/eladmin/~/avatar/avatar-20250114101539224.png', '$2a$10$Egp1/gvFlt7zhlXVfEFw4OfWQCGPw0ClmMcc6FjTnvXNRVf9zdMRa', b'1', b'1', NULL, 'admin', '2020-05-03 16:38:31', '2018-08-23 09:11:56', '2020-09-05 10:43:31');
+INSERT INTO `sys_user` (`user_id`, `dept_id`, `username`, `nick_name`, `gender`, `phone`, `email`, `avatar_name`, `avatar_path`, `password`, `is_admin`, `enabled`, `create_by`, `update_by`, `pwd_reset_time`, `create_time`, `update_time`) VALUES (2, 2, 'test', '测试', '男', '19999999999', '231@qq.com', NULL, NULL, '$2a$10$4XcyudOYTSz6fue6KFNMHeUQnCX5jbBQypLEnGk1PmekXt5c95JcK', b'0', b'1', 'admin', 'admin', NULL, '2020-05-05 11:15:49', '2020-09-05 10:43:38');
COMMIT;
-- ----------------------------
@@ -687,15 +716,17 @@ DROP TABLE IF EXISTS `sys_users_jobs`;
CREATE TABLE `sys_users_jobs` (
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
`job_id` bigint(20) NOT NULL COMMENT '岗位ID',
- PRIMARY KEY (`user_id`,`job_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ PRIMARY KEY (`user_id`,`job_id`),
+ KEY `idx_user_id` (`user_id`),
+ KEY `idx_job_id` (`job_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='用户与岗位关联表';
-- ----------------------------
-- Records of sys_users_jobs
-- ----------------------------
BEGIN;
-INSERT INTO `sys_users_jobs` VALUES (1, 11);
-INSERT INTO `sys_users_jobs` VALUES (2, 12);
+INSERT INTO `sys_users_jobs` (`user_id`, `job_id`) VALUES (1, 11);
+INSERT INTO `sys_users_jobs` (`user_id`, `job_id`) VALUES (2, 12);
COMMIT;
-- ----------------------------
@@ -706,15 +737,16 @@ CREATE TABLE `sys_users_roles` (
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`user_id`,`role_id`) USING BTREE,
- KEY `FKq4eq273l04bpu4efj0jd0jb98` (`role_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='用户角色关联';
+ KEY `idx_user_id` (`user_id`),
+ KEY `idx_role_id` (`role_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='用户角色关联';
-- ----------------------------
-- Records of sys_users_roles
-- ----------------------------
BEGIN;
-INSERT INTO `sys_users_roles` VALUES (1, 1);
-INSERT INTO `sys_users_roles` VALUES (2, 2);
+INSERT INTO `sys_users_roles` (`user_id`, `role_id`) VALUES (1, 1);
+INSERT INTO `sys_users_roles` (`user_id`, `role_id`) VALUES (2, 2);
COMMIT;
-- ----------------------------
@@ -734,13 +766,12 @@ CREATE TABLE `tool_alipay_config` (
`sign_type` varchar(255) DEFAULT NULL COMMENT '签名方式',
`sys_service_provider_id` varchar(255) DEFAULT NULL COMMENT '商户号',
PRIMARY KEY (`config_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='支付宝配置类';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='支付宝配置类';
-- ----------------------------
-- Records of tool_alipay_config
-- ----------------------------
BEGIN;
-INSERT INTO `tool_alipay_config` VALUES (1, '2016091700532697', 'utf-8', 'JSON', 'https://openapi.alipaydev.com/gateway.do', 'http://api.auauz.net/api/aliPay/notify', 'MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5js8sInU10AJ0cAQ8UMMyXrQ+oHZEkVt5lBwsStmTJ7YikVYgbskx1YYEXTojRsWCb+SH/kDmDU4pK/u91SJ4KFCRMF2411piYuXU/jF96zKrADznYh/zAraqT6hvAIVtQAlMHN53nx16rLzZ/8jDEkaSwT7+HvHiS+7sxSojnu/3oV7BtgISoUNstmSe8WpWHOaWv19xyS+Mce9MY4BfseFhzTICUymUQdd/8hXA28/H6osUfAgsnxAKv7Wil3aJSgaJczWuflYOve0dJ3InZkhw5Cvr0atwpk8YKBQjy5CdkoHqvkOcIB+cYHXJKzOE5tqU7inSwVbHzOLQ3XbnAgMBAAECggEAVJp5eT0Ixg1eYSqFs9568WdetUNCSUchNxDBu6wxAbhUgfRUGZuJnnAll63OCTGGck+EGkFh48JjRcBpGoeoHLL88QXlZZbC/iLrea6gcDIhuvfzzOffe1RcZtDFEj9hlotg8dQj1tS0gy9pN9g4+EBH7zeu+fyv+qb2e/v1l6FkISXUjpkD7RLQr3ykjiiEw9BpeKb7j5s7Kdx1NNIzhkcQKNqlk8JrTGDNInbDM6inZfwwIO2R1DHinwdfKWkvOTODTYa2MoAvVMFT9Bec9FbLpoWp7ogv1JMV9svgrcF9XLzANZ/OQvkbe9TV9GWYvIbxN6qwQioKCWO4GPnCAQKBgQDgW5MgfhX8yjXqoaUy/d1VjI8dHeIyw8d+OBAYwaxRSlCfyQ+tieWcR2HdTzPca0T0GkWcKZm0ei5xRURgxt4DUDLXNh26HG0qObbtLJdu/AuBUuCqgOiLqJ2f1uIbrz6OZUHns+bT/jGW2Ws8+C13zTCZkZt9CaQsrp3QOGDx5wKBgQDTul39hp3ZPwGNFeZdkGoUoViOSd5Lhowd5wYMGAEXWRLlU8z+smT5v0POz9JnIbCRchIY2FAPKRdVTICzmPk2EPJFxYTcwaNbVqL6lN7J2IlXXMiit5QbiLauo55w7plwV6LQmKm9KV7JsZs5XwqF7CEovI7GevFzyD3w+uizAQKBgC3LY1eRhOlpWOIAhpjG6qOoohmeXOphvdmMlfSHq6WYFqbWwmV4rS5d/6LNpNdL6fItXqIGd8I34jzql49taCmi+A2nlR/E559j0mvM20gjGDIYeZUz5MOE8k+K6/IcrhcgofgqZ2ZED1ksHdB/E8DNWCswZl16V1FrfvjeWSNnAoGAMrBplCrIW5xz+J0Hm9rZKrs+AkK5D4fUv8vxbK/KgxZ2KaUYbNm0xv39c+PZUYuFRCz1HDGdaSPDTE6WeWjkMQd5mS6ikl9hhpqFRkyh0d0fdGToO9yLftQKOGE/q3XUEktI1XvXF0xyPwNgUCnq0QkpHyGVZPtGFxwXiDvpvgECgYA5PoB+nY8iDiRaJNko9w0hL4AeKogwf+4TbCw+KWVEn6jhuJa4LFTdSqp89PktQaoVpwv92el/AhYjWOl/jVCm122f9b7GyoelbjMNolToDwe5pF5RnSpEuDdLy9MfE8LnE3PlbE7E5BipQ3UjSebkgNboLHH/lNZA5qvEtvbfvQ==', 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAut9evKRuHJ/2QNfDlLwvN/S8l9hRAgPbb0u61bm4AtzaTGsLeMtScetxTWJnVvAVpMS9luhEJjt+Sbk5TNLArsgzzwARgaTKOLMT1TvWAK5EbHyI+eSrc3s7Awe1VYGwcubRFWDm16eQLv0k7iqiw+4mweHSz/wWyvBJVgwLoQ02btVtAQErCfSJCOmt0Q/oJQjj08YNRV4EKzB19+f5A+HQVAKy72dSybTzAK+3FPtTtNen/+b5wGeat7c32dhYHnGorPkPeXLtsqqUTp1su5fMfd4lElNdZaoCI7osZxWWUo17vBCZnyeXc9fk0qwD9mK6yRAxNbrY72Xx5VqIqwIDAQAB', 'http://api.auauz.net/api/aliPay/return', 'RSA2', '2088102176044281');
COMMIT;
-- ----------------------------
@@ -755,7 +786,13 @@ CREATE TABLE `tool_email_config` (
`port` varchar(255) DEFAULT NULL COMMENT '端口',
`user` varchar(255) DEFAULT NULL COMMENT '发件者用户名',
PRIMARY KEY (`config_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='邮箱配置';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='邮箱配置';
+
+-- ----------------------------
+-- Records of tool_email_config
+-- ----------------------------
+BEGIN;
+COMMIT;
-- ----------------------------
-- Table structure for tool_local_storage
@@ -774,7 +811,7 @@ CREATE TABLE `tool_local_storage` (
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`storage_id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=10 ROW_FORMAT=COMPACT COMMENT='本地存储';
+) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='本地存储';
-- ----------------------------
-- Records of tool_local_storage
@@ -795,7 +832,13 @@ CREATE TABLE `tool_qiniu_config` (
`type` varchar(255) DEFAULT NULL COMMENT '空间类型',
`zone` varchar(255) DEFAULT NULL COMMENT '机房',
PRIMARY KEY (`config_id`) USING BTREE
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='七牛云配置';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='七牛云配置';
+
+-- ----------------------------
+-- Records of tool_qiniu_config
+-- ----------------------------
+BEGIN;
+COMMIT;
-- ----------------------------
-- Table structure for tool_qiniu_content
@@ -812,7 +855,7 @@ CREATE TABLE `tool_qiniu_content` (
`update_time` datetime DEFAULT NULL COMMENT '上传或同步的时间',
PRIMARY KEY (`content_id`) USING BTREE,
UNIQUE KEY `uniq_name` (`name`)
-) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='七牛云文件存储';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='七牛云文件存储';
-- ----------------------------
-- Records of tool_qiniu_content
@@ -820,4 +863,4 @@ CREATE TABLE `tool_qiniu_content` (
BEGIN;
COMMIT;
-SET FOREIGN_KEY_CHECKS = 1;
\ No newline at end of file
+SET FOREIGN_KEY_CHECKS = 1;
diff --git a/sql/tool_picture.sql b/sql/tool_picture.sql
deleted file mode 100644
index 6b36d0db..00000000
--- a/sql/tool_picture.sql
+++ /dev/null
@@ -1,2 +0,0 @@
--- 删除免费图床表
-DROP TABLE tool_picture;
\ No newline at end of file
diff --git a/sql/脚本如何选择.md b/sql/脚本如何选择.md
deleted file mode 100644
index 633c8642..00000000
--- a/sql/脚本如何选择.md
+++ /dev/null
@@ -1,11 +0,0 @@
-## 脚本指南
-项目根目录的 sql 文件夹内提供了本次数据库变更的脚本,脚本如何选择,以及执行的顺序如下
-
-::: tip 注意
-操作数据库属于危险行为,请勿用于生产库,请事先做好备份!!!
-:::
-
-### 初次使用
-eladmin.sql 为 eladmin 项目完整的 sql 脚本,适合于初次使用的用户
-
-### 更新迭代