最终修改
Change-Id: If5f00df9d18bd7d61c8fb08fb25a89043a43139f
diff --git a/src/main/java/com/pt/service/ResourceService.java b/src/main/java/com/pt/service/ResourceService.java
index 4eb7823..3d06d85 100644
--- a/src/main/java/com/pt/service/ResourceService.java
+++ b/src/main/java/com/pt/service/ResourceService.java
@@ -41,7 +41,7 @@
return resourceRepository.findByAuthor(username);
}
- public void publishResource(String name, String description, String author, byte[] torrentBytes, String username) throws Exception {
+ public void publishResource(String name, String title, String description, String author, byte[] torrentBytes, String username) throws Exception {
// 解析并保存torrent元信息
TorrentMeta meta = torrentService.parseAndSaveTorrent(torrentBytes);
@@ -51,6 +51,7 @@
resource.setDescription(description);
resource.setAuthor(author);
resource.setPublishTime(LocalDateTime.now());
+ resource.setTitle(title);
resource.setTorrentData(torrentBytes);
// 这里可以保存torrent文件路径,或直接存数据库,依据你的设计