29 lines
1.3 KiB
Java
29 lines
1.3 KiB
Java
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;
|
||
}
|
||
}
|