package com.example.g8backend.dto; | |
import lombok.Data; | |
@Data | |
public class AnnounceRequestDTO { | |
private String passkey; | |
private String infoHash; | |
private String peerId; | |
private int port; | |
private double uploaded; | |
private double downloaded; | |
private Double left; // 改成 Double,允许为 null | |
private Integer compact; // 可选 | |
private String event; // 可选 | |
private String ip; | |
public double safeLeft() { | |
return this.left != null ? this.left : 0.0; | |
} | |
} |