配置文件架构的小完善

This commit is contained in:
userA
2023-04-21 03:36:36 +08:00
parent d342c8167f
commit bb55a471a8
15 changed files with 296 additions and 152 deletions

View File

@@ -22,6 +22,26 @@ import java.util.Map;
public class JsonFileUtilTest {
@Test
public void writeMapObj() throws IOException {
Student student = new Student(
"Genius",
18,
"HUST",
"CS",
List.of("Coding", "Reading", "Playing"),
Map.of("QQ", "123456789", "WeChat", "987654321")
);
JsonFileUtil.writeJsonFile("E:\\Project\\ChopperBot\\FileModule\\src\\main\\resources\\student2.json",
Map.of("Student", student,"hello","11234"));
Map<String, Object> stringObjectMap = JsonFileUtil.readJsonFile("E:\\Project\\ChopperBot\\FileModule\\src\\main\\resources\\student2.json");
stringObjectMap.forEach(
(k,v)->{
System.out.println(k);
System.out.println(v.getClass());
}
);
}
@Test
@@ -64,4 +84,5 @@ public class JsonFileUtilTest {
JsonFileUtil.writeBigJsonFile(dir.toString(),maps);
}
}