Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023/12/26更新 API版本6.0.2 #41

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Home/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependency>
<groupId>com.ultikits</groupId>
<artifactId>UltiTools-API</artifactId>
<version>6.0.0.202312150106</version>
<version>6.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion UltiTools-API/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>UltiTools-API</artifactId>
<groupId>com.ultikits</groupId>
<version>6.0.1</version>
<version>6.0.2</version>
<modelVersion>4.0.0</modelVersion>
<name>UltiTools-API</name>
<description>This project is the base of the Ultitools plugin development.</description>
Expand Down
18 changes: 0 additions & 18 deletions UltiTools-API/src/main/java/com/ultikits/ultitools/UltiTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,4 @@ public static YamlConfiguration getEnv() {
}
return config;
}

/**
* get UltiTools UUID
*
* @return UUID
* @throws IOException if an I/O error occurs
*/
public static String getUltiToolsUUID() throws IOException {
File dataFile = new File(UltiTools.getInstance().getDataFolder(), "data.json");
JSON json = new cn.hutool.json.JSONObject();
if (dataFile.exists()) {
json = JSONUtil.readJSON(dataFile, StandardCharsets.UTF_8);
} else {
json.putByPath("uuid", IdUtil.simpleUUID());
json.write(new FileWriter(dataFile));
}
return json.getByPath("uuid").toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.ultikits.ultitools.utils;

import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.ultikits.ultitools.UltiTools;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class CommonUtils {

/**
* get UltiTools UUID
*
* @return UUID
* @throws IOException if an I/O error occurs
*/
public static String getUltiToolsUUID() throws IOException {
File dataFile = new File(UltiTools.getInstance().getDataFolder(), "data.json");
JSON json = new cn.hutool.json.JSONObject();
if (dataFile.exists()) {
json = JSONUtil.readJSON(dataFile, StandardCharsets.UTF_8);
} else {
json.putByPath("uuid", IdUtil.simpleUUID());
json.write(new FileWriter(dataFile));
}
return json.getByPath("uuid").toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static void loginAccount() throws IOException {
}

TokenEntity token = HttpRequestUtils.getToken(username, password);
String uuid = UltiTools.getUltiToolsUUID();
String uuid = CommonUtils.getUltiToolsUUID();
HttpResponse uuidResponse = HttpRequestUtils.getServerByUUID(uuid, token);
int port = UltiTools.getInstance().getConfig().getInt("web-editor.port");
String domain = UltiTools.getInstance().getConfig().getString("web-editor.https.domain");
Expand Down