fix(zookeeper-query): 修复 get data 不判断地址是否存在
This commit is contained in:
@@ -37,7 +37,11 @@ public class ZookeeperController {
|
|||||||
|
|
||||||
@GetMapping("get_data")
|
@GetMapping("get_data")
|
||||||
public String getData(@RequestParam("path") String path) throws Exception {
|
public String getData(@RequestParam("path") String path) throws Exception {
|
||||||
return new String(client.getData().forPath(path));
|
if (existsPath(path)) {
|
||||||
|
return new String(client.getData().forPath(path));
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("exists_lock")
|
@GetMapping("exists_lock")
|
||||||
|
|||||||
Reference in New Issue
Block a user