diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/NodesController.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/NodesController.java index 5e421647..001a8e92 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/NodesController.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/controller/NodesController.java @@ -424,5 +424,10 @@ public ResponseBean getBadNode(@RequestParam Integer cycle) { return nodesService.getBadNode(cycle); } - + @RequestLimit(count = 60) + @ApiOperation(value = "get best apr") + @GetMapping(value = "/best-apr") + public ResponseBean getBestApr() { + return nodesService.getBestApr(); + } } diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/NodeInspireMapper.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/NodeInspireMapper.java index 1d4b0c96..a18ab140 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/NodeInspireMapper.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/NodeInspireMapper.java @@ -14,4 +14,5 @@ public interface NodeInspireMapper extends Mapper { int selectNodesInspireCount(); + String selectBestApr(); } \ No newline at end of file diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/NodesServiceImpl.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/NodesServiceImpl.java index 332fb34d..4736e2a4 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/NodesServiceImpl.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/service/impl/NodesServiceImpl.java @@ -1302,4 +1302,9 @@ public ResponseBean getBadNode(Integer cycle) { List nodeList = badNodeMapper.selectBadNodeByCycle(cycle); return new ResponseBean(ErrorInfo.SUCCESS.code(), ErrorInfo.SUCCESS.desc(), nodeList); } + + public ResponseBean getBestApr() { + String apr = nodeInspireMapper.selectBestApr(); + return new ResponseBean(ErrorInfo.SUCCESS.code(), ErrorInfo.SUCCESS.desc(), apr); + } } diff --git a/back-end-projects/Explorer/src/main/resources/mapper/NodeInspireMapper.xml b/back-end-projects/Explorer/src/main/resources/mapper/NodeInspireMapper.xml index b85718c5..6c5aea79 100644 --- a/back-end-projects/Explorer/src/main/resources/mapper/NodeInspireMapper.xml +++ b/back-end-projects/Explorer/src/main/resources/mapper/NodeInspireMapper.xml @@ -59,4 +59,14 @@ COUNT(1) FROM tbl_node_inspire + + \ No newline at end of file