From f87934f4beab1c23fb9070d28e6dc595cbc1a784 Mon Sep 17 00:00:00 2001 From: leej1012 Date: Mon, 3 Jul 2023 14:48:06 +0800 Subject: [PATCH] Update NodeInspire --- .../com/github/ontio/controller/NodesController.java | 4 ++-- .../java/com/github/ontio/model/dao/NodeInspire.java | 5 +++++ .../resources/db/migration/V1.78__tbl_node_inspire.sql | 2 ++ .../src/main/resources/mapper/NodeInspireMapper.xml | 9 +++++---- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 back-end-projects/Explorer/src/main/resources/db/migration/V1.78__tbl_node_inspire.sql 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 2a4e1f45..a6ad33c2 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 @@ -315,8 +315,8 @@ public ResponseBean getGovernanceInfo( @ApiOperation(value = "Get nodes inspire") @GetMapping(value = "/inspire/all") public ResponseBean getNodesInspire( - @RequestParam(value = "page_number") @Min(value = 1, message = "Invalid page number") Integer pageNum, - @RequestParam(value = "page_size") @Min(value = 1, message = "Invalid page size") @Max(value = 500, message = + @RequestParam(value = "page_number", defaultValue = "1") @Min(value = 1, message = "Invalid page number") Integer pageNum, + @RequestParam(value = "page_size", defaultValue = "20") @Min(value = 1, message = "Invalid page size") @Max(value = 500, message = "Invalid page size") Integer pageSize ) { PageResponseBean response = nodesService.getNodesInspire(pageNum, pageSize); diff --git a/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/NodeInspire.java b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/NodeInspire.java index b584ef6f..0ba30fae 100644 --- a/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/NodeInspire.java +++ b/back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/NodeInspire.java @@ -66,4 +66,9 @@ public class NodeInspire { @Column(name = "user_foundation_bonus_incentive_rate") private String userFoundationBonusIncentiveRate; + @Column(name = "node_apy") + private String nodeApy; + + @Column(name = "user_apy") + private String userApy; } \ No newline at end of file diff --git a/back-end-projects/Explorer/src/main/resources/db/migration/V1.78__tbl_node_inspire.sql b/back-end-projects/Explorer/src/main/resources/db/migration/V1.78__tbl_node_inspire.sql new file mode 100644 index 00000000..827cbd83 --- /dev/null +++ b/back-end-projects/Explorer/src/main/resources/db/migration/V1.78__tbl_node_inspire.sql @@ -0,0 +1,2 @@ +ALTER TABLE tbl_node_inspire ADD COLUMN `node_apy` varchar(100) DEFAULT NULL COMMENT '节点年化收益'; +ALTER TABLE tbl_node_inspire ADD COLUMN `user_apy` varchar(100) DEFAULT NULL COMMENT '用户年化收益'; \ No newline at end of file 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 352e5e43..e5d9bcea 100644 --- a/back-end-projects/Explorer/src/main/resources/mapper/NodeInspireMapper.xml +++ b/back-end-projects/Explorer/src/main/resources/mapper/NodeInspireMapper.xml @@ -2,9 +2,6 @@ - @@ -22,6 +19,8 @@ + +