-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
226 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
back-end-projects/Explorer/src/main/java/com/github/ontio/mapper/BadNodeMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.github.ontio.mapper; | ||
|
||
import com.github.ontio.model.dao.BadNode; | ||
import org.springframework.stereotype.Repository; | ||
import tk.mybatis.mapper.common.Mapper; | ||
|
||
import java.util.List; | ||
|
||
|
||
@Repository | ||
public interface BadNodeMapper extends Mapper<BadNode> { | ||
|
||
List<String> selectBadNodeByCycle(int cycle); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
back-end-projects/Explorer/src/main/java/com/github/ontio/model/dao/BadNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.github.ontio.model.dao; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Table(name = "tbl_bad_node") | ||
public class BadNode { | ||
@Id | ||
@GeneratedValue(generator = "JDBC") | ||
private Integer id; | ||
|
||
@Column(name = "public_key") | ||
private String publicKey; | ||
|
||
private Integer cycle; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
back-end-projects/Explorer/src/main/resources/db/migration/V1.84__tbl_bad_node.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE `tbl_bad_node` | ||
( | ||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', | ||
`public_key` varchar(70) NOT NULL COMMENT '节点公钥', | ||
`cycle` int(11) NOT NULL COMMENT '周期数', | ||
PRIMARY KEY (`id`), | ||
KEY `idx_public_key` (`public_key`), | ||
KEY `idx_cycle` (`cycle`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |
10 changes: 10 additions & 0 deletions
10
back-end-projects/Explorer/src/main/resources/mapper/BadNodeMapper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-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 | ||
FROM tbl_bad_node | ||
WHERE cycle = #{cycle} | ||
</select> | ||
</mapper> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters