Skip to content

Commit

Permalink
v3.4 修复部分问题; 前端页面更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Kloping committed Jul 12, 2024
1 parent dc5660f commit 00a6a9a
Show file tree
Hide file tree
Showing 11 changed files with 17,526 additions and 131 deletions.
28 changes: 18 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,37 @@ plugins {
val kotlinVersion = "1.7.22"
kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion
id("net.mamoe.mirai-console") version "2.15.0"
id("net.mamoe.mirai-console") version "2.16.0"
}

group = "io.github.gdpl2112"
version = "3.3"
version = "3.4"

repositories {
maven("https://repo1.maven.org/maven2/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
mavenLocal()
mavenCentral()
}

mirai {
noTestCore = true
setupConsoleTestRuntime {
// 移除 mirai-core 依赖
classpath = classpath.filter {
!it.nameWithoutExtension.startsWith("mirai-core-jvm")
}
}
}

dependencies {
testImplementation(kotlin("test"))

compileOnly("net.mamoe:mirai-core:2.15.0")
compileOnly("net.mamoe:mirai-console-compiler-common:2.15.0")
implementation(platform("net.mamoe:mirai-bom:2.15.0"))
testImplementation("net.mamoe:mirai-core-mock:2.15.0")
// compileOnly("net.mamoe:mirai-core:2.15.0")
testConsoleRuntime("top.mrxiaom:overflow-core:2.16.0-db61867-SNAPSHOT")
// compileOnly("net.mamoe:mirai-console-compiler-common:2.15.0")
// implementation(platform("net.mamoe:mirai-bom:2.15.0"))
// testImplementation("net.mamoe:mirai-core-mock:2.15.0")
testImplementation("net.mamoe:mirai-logging-slf4j:2.15.0")

implementation(platform("org.slf4j:slf4j-parent:2.0.6"))
Expand All @@ -37,7 +49,3 @@ dependencies {
implementation("io.github.Kloping:spt-web:0.2.0")
}

mirai {
jvmTarget = JavaVersion.VERSION_11
}

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class CallApiPlugin extends JavaPlugin {
public static Conf conf = null;

public CallApiPlugin() {
super(new JvmPluginDescriptionBuilder("io.github.Kloping.mirai.p1.CallApiPlugin", "3.3")
super(new JvmPluginDescriptionBuilder("io.github.Kloping.mirai.p1.CallApiPlugin", "3.4")
.info("调用自定义API插件").build());
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/github/gdpl2112/mirai/p1/Converter.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public static Object get(Connection t1, String t0, AtomicReference<Document> doc
if (t0.equals(ALL)) {
return ReadUtils.readAll(t1.execute().bodyStream(), "utf-8");
}
if (t0.equals(PAR_URL)) {
return t1.get().location();
}
if (doc0.get() == null) {
doc0.set(t1.get());
}
if (t0.equals(PAR_URL)) {
return doc0.get().location();
}
return get0(doc0.get().body().text(), t0);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/github/gdpl2112/mirai/p1/Worker.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private static Message parse(Connection connection, CallTemplate template, Bot b
try {
JSON json = (JSON) JSON.parse(o1);
} catch (Exception e) {
o1 = o1.replaceAll(",", ";");
System.err.println("json parse error.");
}
end = end.replaceFirst(String.format(CHAR0, i++), o1);
}
Expand All @@ -143,7 +143,7 @@ private static Message parse(Connection connection, CallTemplate template, Bot b
} catch (Exception e) {
if (e instanceof NullPointerException) {
e.printStackTrace();
}
}else e.printStackTrace();
if (template.err != null && !template.err.isEmpty()) {
end = template.err;
} else {
Expand Down
Loading

0 comments on commit 00a6a9a

Please sign in to comment.