mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-10-25 08:57:12 +08:00
refactor(license): 优化 License 模块部分代码
This commit is contained in:
@@ -7,27 +7,27 @@
|
||||
<artifactId>continew-starter-license</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>continew-starter-license-core</artifactId>
|
||||
<description>ContiNew Starter License核心模块</description>
|
||||
<dependencies>
|
||||
|
||||
<!-- continew starter 核心模块 -->
|
||||
<artifactId>continew-starter-license-core</artifactId>
|
||||
<description>ContiNew Starter License 模块 - 核心模块</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 核心模块 -->
|
||||
<dependency>
|
||||
<groupId>top.continew</groupId>
|
||||
<artifactId>continew-starter-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- license 依赖-->
|
||||
<!-- TrueLicense (一个开源的证书管理引擎)-->
|
||||
<dependency>
|
||||
<groupId>de.schlichtherle.truelicense</groupId>
|
||||
<artifactId>truelicense-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--zip4j压缩文件-->
|
||||
<!-- Zip4j (开源的 Java 处理 zip 压缩文件的开发包) -->
|
||||
<dependency>
|
||||
<groupId>net.lingala.zip4j</groupId>
|
||||
<artifactId>zip4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ package top.continew.license.model;
|
||||
*
|
||||
* @author loach
|
||||
* @since 2.11.0
|
||||
**/
|
||||
*/
|
||||
public class ConfigParam {
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Date;
|
||||
*
|
||||
* @author loach
|
||||
* @since 2.11.0
|
||||
**/
|
||||
*/
|
||||
public class LicenseCreatorParam implements Serializable {
|
||||
|
||||
@Serial
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Date;
|
||||
*
|
||||
* @author loach
|
||||
* @since 2.11.0
|
||||
**/
|
||||
*/
|
||||
public class LicenseCreatorParamVO {
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Set;
|
||||
*
|
||||
* @author loach
|
||||
* @since 2.11.0
|
||||
**/
|
||||
*/
|
||||
public class LicenseExtraModel {
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<InetAddress> getLocalAllInetAddress() throws Exception {
|
||||
|
||||
Set<InetAddress> result = CollUtil.newHashSet();
|
||||
// 遍历所有的网络接口
|
||||
for (Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
|
||||
@@ -342,5 +344,4 @@ public class ServerInfoUtils {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user