Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Oct 14, 2023
2 parents 03f3b6b + 850e8bc commit 62eaaf7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import org.json.JSONObject;

import java.io.Serializable;

/**
* 组件
*/
public class Component {
public abstract class Component implements Serializable {
protected JSONObject jsonCard = new JSONObject();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 权限系统核心
*/
public class Permissions {
public static PermData permData = new PermData();
public static PermData permData = null;
public static DataType type;

public static boolean initialized;
Expand Down Expand Up @@ -89,16 +89,8 @@ public void run() {
while (true) {
try {
Thread.sleep(10 * 60 * 60);
switch (Permissions.type.getType()) {
case "YAML" -> permData.saveToFile();
case "JSON" -> permData.saveToFile();
case "Xml" -> permData.saveToFile();
case "Toml" -> permData.saveToFile();
default -> System.err.println("错误的存储种类");
}
} catch (InterruptedException e) {
e.printStackTrace();
} catch (IOException e) {
permData.saveToFile();
} catch (IOException | InterruptedException e) {
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
/**
* 存储实例
*/
public class PermData {
public abstract class PermData {
public File User;
public File Group;

public void saveToFile() throws IOException {
}
public abstract void saveToFile() throws IOException;
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<revision>2.5.11</revision>
<revision>2.5.12</revision>
</properties>

<groupId>io.github.minecraftchampions.dodoopenjava</groupId>
Expand Down

0 comments on commit 62eaaf7

Please sign in to comment.