2025-06-23 14:01:09 +08:00

29 lines
1.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.example.playertime.api;
// 用于 /api/stats 接口返回的玩家统计数据结构
public class PlayerStatsResponse {
public String playerName;
public String uuid;
public long totalTimeSeconds; // 总时长(秒)
public String totalTimeFormatted; // 总时长(格式化字符串)
public long last30DaysSeconds; // 30天时长
public String last30DaysFormatted; // 30天时长格式化字符串
public long last7DaysSeconds; // 7天时长
public String last7DaysFormatted; // 7天时长格式化字符串
// Gson 需要一个无参构造函数
@SuppressWarnings("unused")
private PlayerStatsResponse() {}
public PlayerStatsResponse(String playerName, String uuid, long totalTimeSeconds, String totalTimeFormatted, long last30DaysSeconds, String last30DaysFormatted, long last7DaysSeconds, String last7DaysFormatted) {
this.playerName = playerName;
this.uuid = uuid;
this.totalTimeSeconds = totalTimeSeconds;
this.totalTimeFormatted = totalTimeFormatted;
this.last30DaysSeconds = last30DaysSeconds;
this.last30DaysFormatted = last30DaysFormatted;
this.last7DaysSeconds = last7DaysSeconds;
this.last7DaysFormatted = last7DaysFormatted;
}
}