wangchaoxu 1 year ago
commit 1f38303e06

@ -5,7 +5,7 @@ curl --location --request POST 'localhost:8080/base/cloud/spi' \
--data-raw '{
"appId":"7264840234423027259",
"authId":"4463798",
"method":"getFreightTemplateList",
"method":"searchDSProductCatTree",
"data":"{}"
}'

@ -47,9 +47,9 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
HashMap<String, Object> params = new HashMap<>();
String res = null;
String strList = null;
JSONArray data = null;
JSONObject data = null;
try {
String resourceFileName = "/getProductCatTree.txt"; // 注意路径的开头是一个斜杠
String resourceFileName = "/getSimpleProductCatTree.txt"; // 注意路径的开头是一个斜杠
try (InputStream is = InputStream.class.getResourceAsStream(resourceFileName);
BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
@ -57,7 +57,9 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
while ((line = reader.readLine()) != null) {
strList = strList + line;
}
log.info("str" + strList);
JSONObject str = JSONObject.parseObject(strList);
data = str.getJSONObject("data");
log.info("str" + data);
} catch (IOException e) {
log.error("strerror:" + e.getMessage());
e.printStackTrace();
@ -66,10 +68,10 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
e.printStackTrace();
log.error(e.getMessage());
}
Map<String, Object> result = new HashMap<>();
result.put("data", strList);
// Map<String, Object> result = new HashMap<>();
// result.put("data", data);
// ----结果返回----
return R.ok(Ret.success(result));
return R.ok(Ret.success());
}
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save