添加bt与tracker交互
Change-Id: I1327c2ed89a76bee8e2abeb8cb3014b56357689a
diff --git a/src/main/java/com/pt/entity/PeerInfoEntity.java b/src/main/java/com/pt/entity/PeerInfoEntity.java
new file mode 100644
index 0000000..081df7f
--- /dev/null
+++ b/src/main/java/com/pt/entity/PeerInfoEntity.java
@@ -0,0 +1,66 @@
+package com.pt.entity;
+
+import jakarta.persistence.*;
+import java.time.LocalDateTime;
+
+@Entity
+public class PeerInfoEntity {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ private String infoHash;
+ private String ip;
+ private int port;
+ private String peerId;
+ private LocalDateTime lastSeen;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getInfoHash() {
+ return infoHash;
+ }
+
+ public void setInfoHash(String infoHash) {
+ this.infoHash = infoHash;
+ }
+
+ public String getIp() {
+ return ip;
+ }
+
+ public void setIp(String ip) {
+ this.ip = ip;
+ }
+
+ public int getPort() {
+ return port;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public LocalDateTime getLastSeen() {
+ return lastSeen;
+ }
+
+ public void setLastSeen(LocalDateTime lastSeen) {
+ this.lastSeen = lastSeen;
+ }
+
+ public String getPeerId() {
+ return peerId;
+ }
+
+ public void setPeerId(String peerId) {
+ this.peerId = peerId;
+ }
+}
diff --git a/src/main/java/com/pt/entity/TorrentMeta.java b/src/main/java/com/pt/entity/TorrentMeta.java
index 3823181..2c690f7 100644
--- a/src/main/java/com/pt/entity/TorrentMeta.java
+++ b/src/main/java/com/pt/entity/TorrentMeta.java
@@ -17,6 +17,7 @@
private String infoHash;
private Long size;
private LocalDateTime uploadTime;
+ private byte[] torrentData;
public Long getId() {
return id;
@@ -57,4 +58,12 @@
public void setUploadTime(LocalDateTime uploadTime) {
this.uploadTime = uploadTime;
}
+
+ public byte[] getTorrentData() {
+ return torrentData;
+ }
+
+ public void setTorrentData(byte[] torrentData) {
+ this.torrentData = torrentData;
+ }
}
\ No newline at end of file