feat:修复已知问题,提升系统稳定性
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
<description>remi-comm-util</description>
|
||||
|
||||
<parent>
|
||||
<groupId>ai.remi.top.cloud</groupId>
|
||||
<groupId>ai.remi.top.comm</groupId>
|
||||
<artifactId>remi-comm</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>3.1.0</version>
|
||||
</parent>
|
||||
|
||||
<!-- 打包上传到私服, 需要和配置文件中的server节点配合使用 -->
|
||||
@@ -17,19 +17,19 @@
|
||||
<repository>
|
||||
<id>maven-releases</id>
|
||||
<name>release</name>
|
||||
<url>https://repository.njydsz.com/repository/maven-releases/</url>
|
||||
<url>https://remi.njydsz.com/repository/remi-top-releases/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>maven-snapshots</id>
|
||||
<name>snapshot</name>
|
||||
<url>https://repository.njydsz.com/repository/maven-snapshots/</url>
|
||||
<url>https://remi.njydsz.com/repository/remi-top-snapshots/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<dependencies>
|
||||
<!--common-core-->
|
||||
<dependency>
|
||||
<groupId>ai.remi.top.cloud</groupId>
|
||||
<groupId>ai.remi.top.comm</groupId>
|
||||
<artifactId>remi-comm-core</artifactId>
|
||||
</dependency>
|
||||
<!-- Jaxb -->
|
||||
@@ -110,8 +110,8 @@
|
||||
</dependency>
|
||||
<!-- commons -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>commons-io</artifactId>
|
||||
@@ -133,10 +133,6 @@
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<groupId>commons-collections</groupId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
</dependency>
|
||||
<!--slf4j-->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ai.remi.comm.util.array;
|
||||
|
||||
import com.google.common.primitives.Ints;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class SortUtils {
|
||||
@@ -109,7 +111,7 @@ public class SortUtils {
|
||||
int[] left = Arrays.stream(arr).boxed().filter(e -> e < pivot).mapToInt(e -> e).toArray();
|
||||
int[] middle = Arrays.stream(arr).boxed().filter(e -> e == pivot).mapToInt(e -> e).toArray();
|
||||
int[] right = Arrays.stream(arr).boxed().filter(e -> e > pivot).mapToInt(e -> e).toArray();
|
||||
return concat(quickSort2(left), middle, quickSort2(right));
|
||||
return Ints.concat(quickSort2(left), middle, quickSort2(right));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -143,15 +145,4 @@ public class SortUtils {
|
||||
arr[i] = arr[j];
|
||||
arr[j] = temp;
|
||||
}
|
||||
|
||||
public static int[] concat(int[] left, int[] middle, int[] right) {
|
||||
int totalLength = left.length + middle.length + right.length;
|
||||
int[] result = new int[totalLength];
|
||||
|
||||
System.arraycopy(left, 0, result, 0, left.length);
|
||||
System.arraycopy(middle, 0, result, left.length, middle.length);
|
||||
System.arraycopy(right, 0, result, left.length + middle.length, right.length);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package ai.remi.comm.util.bytes;
|
||||
|
||||
/**
|
||||
* 字节转换
|
||||
*
|
||||
* @author dianjiu
|
||||
* @date 2020-09-19 23:21
|
||||
*/
|
||||
public class ConvertBytesUtils {
|
||||
private static final long KB = 1024;
|
||||
private static final long MB = KB * 1024;
|
||||
private static final long GB = MB * 1024;
|
||||
|
||||
/**
|
||||
* 字节转换
|
||||
*
|
||||
* @param size 字节大小
|
||||
* @return 转换后值
|
||||
*/
|
||||
public static String convertFileSizeToString(long size) {
|
||||
float fileSize = convertFileSize(size);
|
||||
if (size >= GB) {
|
||||
return String.format("%.1f GB" , fileSize);
|
||||
} else if (size >= MB) {
|
||||
return String.format(fileSize > 100 ? "%.0f MB" : "%.1f MB" , fileSize);
|
||||
} else if (size >= KB) {
|
||||
float f = (float) size / KB;
|
||||
return String.format(fileSize > 100 ? "%.0f KB" : "%.1f KB" , fileSize);
|
||||
} else {
|
||||
return String.format("%d B" , size);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 字节转换
|
||||
*
|
||||
* @param size 字节大小
|
||||
* @return 转换后值
|
||||
*/
|
||||
public static float convertFileSize(long size) {
|
||||
if (size >= GB) {
|
||||
return (float) size / GB;
|
||||
} else if (size >= MB) {
|
||||
return (float) size / MB;
|
||||
} else if (size >= KB) {
|
||||
return (float) size / KB;
|
||||
} else {
|
||||
return size;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,12 +15,4 @@ public class CronUtils {
|
||||
public static boolean isValid(String cronExpression) {
|
||||
return CronExpression.isValidExpression(cronExpression);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String validCron = "0 0 12 * * ?";
|
||||
String invalidCron = "invalid";
|
||||
|
||||
System.out.println("Valid Cron: " + isValid(validCron)); // 输出 true
|
||||
System.out.println("Invalid Cron: " + isValid(invalidCron)); // 输出 false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package ai.remi.comm.util.security;
|
||||
|
||||
/**
|
||||
* @author DianJiu 【公众号 点九开源】
|
||||
* @email lidianjiu@njydsz.com
|
||||
* @email dianjiuxyz@gmail.com
|
||||
* @date 2022-07-26
|
||||
* @desc 公钥加密,私钥解密;私钥加签,公钥验签。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user