diff options
author | Yan Yang <yangyanyj@chinamobile.com> | 2019-07-19 03:28:44 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-07-19 03:28:44 +0000 |
commit | 48f20d4423734d2dd1653d8d6ffaf694cb44ad18 (patch) | |
tree | 47ee9e6d896484be31a9122e4fd011f97cd8c026 /components/datalake-handler/feeder | |
parent | f7fbc2229371a157f08012b8124ab3bd47e7ef01 (diff) | |
parent | 53e0da816a1ab3cc8e9b95e5ba40f91de9e7d942 (diff) |
Merge "db of design"
Diffstat (limited to 'components/datalake-handler/feeder')
-rw-r--r-- | components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java index 322be412..f177a9ac 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java @@ -74,6 +74,20 @@ public class DbController { return retString; } + @GetMapping("/idAndName") + @ResponseBody + @ApiOperation(value="Gat all databases id and name") + public Map<Integer, String> listIdAndName() { + Iterable<Db> ret = dbRepository.findAll(); + Map<Integer, String> map = new HashMap<>(); + for(Db db : ret) + { + log.info(db.getId() + "\t"+ db.getName()); + map.put(db.getId(), db.getName()); + } + return map; + } + //Create a DB @PostMapping("") @ResponseBody |