refactor: nladmin-acs init

This commit is contained in:
2024-05-28 09:58:57 +08:00
parent 1179a5f154
commit 024c41fe03
968 changed files with 126008 additions and 3977 deletions

View File

@@ -1,13 +1,7 @@
package org.nl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.TypeReference;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.Map;
/**
* @Author: lyd
* @Description: 单元测试
@@ -16,26 +10,4 @@ import java.util.Map;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class ApplicationTest {
@Test
void contextLoads() {
}
@Test
void testJSONToMap() {
JSONObject pa = new JSONObject();
JSONObject pa2 = new JSONObject();
pa2.put("a", 2);
pa.put("name", "lyd");
pa.put("age", pa2);
String jsonString = pa.toJSONString();
// 使用Fastjson解析JSON字符串
Map<String, String> map = JSON.parseObject(jsonString, new TypeReference<Map<String, String>>() {});
// 输出Map
for (Map.Entry<String, String> entry : map.entrySet()) {
System.out.println(entry.getKey() + " : " + entry.getValue());
}
}
}