接口测试

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

Loading…
Cancel
Save