最终修改
Change-Id: If5f00df9d18bd7d61c8fb08fb25a89043a43139f
diff --git a/src/main/java/com/pt/entity/Resource.java b/src/main/java/com/pt/entity/Resource.java
index 073dbbb..175d96f 100644
--- a/src/main/java/com/pt/entity/Resource.java
+++ b/src/main/java/com/pt/entity/Resource.java
@@ -22,6 +22,8 @@
private String description;
private byte[] torrentData;
+ private String title;
+
public Resource() {
}
@@ -69,6 +71,12 @@
public void setTorrentData(byte[] torrentData) {
this.torrentData = torrentData;
}
+ public String getTitle() {
+ return title;
+ }
+ public void setTitle(String title) {
+ this.title = title;
+ }
/*
* 重写toString方法,将资源信息以JSON字符串形式返回
@@ -81,6 +89,7 @@
", \"publishTime\":\"" + publishTime + "\"" +
", \"author\":\"" + author + "\"" +
", \"description\":\"" + description + "\"" +
+ ", \"title\":\"" + title + "\"" +
'}';
}
}
diff --git a/src/main/java/com/pt/entity/User.java b/src/main/java/com/pt/entity/User.java
index bc3a488..029595d 100644
--- a/src/main/java/com/pt/entity/User.java
+++ b/src/main/java/com/pt/entity/User.java
@@ -81,10 +81,7 @@
}
public double getShareRatio() {
- if (downloaded == 0) {
- return 0;
- }
- return (double) uploaded / downloaded;
+ return shareRatio;
}
public void setShareRatio(double shareRatio) {
@@ -102,6 +99,7 @@
",\npoints:" + points +
",\nuploaded:" + uploaded +
",\ndownloaded:" + downloaded +
+ ",\nshareRatio:" + shareRatio +
'}';
}
}