ystx | dfd42b3 | 2025-06-07 13:26:52 +0800 | [diff] [blame^] | 1 | package com.pt.entity; |
| 2 | |
| 3 | import jakarta.persistence.Entity; |
| 4 | import jakarta.persistence.GeneratedValue; |
| 5 | import jakarta.persistence.GenerationType; |
| 6 | import jakarta.persistence.Id; |
| 7 | |
| 8 | import java.time.LocalDateTime; |
| 9 | |
| 10 | @Entity |
| 11 | public class TorrentStats { |
| 12 | @Id |
| 13 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 14 | private Long id; |
| 15 | |
| 16 | private Long torrentId; // 关联的种子ID |
| 17 | private int seederCount; // 当前做种人数 |
| 18 | private int leecherCount; // 当前下载人数 |
| 19 | private int completedCount; // 历史完成下载次数 |
| 20 | private LocalDateTime lastUpdated; |
| 21 | |
| 22 | // Getters and Setters |
| 23 | |
| 24 | public int getSeederCount() { |
| 25 | return seederCount; |
| 26 | } |
| 27 | |
| 28 | public void setSeederCount(int seederCount) { |
| 29 | this.seederCount = seederCount; |
| 30 | } |
| 31 | |
| 32 | public int getLeecherCount() { |
| 33 | return leecherCount; |
| 34 | } |
| 35 | |
| 36 | public void setLeecherCount(int leecherCount) { |
| 37 | this.leecherCount = leecherCount; |
| 38 | } |
| 39 | |
| 40 | public int getCompletedCount() { |
| 41 | return completedCount; |
| 42 | } |
| 43 | |
| 44 | public void setCompletedCount(int completedCount) { |
| 45 | this.completedCount = completedCount; |
| 46 | } |
| 47 | |
| 48 | public LocalDateTime getLastUpdated() { |
| 49 | return lastUpdated; |
| 50 | } |
| 51 | |
| 52 | public void setLastUpdated(LocalDateTime lastUpdated) { |
| 53 | this.lastUpdated = lastUpdated; |
| 54 | } |
| 55 | |
| 56 | public Long getTorrentId() { |
| 57 | return torrentId; |
| 58 | } |
| 59 | |
| 60 | public void setTorrentId(Long torrentId) { |
| 61 | this.torrentId = torrentId; |
| 62 | } |
| 63 | |
| 64 | public Long getId() { |
| 65 | return id; |
| 66 | } |
| 67 | |
| 68 | public void setId(Long id) { |
| 69 | this.id = id; |
| 70 | } |
| 71 | } |