接口测试

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
parent 8dfb8faebf
commit f8c1e7f2ee

@ -51,12 +51,14 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
JSONObject data = null;
List<Object> arrayData = null;
try {
log.info("/getSimpleProductCatTree.txt");
String resourceFileName = "/getSimpleProductCatTree.txt"; // 注意路径的开头是一个斜杠
try (InputStream is = InputStream.class.getResourceAsStream(resourceFileName);
BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
String line;
while ((line = reader.readLine()) != null) {
strList = strList + line;
log.info(line);
strList = strList + line;
}
str = JSONObject.parseObject(strList);
data = str.getJSONObject("data");
@ -67,7 +69,7 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
log.error("strerror2:" + e.getMessage());
}
Map<String, Object> result = new HashMap<>();
result.put("data", arrayData);

Loading…
Cancel
Save