wangchaoxu 1 year ago
commit 1f38303e06

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

@ -47,9 +47,9 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
HashMap<String, Object> params = new HashMap<>(); HashMap<String, Object> params = new HashMap<>();
String res = null; String res = null;
String strList = null; String strList = null;
JSONArray data = null; JSONObject data = null;
try { try {
String resourceFileName = "/getProductCatTree.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))) {
@ -57,7 +57,9 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
strList = strList + line; strList = strList + line;
} }
log.info("str" + strList); JSONObject str = JSONObject.parseObject(strList);
data = str.getJSONObject("data");
log.info("str" + data);
} catch (IOException e) { } catch (IOException e) {
log.error("strerror:" + e.getMessage()); log.error("strerror:" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
@ -66,10 +68,10 @@ public class SearchDSProductCatTreeService extends SPIBaseService implements Ext
e.printStackTrace(); e.printStackTrace();
log.error(e.getMessage()); log.error(e.getMessage());
} }
Map<String, Object> result = new HashMap<>(); // Map<String, Object> result = new HashMap<>();
result.put("data", strList); // 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