增加了种子状态的统计
Change-Id: Id24bcad18a5ba317fb05b90a64bfdc79f75d49a2
diff --git a/src/main/java/com/pt/service/TorrentStatsService.java b/src/main/java/com/pt/service/TorrentStatsService.java
index ee11689..9596784 100644
--- a/src/main/java/com/pt/service/TorrentStatsService.java
+++ b/src/main/java/com/pt/service/TorrentStatsService.java
@@ -109,4 +109,17 @@
return statsRepository.findByTorrentId(torrentId)
.orElseThrow(() -> new ResourceNotFoundException("Stats not found"));
}
+
+ // 新增方法
+ public List<TorrentStats> getTopSeededTorrents(int limit) {
+ return statsRepository.findTopBySeederCount(limit);
+ }
+
+ public List<TorrentStats> getRecentActiveTorrents(int limit) {
+ return statsRepository.findRecentActiveTorrents(limit);
+ }
+
+ public List<TorrentStats> getBatchStats(List<Long> torrentIds) {
+ return statsRepository.findByTorrentIds(torrentIds);
+ }
}
\ No newline at end of file