diff options
author | ZhangZihao <zhangzihao@chinamobile.com> | 2019-07-18 14:26:31 +0800 |
---|---|---|
committer | ZhangZihao <zhangzihao@chinamobile.com> | 2019-07-18 14:27:10 +0800 |
commit | 53e0da816a1ab3cc8e9b95e5ba40f91de9e7d942 (patch) | |
tree | 834784f08dbea9d641e5031b74d79f2c5f424276 | |
parent | f328f99a9618a9b89462601ac506726c1f8e2c18 (diff) |
db of design
Change-Id: I0119780b7903bd84874c5ff9eca1aadb981e01b3
Issue-ID: DCAEGEN2-1658
Signed-off-by: ZhangZihao <zhangzihao@chinamobile.com>
-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 |