Skip to content

Commit

Permalink
Update bad node
Browse files Browse the repository at this point in the history
  • Loading branch information
leej1012 committed Sep 12, 2024
1 parent 6c8523a commit 12a7366
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
@Repository
public interface BadNodeMapper extends Mapper<BadNode> {

List<String> selectBadNodeByCycle(int cycle);
List<BadNode> selectBadNodeByCycle(int cycle);

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ public class BadNode {
@Column(name = "public_key")
private String publicKey;

private String name;

private Integer cycle;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ public ResponseBean getMaxNodeDataCycle() {
}

public ResponseBean getBadNode(Integer cycle) {
List<String> nodeList = badNodeMapper.selectBadNodeByCycle(cycle);
List<BadNode> nodeList = badNodeMapper.selectBadNodeByCycle(cycle);
return new ResponseBean(ErrorInfo.SUCCESS.code(), ErrorInfo.SUCCESS.desc(), nodeList);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `tbl_bad_node` ADD COLUMN `name` varchar(70) NOT NULL DEFAULT '' COMMENT '节点名称' AFTER `public_key`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.github.ontio.mapper.BadNodeMapper">

<select id="selectBadNodeByCycle" resultType="String">
SELECT public_key
<select id="selectBadNodeByCycle" resultType="com.github.ontio.model.dao.BadNode">
SELECT public_key,name
FROM tbl_bad_node
WHERE cycle = #{cycle}
</select>
Expand Down

0 comments on commit 12a7366

Please sign in to comment.