Skip to content

Commit

Permalink
Merge pull request #8 from lijiahangmax/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
lijiahangmax authored Dec 10, 2024
2 parents 4c07200 + 541881d commit bf7cd86
Show file tree
Hide file tree
Showing 19 changed files with 93 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

------------------------------

* [javaDoc](https://apidoc.gitee.com/lijiahangmax/orion-kit)
* [项目文档](https://kit.orionsec.cn)
* [javaDoc](https://kit-docs.orionsec.cn)

### 工程模块

Expand All @@ -65,7 +65,7 @@
<dependency>
<groupId>cn.orionsec.kit</groupId>
<artifactId>模块名称</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</dependency>
```

Expand All @@ -76,7 +76,7 @@
<dependency>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-all</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion orion-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion orion-ext/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion orion-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion orion-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion orion-lang/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface OrionConst {

String ORION_DISPLAY = ".orion";

String ORION_KIT_VERSION = "2.0.0";
String ORION_KIT_VERSION = "2.0.1";

String ORION_AUTHOR = "Jiahang Li";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public class Threads {
*/
public static final ExecutorService GLOBAL_EXECUTOR = ExecutorBuilder.create()
.namedThreadFactory("orion-global-thread-")
.corePoolSize(2)
.maxPoolSize(32)
.corePoolSize(Systems.PROCESS_NUM)
.maxPoolSize(Systems.PROCESS_NUM)
.keepAliveTime(Const.MS_S_60)
.workQueue(new LinkedBlockingQueue<>())
.allowCoreThreadTimeout(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,28 @@ public String format(String template, String json) {
return result;
}

public Pattern getPattern() {
return pattern;
}

public String getPrefix() {
return prefix;
}

public String getSuffix() {
return suffix;
}

public NoMatchStrategy getNoMatchStrategy() {
return noMatchStrategy;
}

public ErrorStrategy getErrorStrategy() {
return errorStrategy;
}

public Map<String, Object> getDefaults() {
return defaults;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,28 @@ public static boolean uncross(double start1, double end1, double start2, double

// -------------------- scale --------------------

/**
* 格式化
*
* @param value value
* @param format format
* @return formatter
*/
public static String format(float value, String format) {
return new DecimalFormat(format).format(value);
}

/**
* 格式化
*
* @param value value
* @param format format
* @return formatter
*/
public static String format(double value, String format) {
return new DecimalFormat(format).format(value);
}

/**
* 清空小数
*
Expand Down Expand Up @@ -1246,7 +1268,7 @@ public static String cleanDoubleDecimal(double d) {
* @return string
*/
public static String setScale(double d, int decimalLen) {
DecimalFormat format = new DecimalFormat("#." + Strings.repeat('#', decimalLen));
DecimalFormat format = new DecimalFormat("0." + Strings.repeat('0', decimalLen));
return format.format(d);
}

Expand All @@ -1258,7 +1280,7 @@ public static String setScale(double d, int decimalLen) {
* @return string
*/
public static String setScale(float f, int decimalLen) {
DecimalFormat format = new DecimalFormat("#." + Strings.repeat('#', decimalLen));
DecimalFormat format = new DecimalFormat("0." + Strings.repeat('0', decimalLen));
return format.format(f);
}

Expand Down
2 changes: 1 addition & 1 deletion orion-log/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion orion-net/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,25 @@ public static byte[] getCommandOutputResult(ICommandExecutor executor) throws IO
* 执行命令
*
* @param executor executor
* @param transfer transfer
* @throws IOException IOException
*/
public static void execCommand(ICommandExecutor executor, OutputStream transfer) throws IOException {
execCommand(executor, transfer, true);
}

/**
* 执行命令
*
* @param executor executor
* @param transfer transfer
* @param merge merge
* @throws IOException IOException
*/
public static void execCommand(ICommandExecutor executor, OutputStream transfer, boolean merge) throws IOException {
if (merge) {
executor.merge();
}
executor.transfer(transfer);
executor.connect();
executor.exec();
Expand Down
2 changes: 1 addition & 1 deletion orion-office/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ public static String getColumnSymbol(int column) {
* @return poi width
*/
public static int getWidth(int width) {
return getWidth((double) width);
}

/**
* 获取 poi 的 width
*
* @param width width
* @return poi width
*/
public static int getWidth(double width) {
return (int) ((width + 0.72) * 256);
}

Expand Down
2 changes: 1 addition & 1 deletion orion-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion orion-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion orion-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>cn.orionsec.kit</groupId>
<artifactId>orion-kit</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -26,7 +26,7 @@
</modules>

<properties>
<orion.kit.version>2.0.0</orion.kit.version>
<orion.kit.version>2.0.1</orion.kit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down

0 comments on commit bf7cd86

Please sign in to comment.