From 5cdfbda5d1dd9bc6bec90008e607ba880caf2675 Mon Sep 17 00:00:00 2001 From: zhaoguangwei Date: Mon, 12 Aug 2019 13:43:04 +0800 Subject: [PATCH] add the getAllDataAccounts and getAllLedgers; --- .../ump/controller/RetrievalController.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/manager/ump-web/src/main/java/com/jd/blockchain/ump/controller/RetrievalController.java b/source/manager/ump-web/src/main/java/com/jd/blockchain/ump/controller/RetrievalController.java index b903e5c1..5c94f0a2 100644 --- a/source/manager/ump-web/src/main/java/com/jd/blockchain/ump/controller/RetrievalController.java +++ b/source/manager/ump-web/src/main/java/com/jd/blockchain/ump/controller/RetrievalController.java @@ -267,4 +267,29 @@ public class RetrievalController { return new ApiResult(ErrorCode.SERVER_ERROR,e.getMessage()); } } + + @RequestMapping(method = RequestMethod.GET, value = "/ledgers/ip/{gwIp}/port/{gwPort}") + public String getAllLedgers(@PathVariable(name = "gwIp") String gwIp, + @PathVariable(name = "gwPort") int gwPort) { + //generate the url; + String url = "http://"+gwIp+":"+gwPort+"/ledgers"; + try { + return dataRetrievalService.retrieval(url); + } catch (Exception e) { + return "{'success':false,'data':'" + e.getMessage() + "'}"; + } + } + + @RequestMapping(method = RequestMethod.GET, value = "/ledger/{ledgerHash}/ip/{gwIp}/port/{gwPort}") + public String getAllDataAccounts(@PathVariable(name = "ledgerHash") String ledgerHash, + @PathVariable(name = "gwIp") String gwIp, + @PathVariable(name = "gwPort") int gwPort) { + //generate the url; + String url = "http://"+gwIp+":"+gwPort+"/ledgers/"+ledgerHash+"/accounts"; + try { + return dataRetrievalService.retrieval(url); + } catch (Exception e) { + return "{'success':false,'data':'" + e.getMessage() + "'}"; + } + } } \ No newline at end of file