From 7d97026480b244319fa322c854a5e2d2552cc786 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Tue, 29 Apr 2025 22:31:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(license):=20=E4=BC=98=E5=8C=96=20Licen?= =?UTF-8?q?se=20=E6=A8=A1=E5=9D=97=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- continew-starter-bom/pom.xml | 468 +++++++++--------- .../continew-starter-cache-jetcache/pom.xml | 2 +- .../continew-starter-captcha-graphic/pom.xml | 2 +- .../core/constant/PropertiesConstants.java | 92 ++-- continew-starter-dependencies/pom.xml | 45 +- .../pom.xml | 2 +- .../continew-starter-file-excel/pom.xml | 2 +- .../continew-starter-license-core/pom.xml | 14 +- .../license/model/BuildCreatorResp.java | 4 +- .../continew/license/model/ConfigParam.java | 2 +- .../license/model/CustomKeyStoreParam.java | 5 +- .../license/model/LicenseCreatorParam.java | 2 +- .../license/model/LicenseCreatorParamVO.java | 2 +- .../license/model/LicenseExtraModel.java | 2 +- .../continew/license/util/ExecCmdUtil.java | 6 +- .../license/util/ServerInfoUtils.java | 5 +- .../README.md | 82 --- .../pom.xml | 8 +- .../LicenseGenerateAutoConfiguration.java | 4 +- .../LicenseGenerateProperties.java | 3 +- .../license/manager/ServerLicenseManager.java | 0 .../license/service/LicenseCreateService.java | 7 +- ...ot.autoconfigure.AutoConfiguration.imports | 0 .../pom.xml | 7 +- .../LicenseVerifyAutoConfiguration.java | 6 +- .../LicenseVerifyProperties.java | 4 +- .../license/bean/LicenseInstallerBean.java | 0 .../LicenseStarterInitializingBean.java | 2 +- .../license/manager/CustomLicenseManager.java | 0 ...ot.autoconfigure.AutoConfiguration.imports | 0 .../continew-starter-license-verify/README.md | 22 - continew-starter-license/pom.xml | 5 +- .../storage/model/req/StorageProperties.java | 2 +- continew-starter-web/pom.xml | 2 +- pom.xml | 14 +- 35 files changed, 350 insertions(+), 473 deletions(-) delete mode 100644 continew-starter-license/continew-starter-license-generate/README.md rename continew-starter-license/{continew-starter-license-verify => continew-starter-license-generator}/pom.xml (77%) rename continew-starter-license/{continew-starter-license-generate => continew-starter-license-generator}/src/main/java/top/continew/license/autoconfigure/LicenseGenerateAutoConfiguration.java (93%) rename continew-starter-license/{continew-starter-license-generate => continew-starter-license-generator}/src/main/java/top/continew/license/autoconfigure/LicenseGenerateProperties.java (94%) rename continew-starter-license/{continew-starter-license-generate => continew-starter-license-generator}/src/main/java/top/continew/license/manager/ServerLicenseManager.java (100%) rename continew-starter-license/{continew-starter-license-generate => continew-starter-license-generator}/src/main/java/top/continew/license/service/LicenseCreateService.java (99%) rename continew-starter-license/{continew-starter-license-generate => continew-starter-license-generator}/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) rename continew-starter-license/{continew-starter-license-generate => continew-starter-license-verifier}/pom.xml (77%) rename continew-starter-license/{continew-starter-license-verify => continew-starter-license-verifier}/src/main/java/top/continew/license/autoconfigure/LicenseVerifyAutoConfiguration.java (93%) rename continew-starter-license/{continew-starter-license-verify => continew-starter-license-verifier}/src/main/java/top/continew/license/autoconfigure/LicenseVerifyProperties.java (95%) rename continew-starter-license/{continew-starter-license-verify => continew-starter-license-verifier}/src/main/java/top/continew/license/bean/LicenseInstallerBean.java (100%) rename continew-starter-license/{continew-starter-license-verify/src/main/java/top/continew/license/Initializing => continew-starter-license-verifier/src/main/java/top/continew/license/initializing}/LicenseStarterInitializingBean.java (96%) rename continew-starter-license/{continew-starter-license-verify => continew-starter-license-verifier}/src/main/java/top/continew/license/manager/CustomLicenseManager.java (100%) rename continew-starter-license/{continew-starter-license-verify => continew-starter-license-verifier}/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) delete mode 100644 continew-starter-license/continew-starter-license-verify/README.md diff --git a/continew-starter-bom/pom.xml b/continew-starter-bom/pom.xml index 2a1b9cdd..25fca017 100644 --- a/continew-starter-bom/pom.xml +++ b/continew-starter-bom/pom.xml @@ -16,12 +16,229 @@ - + top.continew - continew-starter-extension-crud-core + continew-starter-core ${revision} + + + + top.continew + continew-starter-json-jackson + ${revision} + + + + + top.continew + continew-starter-api-doc + ${revision} + + + + + top.continew + continew-starter-web + ${revision} + + + + + top.continew + continew-starter-auth-satoken + ${revision} + + + + top.continew + continew-starter-auth-justauth + ${revision} + + + + + top.continew + continew-starter-data-mp + ${revision} + + + + top.continew + continew-starter-data-mf + ${revision} + + + + top.continew + continew-starter-data-core + ${revision} + + + + + top.continew + continew-starter-cache-redisson + ${revision} + + + + top.continew + continew-starter-cache-springcache + ${revision} + + + + top.continew + continew-starter-cache-jetcache + ${revision} + + + + + top.continew + continew-starter-security-password + ${revision} + + + + top.continew + continew-starter-security-crypto + ${revision} + + + + top.continew + continew-starter-security-mask + ${revision} + + + + top.continew + continew-starter-security-xss + + + + top.continew + continew-starter-security-sensitivewords + ${revision} + + + + + top.continew + continew-starter-ratelimiter + ${revision} + + + + + top.continew + continew-starter-idempotent + ${revision} + + + + + top.continew + continew-starter-trace + ${revision} + + + + + top.continew + continew-starter-captcha-graphic + ${revision} + + + + + top.continew + continew-starter-captcha-behavior + ${revision} + + + + + top.continew + continew-starter-messaging-mail + ${revision} + + + + + top.continew + continew-starter-messaging-websocket + ${revision} + + + + + top.continew + continew-starter-log-interceptor + ${revision} + + + + top.continew + continew-starter-log-aop + ${revision} + + + + top.continew + continew-starter-log-core + ${revision} + + + + + top.continew + continew-starter-file-excel + ${revision} + + + + + + top.continew + continew-starter-storage-local + ${revision} + + + + top.continew + continew-starter-storage-oss + ${revision} + + + + top.continew + continew-starter-storage-core + ${revision} + + + + + top.continew + continew-starter-license-generator + ${revision} + + + + top.continew + continew-starter-license-verifier + ${revision} + + + + top.continew + continew-starter-license-core + ${revision} + + top.continew @@ -34,267 +251,36 @@ continew-starter-extension-crud-mf ${revision} - - + top.continew - continew-starter-extension-datapermission-core + continew-starter-extension-crud-core ${revision} + top.continew continew-starter-extension-datapermission-mp ${revision} - - + top.continew - continew-starter-extension-tenant-core + continew-starter-extension-datapermission-core ${revision} + top.continew continew-starter-extension-tenant-mp ${revision} - - + top.continew - continew-starter-auth-justauth - ${revision} - - - - - top.continew - continew-starter-auth-satoken - ${revision} - - - - - top.continew - continew-starter-data-mp - ${revision} - - - - - top.continew - continew-starter-data-mf - ${revision} - - - - - top.continew - continew-starter-data-core - ${revision} - - - - - top.continew - continew-starter-cache-jetcache - ${revision} - - - - - top.continew - continew-starter-cache-springcache - ${revision} - - - - - top.continew - continew-starter-cache-redisson - ${revision} - - - - - top.continew - continew-starter-messaging-websocket - ${revision} - - - - - top.continew - continew-starter-messaging-mail - ${revision} - - - - - top.continew - continew-starter-captcha-behavior - ${revision} - - - - - top.continew - continew-starter-captcha-graphic - ${revision} - - - - - top.continew - continew-starter-file-excel - ${revision} - - - - - top.continew - continew-starter-storage-core - ${revision} - - - - - top.continew - continew-starter-storage-local - ${revision} - - - - - top.continew - continew-starter-storage-oss - ${revision} - - - - - top.continew - continew-starter-log-interceptor - ${revision} - - - - - top.continew - continew-starter-log-aop - ${revision} - - - - - top.continew - continew-starter-log-core - ${revision} - - - - - top.continew - continew-starter-trace - ${revision} - - - - - top.continew - continew-starter-idempotent - ${revision} - - - - - top.continew - continew-starter-ratelimiter - ${revision} - - - - - top.continew - continew-starter-security-xss - - - - - top.continew - continew-starter-security-sensitivewords - ${revision} - - - - - top.continew - continew-starter-security-crypto - ${revision} - - - - - top.continew - continew-starter-security-mask - ${revision} - - - - - top.continew - continew-starter-security-password - ${revision} - - - - - top.continew - continew-starter-web - ${revision} - - - - - top.continew - continew-starter-api-doc - ${revision} - - - - - top.continew - continew-starter-json-jackson - ${revision} - - - - - top.continew - continew-starter-core - ${revision} - - - - - top.continew - continew-starter-license-core - ${revision} - - - - - top.continew - continew-starter-license-generate - ${revision} - - - - - top.continew - continew-starter-license-verify + continew-starter-extension-tenant-core ${revision} diff --git a/continew-starter-cache/continew-starter-cache-jetcache/pom.xml b/continew-starter-cache/continew-starter-cache-jetcache/pom.xml index 1cc55abb..3f503238 100644 --- a/continew-starter-cache/continew-starter-cache-jetcache/pom.xml +++ b/continew-starter-cache/continew-starter-cache-jetcache/pom.xml @@ -13,7 +13,7 @@ ContiNew Starter 缓存模块 - JetCache - + com.alicp.jetcache jetcache-autoconfigure diff --git a/continew-starter-captcha/continew-starter-captcha-graphic/pom.xml b/continew-starter-captcha/continew-starter-captcha-graphic/pom.xml index c0534384..ebd88849 100644 --- a/continew-starter-captcha/continew-starter-captcha-graphic/pom.xml +++ b/continew-starter-captcha/continew-starter-captcha-graphic/pom.xml @@ -19,7 +19,7 @@ easy-captcha - + org.openjdk.nashorn nashorn-core diff --git a/continew-starter-core/src/main/java/top/continew/starter/core/constant/PropertiesConstants.java b/continew-starter-core/src/main/java/top/continew/starter/core/constant/PropertiesConstants.java index b787f65f..bba58ac7 100644 --- a/continew-starter-core/src/main/java/top/continew/starter/core/constant/PropertiesConstants.java +++ b/continew-starter-core/src/main/java/top/continew/starter/core/constant/PropertiesConstants.java @@ -34,6 +34,21 @@ public class PropertiesConstants { */ public static final String ENABLED = "enabled"; + /** + * Web 配置 + */ + public static final String WEB = CONTINEW_STARTER + StringConstants.DOT + "web"; + + /** + * Web-跨域配置 + */ + public static final String WEB_CORS = WEB + StringConstants.DOT + "cors"; + + /** + * Web-响应配置 + */ + public static final String WEB_RESPONSE = WEB + StringConstants.DOT + "response"; + /** * 安全配置 */ @@ -60,29 +75,19 @@ public class PropertiesConstants { public static final String SECURITY_XSS = SECURITY + StringConstants.DOT + "xss"; /** - * Web 配置 + * 限流配置 */ - public static final String WEB = CONTINEW_STARTER + StringConstants.DOT + "web"; + public static final String RATE_LIMITER = CONTINEW_STARTER + StringConstants.DOT + "rate-limiter"; /** - * Web-跨域配置 + * 幂等配置 */ - public static final String WEB_CORS = WEB + StringConstants.DOT + "cors"; + public static final String IDEMPOTENT = CONTINEW_STARTER + StringConstants.DOT + "idempotent"; /** - * Web-响应配置 + * 链路追踪配置 */ - public static final String WEB_RESPONSE = WEB + StringConstants.DOT + "response"; - - /** - * 日志配置 - */ - public static final String LOG = CONTINEW_STARTER + StringConstants.DOT + "log"; - - /** - * 存储配置 - */ - public static final String STORAGE = CONTINEW_STARTER + StringConstants.DOT + "storage"; + public static final String TRACE = CONTINEW_STARTER + StringConstants.DOT + "trace"; /** * 验证码配置 @@ -109,6 +114,31 @@ public class PropertiesConstants { */ public static final String MESSAGING_WEBSOCKET = MESSAGING + StringConstants.DOT + "websocket"; + /** + * 日志配置 + */ + public static final String LOG = CONTINEW_STARTER + StringConstants.DOT + "log"; + + /** + * 存储配置 + */ + public static final String STORAGE = CONTINEW_STARTER + StringConstants.DOT + "storage"; + + /** + * License 配置 + */ + public static final String LICENSE = CONTINEW_STARTER + StringConstants.DOT + "license"; + + /** + * License 生成器配置 + */ + public static final String LICENSE_GENERATOR = LICENSE + StringConstants.DOT + "generator"; + + /** + * License 校验器配置 + */ + public static final String LICENSE_VERIFIER = LICENSE + StringConstants.DOT + "verifier"; + /** * CRUD 配置 */ @@ -124,36 +154,6 @@ public class PropertiesConstants { */ public static final String TENANT = CONTINEW_STARTER + StringConstants.DOT + "tenant"; - /** - * 限流配置 - */ - public static final String RATE_LIMITER = CONTINEW_STARTER + StringConstants.DOT + "rate-limiter"; - - /** - * 幂等配置 - */ - public static final String IDEMPOTENT = CONTINEW_STARTER + StringConstants.DOT + "idempotent"; - - /** - * 链路追踪配置 - */ - public static final String TRACE = CONTINEW_STARTER + StringConstants.DOT + "trace"; - - /** - * license配置 - */ - public static final String LICENSE = CONTINEW_STARTER + StringConstants.DOT + "license"; - - /** - * license 生成模块配置 - */ - public static final String LICENSE_GENERATE = LICENSE + StringConstants.DOT + "generate"; - - /** - * license 校验模块配置 - */ - public static final String LICENSE_VERIFY = LICENSE + StringConstants.DOT + "verify"; - private PropertiesConstants() { } } diff --git a/continew-starter-dependencies/pom.xml b/continew-starter-dependencies/pom.xml index 23608a9f..157599ce 100644 --- a/continew-starter-dependencies/pom.xml +++ b/continew-starter-dependencies/pom.xml @@ -44,14 +44,12 @@ 3.3.6 5.8.36 2.4 + 1.33 + 2.11.5 1.9.4 2.17.0 1.26.0 - - 1.33 - 2.11.5 - 1.7.0 2.44.3 @@ -85,7 +83,7 @@ ${redisson.version} - + com.alicp.jetcache jetcache-bom @@ -227,14 +225,14 @@ ${easy-captcha.version} - + org.openjdk.nashorn nashorn-core ${nashorn.version} - + com.alibaba easyexcel @@ -283,14 +281,14 @@ ${thumbnails.version} - + com.feiniaojin graceful-response ${graceful-response.version} - + cn.crane4j crane4j-spring-boot-starter @@ -320,7 +318,7 @@ ${snakeyaml.version} - + com.squareup.okhttp3 okhttp @@ -355,6 +353,19 @@ ${hutool.version} + + + de.schlichtherle.truelicense + truelicense-core + ${truelicense.version} + + + + net.lingala.zip4j + zip4j + ${zip4j.version} + + commons-beanutils @@ -374,20 +385,6 @@ ${commons-compress.version} - - - de.schlichtherle.truelicense - truelicense-core - ${truelicense.version} - - - - - net.lingala.zip4j - zip4j - ${zip4j.version} - - top.continew diff --git a/continew-starter-extension/continew-starter-extension-crud/continew-starter-extension-crud-core/pom.xml b/continew-starter-extension/continew-starter-extension-crud/continew-starter-extension-crud-core/pom.xml index bd4db0e5..1081c735 100644 --- a/continew-starter-extension/continew-starter-extension-crud/continew-starter-extension-crud-core/pom.xml +++ b/continew-starter-extension/continew-starter-extension-crud/continew-starter-extension-crud-core/pom.xml @@ -13,7 +13,7 @@ ContiNew Starter 扩展模块 - CRUD(增删改查) - 核心模块 - + cn.crane4j crane4j-spring-boot-starter diff --git a/continew-starter-file/continew-starter-file-excel/pom.xml b/continew-starter-file/continew-starter-file-excel/pom.xml index a062a7ce..d74296f4 100644 --- a/continew-starter-file/continew-starter-file-excel/pom.xml +++ b/continew-starter-file/continew-starter-file-excel/pom.xml @@ -13,7 +13,7 @@ ContiNew Starter 文件处理模块 - Excel - + com.alibaba easyexcel diff --git a/continew-starter-license/continew-starter-license-core/pom.xml b/continew-starter-license/continew-starter-license-core/pom.xml index 8a7d1922..dd9ec9f9 100644 --- a/continew-starter-license/continew-starter-license-core/pom.xml +++ b/continew-starter-license/continew-starter-license-core/pom.xml @@ -7,27 +7,27 @@ continew-starter-license ${revision} - continew-starter-license-core - ContiNew Starter License核心模块 - - + continew-starter-license-core + ContiNew Starter License 模块 - 核心模块 + + + top.continew continew-starter-core - + de.schlichtherle.truelicense truelicense-core - + net.lingala.zip4j zip4j - diff --git a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/BuildCreatorResp.java b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/BuildCreatorResp.java index 5e11695e..e50103f1 100644 --- a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/BuildCreatorResp.java +++ b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/BuildCreatorResp.java @@ -26,7 +26,7 @@ import java.io.Serializable; * * @author echo * @since 2.11.0 - **/ + */ public class BuildCreatorResp implements Serializable { @Serial @@ -38,7 +38,7 @@ public class BuildCreatorResp implements Serializable { private LicenseCreatorParam param; /** - * 客户端zip文件 + * 客户端 Zip 文件 */ private ZipFile clientZipFile; diff --git a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/ConfigParam.java b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/ConfigParam.java index 2c06d2fd..3c2d27bb 100644 --- a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/ConfigParam.java +++ b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/ConfigParam.java @@ -21,7 +21,7 @@ package top.continew.license.model; * * @author loach * @since 2.11.0 - **/ + */ public class ConfigParam { /** diff --git a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/CustomKeyStoreParam.java b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/CustomKeyStoreParam.java index da3e37a6..12643bcc 100644 --- a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/CustomKeyStoreParam.java +++ b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/CustomKeyStoreParam.java @@ -30,6 +30,7 @@ import java.io.InputStream; * @since 2.11.0 */ public class CustomKeyStoreParam extends AbstractKeyStoreParam { + /** * 密钥路径,可为磁盘路径,也可为项目资源文件里的路径,如果为磁盘路径需重写getStream()方法 */ @@ -50,8 +51,8 @@ public class CustomKeyStoreParam extends AbstractKeyStoreParam { */ private String keyPass; - public CustomKeyStoreParam(Class aClass, String s) { - super(aClass, s); + public CustomKeyStoreParam(Class clazz, String s) { + super(clazz, s); } public CustomKeyStoreParam(Class clazz, String resource, String alias, String storePass, String keyPass) { diff --git a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseCreatorParam.java b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseCreatorParam.java index b5822f62..b48609b2 100644 --- a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseCreatorParam.java +++ b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseCreatorParam.java @@ -25,7 +25,7 @@ import java.util.Date; * * @author loach * @since 2.11.0 - **/ + */ public class LicenseCreatorParam implements Serializable { @Serial diff --git a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseCreatorParamVO.java b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseCreatorParamVO.java index d7cfd2b0..dc46279a 100644 --- a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseCreatorParamVO.java +++ b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseCreatorParamVO.java @@ -23,7 +23,7 @@ import java.util.Date; * * @author loach * @since 2.11.0 - **/ + */ public class LicenseCreatorParamVO { /** diff --git a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseExtraModel.java b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseExtraModel.java index 4d591f56..db87cf0c 100644 --- a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseExtraModel.java +++ b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/model/LicenseExtraModel.java @@ -23,7 +23,7 @@ import java.util.Set; * * @author loach * @since 2.11.0 - **/ + */ public class LicenseExtraModel { /** diff --git a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/util/ExecCmdUtil.java b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/util/ExecCmdUtil.java index b1823f36..0d4bdf5a 100644 --- a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/util/ExecCmdUtil.java +++ b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/util/ExecCmdUtil.java @@ -28,11 +28,14 @@ import java.io.LineNumberReader; * * @author loach * @since 2.11.0 - **/ + */ public class ExecCmdUtil { private static final String CREATE_3RDSESSION_SHELL_SCRIPT = "head -n 80 /dev/urandom | tr -dc A-Za-z0-9 | head -c 168"; + private ExecCmdUtil() { + } + /** * 执行cmd命令(shell脚本) * @@ -82,7 +85,6 @@ public class ExecCmdUtil { * 执行linux命令(shell脚本)生成3rd_session随机数 */ public static String create3rdSessionToken() throws IOException { - return exec(CREATE_3RDSESSION_SHELL_SCRIPT); } } diff --git a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/util/ServerInfoUtils.java b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/util/ServerInfoUtils.java index 7a424698..cb24cee9 100644 --- a/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/util/ServerInfoUtils.java +++ b/continew-starter-license/continew-starter-license-core/src/main/java/top/continew/license/util/ServerInfoUtils.java @@ -52,6 +52,9 @@ public class ServerInfoUtils { private static String mainBoardSerial = null; } + private ServerInfoUtils() { + } + /** * 组装需要额外校验的License参数 * @@ -324,7 +327,6 @@ public class ServerInfoUtils { * @throws Exception 默认异常 */ private static Set getLocalAllInetAddress() throws Exception { - Set result = CollUtil.newHashSet(); // 遍历所有的网络接口 for (Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); @@ -342,5 +344,4 @@ public class ServerInfoUtils { } return result; } - } diff --git a/continew-starter-license/continew-starter-license-generate/README.md b/continew-starter-license/continew-starter-license-generate/README.md deleted file mode 100644 index f2c19670..00000000 --- a/continew-starter-license/continew-starter-license-generate/README.md +++ /dev/null @@ -1,82 +0,0 @@ -## continew-starter-license-generate 使用方法 - -1. 引入依赖 - -```java - - top.continew - continew-starter-license-generate - 2.11.0-SNAPSHOT - -``` - -2. 开发对外接口 - -``` -/* - * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. - * - * 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 top.continew.admin.controller.license; - -import cn.dev33.satoken.annotation.SaIgnore; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import top.continew.license.model.LicenseCreatorParamVO; -import top.continew.license.model.LicenseExtraModel; -import top.continew.license.service.LicenseCreateService; - -import java.util.Calendar; -import java.util.Date; - -/** - * @Desc: - * @Author loach - * @ClassName top.continew.admin.controller.license.LicenseGenerateController - * @Date 2025-04-15 10:52 - */ -@RestController -@RequestMapping("/license") -public class LicenseGenerateController { - - @Autowired - private LicenseCreateService licenseCreateService; - - @GetMapping("/generate") - public void listDict() throws Exception { - //设置证书校验参数 - LicenseCreatorParamVO paramVO = new LicenseCreatorParamVO(); - paramVO.setCustomerName("continew"); - paramVO.setDescription("continew"); - paramVO.setKeyPass("123456a"); - paramVO.setStorePass("123456a"); - //设置过期时间 - Calendar calendar = Calendar.getInstance(); - long expire = Instant.now().toEpochMilli() + (24L * 3600L * 1000L);; - // long expire = new Date().getTime() + (24L * 3600L * 1000L); - calendar.setTimeInMillis(expire); - paramVO.setExpireTime(calendar.getTime()); - //设置额外校验参数(服务器信息) - LicenseExtraModel extraModel = licenseCreateService.getServerInfo(); - paramVO.setLicenseExtraModel(extraModel); - licenseCreateService.generateLicense(paramVO); - } - -} - -``` -注:默认生成 license 为FileUtil.getTmpDirPath()下。将压缩包发送给客户端使用。 \ No newline at end of file diff --git a/continew-starter-license/continew-starter-license-verify/pom.xml b/continew-starter-license/continew-starter-license-generator/pom.xml similarity index 77% rename from continew-starter-license/continew-starter-license-verify/pom.xml rename to continew-starter-license/continew-starter-license-generator/pom.xml index 08a6abde..28b12c67 100644 --- a/continew-starter-license/continew-starter-license-verify/pom.xml +++ b/continew-starter-license/continew-starter-license-generator/pom.xml @@ -9,16 +9,14 @@ ${revision} - continew-starter-license-verify - jar - ContiNew Starter License校验模块 + continew-starter-license-generator + ContiNew Starter License 模块 - 生成器 - + top.continew continew-starter-license-core - \ No newline at end of file diff --git a/continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/autoconfigure/LicenseGenerateAutoConfiguration.java b/continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/autoconfigure/LicenseGenerateAutoConfiguration.java similarity index 93% rename from continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/autoconfigure/LicenseGenerateAutoConfiguration.java rename to continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/autoconfigure/LicenseGenerateAutoConfiguration.java index 526a8187..80859649 100644 --- a/continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/autoconfigure/LicenseGenerateAutoConfiguration.java +++ b/continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/autoconfigure/LicenseGenerateAutoConfiguration.java @@ -36,7 +36,7 @@ import top.continew.starter.core.constant.PropertiesConstants; */ @AutoConfiguration @EnableConfigurationProperties(LicenseGenerateProperties.class) -@ConditionalOnProperty(prefix = PropertiesConstants.LICENSE_GENERATE, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.LICENSE_GENERATOR, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class LicenseGenerateAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(LicenseGenerateAutoConfiguration.class); @@ -52,6 +52,6 @@ public class LicenseGenerateAutoConfiguration { @PostConstruct public void postConstruct() { - log.debug("[ContiNew Starter] - Auto Configuration 'License-Generate' completed initialization."); + log.debug("[ContiNew Starter] - Auto Configuration 'License-Generator' completed initialization."); } } diff --git a/continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/autoconfigure/LicenseGenerateProperties.java b/continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/autoconfigure/LicenseGenerateProperties.java similarity index 94% rename from continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/autoconfigure/LicenseGenerateProperties.java rename to continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/autoconfigure/LicenseGenerateProperties.java index 6a0a4e1f..517e4dcf 100644 --- a/continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/autoconfigure/LicenseGenerateProperties.java +++ b/continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/autoconfigure/LicenseGenerateProperties.java @@ -25,8 +25,9 @@ import top.continew.starter.core.constant.PropertiesConstants; * @author Jasmine * @since 2.11.0 */ -@ConfigurationProperties(PropertiesConstants.LICENSE_GENERATE) +@ConfigurationProperties(PropertiesConstants.LICENSE_GENERATOR) public class LicenseGenerateProperties { + /** * 是否启用 */ diff --git a/continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/manager/ServerLicenseManager.java b/continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/manager/ServerLicenseManager.java similarity index 100% rename from continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/manager/ServerLicenseManager.java rename to continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/manager/ServerLicenseManager.java diff --git a/continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/service/LicenseCreateService.java b/continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/service/LicenseCreateService.java similarity index 99% rename from continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/service/LicenseCreateService.java rename to continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/service/LicenseCreateService.java index ce798129..5fa9fb07 100644 --- a/continew-starter-license/continew-starter-license-generate/src/main/java/top/continew/license/service/LicenseCreateService.java +++ b/continew-starter-license/continew-starter-license-generator/src/main/java/top/continew/license/service/LicenseCreateService.java @@ -43,8 +43,7 @@ import java.util.prefs.Preferences; * * @author loach * @since 2.11.0 - **/ - + */ public class LicenseCreateService { private static final Logger log = LoggerFactory.getLogger(LicenseCreateService.class); @@ -88,7 +87,6 @@ public class LicenseCreateService { * @throws Exception 例外 */ public void generateLicense(LicenseCreatorParamVO paramVO) throws Exception { - BuildCreatorResp buildCreatorResp = buildCreator(paramVO); LicenseCreatorParam param = buildCreatorResp.getParam(); ZipFile clientZipFile = buildCreatorResp.getClientZipFile(); @@ -186,7 +184,6 @@ public class LicenseCreateService { private ZipFile generateClientConfig(LicenseCreatorParam param, String currentCustomerDir, String publicAlias) throws Exception { - ZipFile clientLicense = new ZipFile(currentCustomerDir + "clientLicense.zip"); File config = new File(currentCustomerDir + "clientConfig.json"); ConfigParam configParam = new ConfigParam(); @@ -254,7 +251,6 @@ public class LicenseCreateService { * @return {@link String } */ private String relativePath(LicenseCreatorParamVO paramVO) { - if (paramVO.getLicenseSavePath() != null) { return paramVO.getLicenseSavePath(); } @@ -284,7 +280,6 @@ public class LicenseCreateService { * @return {@link LicenseContent } */ private LicenseContent initLicenseContent(LicenseCreatorParam param) { - LicenseContent licenseContent = new LicenseContent(); licenseContent.setHolder(DEFAULT_HOLDER_ISSUER); licenseContent.setIssuer(DEFAULT_HOLDER_ISSUER); diff --git a/continew-starter-license/continew-starter-license-generate/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/continew-starter-license/continew-starter-license-generator/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from continew-starter-license/continew-starter-license-generate/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to continew-starter-license/continew-starter-license-generator/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/continew-starter-license/continew-starter-license-generate/pom.xml b/continew-starter-license/continew-starter-license-verifier/pom.xml similarity index 77% rename from continew-starter-license/continew-starter-license-generate/pom.xml rename to continew-starter-license/continew-starter-license-verifier/pom.xml index b7b7fa1e..d77c32ae 100644 --- a/continew-starter-license/continew-starter-license-generate/pom.xml +++ b/continew-starter-license/continew-starter-license-verifier/pom.xml @@ -9,12 +9,11 @@ ${revision} - continew-starter-license-generate - jar - ContiNew Starter License生成模块 + continew-starter-license-verifier + ContiNew Starter License 模块 - 校验器 - + top.continew continew-starter-license-core diff --git a/continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/autoconfigure/LicenseVerifyAutoConfiguration.java b/continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/autoconfigure/LicenseVerifyAutoConfiguration.java similarity index 93% rename from continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/autoconfigure/LicenseVerifyAutoConfiguration.java rename to continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/autoconfigure/LicenseVerifyAutoConfiguration.java index b105b268..a5e73bf8 100644 --- a/continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/autoconfigure/LicenseVerifyAutoConfiguration.java +++ b/continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/autoconfigure/LicenseVerifyAutoConfiguration.java @@ -26,7 +26,7 @@ import org.springframework.context.annotation.DependsOn; import de.schlichtherle.license.LicenseManager; import jakarta.annotation.PostConstruct; -import top.continew.license.Initializing.LicenseStarterInitializingBean; +import top.continew.license.initializing.LicenseStarterInitializingBean; import top.continew.license.bean.LicenseInstallerBean; import top.continew.license.manager.CustomLicenseManager; import top.continew.starter.core.constant.PropertiesConstants; @@ -39,7 +39,7 @@ import top.continew.starter.core.constant.PropertiesConstants; */ @AutoConfiguration @EnableConfigurationProperties(LicenseVerifyProperties.class) -@ConditionalOnProperty(prefix = PropertiesConstants.LICENSE_VERIFY, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) +@ConditionalOnProperty(prefix = PropertiesConstants.LICENSE_VERIFIER, name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true) public class LicenseVerifyAutoConfiguration { private static final Logger log = LoggerFactory.getLogger(LicenseVerifyAutoConfiguration.class); @@ -80,7 +80,7 @@ public class LicenseVerifyAutoConfiguration { @PostConstruct public void postConstruct() { - log.debug("[ContiNew Starter] - Auto Configuration 'License-Verify' completed initialization."); + log.debug("[ContiNew Starter] - Auto Configuration 'License-Verifier' completed initialization."); } } diff --git a/continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/autoconfigure/LicenseVerifyProperties.java b/continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/autoconfigure/LicenseVerifyProperties.java similarity index 95% rename from continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/autoconfigure/LicenseVerifyProperties.java rename to continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/autoconfigure/LicenseVerifyProperties.java index daed0294..96e2e2fb 100644 --- a/continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/autoconfigure/LicenseVerifyProperties.java +++ b/continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/autoconfigure/LicenseVerifyProperties.java @@ -26,8 +26,8 @@ import top.continew.starter.core.constant.PropertiesConstants; * * @author loach * @since 2.11.0 - **/ -@ConfigurationProperties(PropertiesConstants.LICENSE_VERIFY) + */ +@ConfigurationProperties(PropertiesConstants.LICENSE_VERIFIER) public class LicenseVerifyProperties { /** diff --git a/continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/bean/LicenseInstallerBean.java b/continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/bean/LicenseInstallerBean.java similarity index 100% rename from continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/bean/LicenseInstallerBean.java rename to continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/bean/LicenseInstallerBean.java diff --git a/continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/Initializing/LicenseStarterInitializingBean.java b/continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/initializing/LicenseStarterInitializingBean.java similarity index 96% rename from continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/Initializing/LicenseStarterInitializingBean.java rename to continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/initializing/LicenseStarterInitializingBean.java index fe808fe2..39f0e964 100644 --- a/continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/Initializing/LicenseStarterInitializingBean.java +++ b/continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/initializing/LicenseStarterInitializingBean.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package top.continew.license.Initializing; +package top.continew.license.initializing; import org.springframework.beans.factory.InitializingBean; import top.continew.license.bean.LicenseInstallerBean; diff --git a/continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/manager/CustomLicenseManager.java b/continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/manager/CustomLicenseManager.java similarity index 100% rename from continew-starter-license/continew-starter-license-verify/src/main/java/top/continew/license/manager/CustomLicenseManager.java rename to continew-starter-license/continew-starter-license-verifier/src/main/java/top/continew/license/manager/CustomLicenseManager.java diff --git a/continew-starter-license/continew-starter-license-verify/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/continew-starter-license/continew-starter-license-verifier/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from continew-starter-license/continew-starter-license-verify/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to continew-starter-license/continew-starter-license-verifier/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/continew-starter-license/continew-starter-license-verify/README.md b/continew-starter-license/continew-starter-license-verify/README.md deleted file mode 100644 index 78674a3f..00000000 --- a/continew-starter-license/continew-starter-license-verify/README.md +++ /dev/null @@ -1,22 +0,0 @@ -## continew-starter-license-verify 食用方法 - -1. 引入依赖 - -```java - - top.continew - continew-starter-license-verify - 2.11.0-SNAPSHOT - -``` - -2. 配置YML(license 压缩包存放位置) - -```yaml -continew-starter: - license: - verify: - storePath: D:/license -``` - -注:默认加载 `FileUtil.getTmpDirPath()` 位置。 \ No newline at end of file diff --git a/continew-starter-license/pom.xml b/continew-starter-license/pom.xml index 78454aa7..26d40e8b 100644 --- a/continew-starter-license/pom.xml +++ b/continew-starter-license/pom.xml @@ -12,9 +12,10 @@ continew-starter-license pom ContiNew Starter License模块 + continew-starter-license-core - continew-starter-license-generate - continew-starter-license-verify + continew-starter-license-generator + continew-starter-license-verifier \ No newline at end of file diff --git a/continew-starter-storage/continew-starter-storage-core/src/main/java/top/continew/starter/storage/model/req/StorageProperties.java b/continew-starter-storage/continew-starter-storage-core/src/main/java/top/continew/starter/storage/model/req/StorageProperties.java index 2583e293..f3342a0b 100644 --- a/continew-starter-storage/continew-starter-storage-core/src/main/java/top/continew/starter/storage/model/req/StorageProperties.java +++ b/continew-starter-storage/continew-starter-storage-core/src/main/java/top/continew/starter/storage/model/req/StorageProperties.java @@ -21,7 +21,7 @@ package top.continew.starter.storage.model.req; * * @author echo * @date 2024/11/04 15:13 - **/ + */ public class StorageProperties { /** diff --git a/continew-starter-web/pom.xml b/continew-starter-web/pom.xml index 66e518be..38076912 100644 --- a/continew-starter-web/pom.xml +++ b/continew-starter-web/pom.xml @@ -32,7 +32,7 @@ spring-boot-starter-undertow - + com.feiniaojin graceful-response diff --git a/pom.xml b/pom.xml index c700db0c..7fe6e727 100644 --- a/pom.xml +++ b/pom.xml @@ -38,20 +38,20 @@ continew-starter-json continew-starter-api-doc continew-starter-web + continew-starter-auth + continew-starter-data + continew-starter-cache continew-starter-security continew-starter-ratelimiter continew-starter-idempotent continew-starter-trace - continew-starter-log - continew-starter-storage - continew-starter-file continew-starter-captcha - continew-starter-cache - continew-starter-data - continew-starter-auth continew-starter-messaging - continew-starter-extension + continew-starter-log + continew-starter-file + continew-starter-storage continew-starter-license + continew-starter-extension