|
|
@ -197,29 +197,49 @@ public interface PadApiService { |
|
|
|
|
|
|
|
/** |
|
|
|
* Pad列表响应模型 |
|
|
|
* 匹配实际API响应格式:{"code":0,"data":{"logo":"...","name":"...","pads":[...]}} |
|
|
|
*/ |
|
|
|
public static class PadListResponse { |
|
|
|
private java.util.List<PadInfo> padList; // Pad设备列表 |
|
|
|
private int totalCount; // 总数量 |
|
|
|
private String lastUpdateTime; // 最后更新时间 |
|
|
|
@SerializedName("logo") |
|
|
|
private String logo; // 店铺Logo |
|
|
|
|
|
|
|
@SerializedName("name") |
|
|
|
private String name; // 店铺名称 |
|
|
|
|
|
|
|
@SerializedName("pads") |
|
|
|
private java.util.List<PadInfo> pads; // Pad设备列表 |
|
|
|
|
|
|
|
// Getters and Setters |
|
|
|
public java.util.List<PadInfo> getPadList() { return padList; } |
|
|
|
public void setPadList(java.util.List<PadInfo> padList) { this.padList = padList; } |
|
|
|
public String getLogo() { return logo; } |
|
|
|
public void setLogo(String logo) { this.logo = logo; } |
|
|
|
|
|
|
|
public int getTotalCount() { return totalCount; } |
|
|
|
public void setTotalCount(int totalCount) { this.totalCount = totalCount; } |
|
|
|
public String getName() { return name; } |
|
|
|
public void setName(String name) { this.name = name; } |
|
|
|
|
|
|
|
public String getLastUpdateTime() { return lastUpdateTime; } |
|
|
|
public void setLastUpdateTime(String lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; } |
|
|
|
public java.util.List<PadInfo> getPads() { return pads; } |
|
|
|
public void setPads(java.util.List<PadInfo> pads) { this.pads = pads; } |
|
|
|
|
|
|
|
// 兼容旧代码的方法 |
|
|
|
public java.util.List<PadInfo> getPadList() { return pads; } |
|
|
|
public void setPadList(java.util.List<PadInfo> padList) { this.pads = padList; } |
|
|
|
|
|
|
|
public int getTotalCount() { return pads != null ? pads.size() : 0; } |
|
|
|
|
|
|
|
public String getLastUpdateTime() { return ""; } // 服务器未返回此字段 |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Pad设备信息模型 |
|
|
|
* 匹配实际API响应格式:{"hardware_id":326,"hardware_name":"OX华为M5"} |
|
|
|
*/ |
|
|
|
public static class PadInfo { |
|
|
|
private String padId; // Pad ID |
|
|
|
private String padName; // Pad名称 |
|
|
|
@SerializedName("hardware_id") |
|
|
|
private int hardwareId; // 硬件ID |
|
|
|
|
|
|
|
@SerializedName("hardware_name") |
|
|
|
private String hardwareName; // 硬件名称 |
|
|
|
|
|
|
|
// 兼容旧代码的字段 |
|
|
|
private String padType; // Pad类型 |
|
|
|
private String status; // 状态(online/offline/busy) |
|
|
|
private String location; // 位置 |
|
|
@ -228,29 +248,51 @@ public interface PadApiService { |
|
|
|
private String lastActiveTime; // 最后活跃时间 |
|
|
|
|
|
|
|
// Getters and Setters |
|
|
|
public String getPadId() { return padId; } |
|
|
|
public void setPadId(String padId) { this.padId = padId; } |
|
|
|
public int getHardwareId() { return hardwareId; } |
|
|
|
public void setHardwareId(int hardwareId) { this.hardwareId = hardwareId; } |
|
|
|
|
|
|
|
public String getHardwareName() { return hardwareName; } |
|
|
|
public void setHardwareName(String hardwareName) { this.hardwareName = hardwareName; } |
|
|
|
|
|
|
|
// 兼容旧代码的方法 |
|
|
|
public String getPadId() { return String.valueOf(hardwareId); } |
|
|
|
public void setPadId(String padId) { |
|
|
|
try { |
|
|
|
this.hardwareId = Integer.parseInt(padId); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
this.hardwareId = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public String getPadName() { return padName; } |
|
|
|
public void setPadName(String padName) { this.padName = padName; } |
|
|
|
public String getPadName() { return hardwareName; } |
|
|
|
public void setPadName(String padName) { this.hardwareName = padName; } |
|
|
|
|
|
|
|
public String getPadType() { return padType; } |
|
|
|
public String getPadType() { return padType != null ? padType : "默认类型"; } |
|
|
|
public void setPadType(String padType) { this.padType = padType; } |
|
|
|
|
|
|
|
public String getStatus() { return status; } |
|
|
|
public String getStatus() { return status != null ? status : "unknown"; } |
|
|
|
public void setStatus(String status) { this.status = status; } |
|
|
|
|
|
|
|
public String getLocation() { return location; } |
|
|
|
public String getLocation() { return location != null ? location : ""; } |
|
|
|
public void setLocation(String location) { this.location = location; } |
|
|
|
|
|
|
|
public String getDescription() { return description; } |
|
|
|
public String getDescription() { return description != null ? description : ""; } |
|
|
|
public void setDescription(String description) { this.description = description; } |
|
|
|
|
|
|
|
public boolean isSelected() { return isSelected; } |
|
|
|
public void setSelected(boolean selected) { isSelected = selected; } |
|
|
|
|
|
|
|
public String getLastActiveTime() { return lastActiveTime; } |
|
|
|
public String getLastActiveTime() { return lastActiveTime != null ? lastActiveTime : ""; } |
|
|
|
public void setLastActiveTime(String lastActiveTime) { this.lastActiveTime = lastActiveTime; } |
|
|
|
|
|
|
|
@Override |
|
|
|
public String toString() { |
|
|
|
return "PadInfo{" + |
|
|
|
"hardwareId=" + hardwareId + |
|
|
|
", hardwareName='" + hardwareName + '\'' + |
|
|
|
", status='" + status + '\'' + |
|
|
|
'}'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -259,13 +301,14 @@ public interface PadApiService { |
|
|
|
public static class PadSelectRequest { |
|
|
|
private String padId; // 选择的Pad ID |
|
|
|
private String userId; // 用户ID |
|
|
|
private String sessionId; // 会话ID |
|
|
|
@SerializedName("token") |
|
|
|
private String token; // 访问令牌(统一认证方式) |
|
|
|
private String selectReason; // 选择原因(可选) |
|
|
|
|
|
|
|
public PadSelectRequest(String padId, String userId, String sessionId) { |
|
|
|
public PadSelectRequest(String padId, String userId, String token) { |
|
|
|
this.padId = padId; |
|
|
|
this.userId = userId; |
|
|
|
this.sessionId = sessionId; |
|
|
|
this.token = token; |
|
|
|
} |
|
|
|
|
|
|
|
// Getters and Setters |
|
|
@ -275,8 +318,21 @@ public interface PadApiService { |
|
|
|
public String getUserId() { return userId; } |
|
|
|
public void setUserId(String userId) { this.userId = userId; } |
|
|
|
|
|
|
|
public String getSessionId() { return sessionId; } |
|
|
|
public void setSessionId(String sessionId) { this.sessionId = sessionId; } |
|
|
|
public String getToken() { return token; } |
|
|
|
public void setToken(String token) { this.token = token; } |
|
|
|
|
|
|
|
// 兼容旧代码的方法 |
|
|
|
@Deprecated |
|
|
|
public String getSessionId() { |
|
|
|
android.util.Log.w("PadSelectRequest", "getSessionId()方法已废弃,请使用getToken()"); |
|
|
|
return token; |
|
|
|
} |
|
|
|
|
|
|
|
@Deprecated |
|
|
|
public void setSessionId(String sessionId) { |
|
|
|
android.util.Log.w("PadSelectRequest", "setSessionId()方法已废弃,请使用setToken()"); |
|
|
|
this.token = sessionId; |
|
|
|
} |
|
|
|
|
|
|
|
public String getSelectReason() { return selectReason; } |
|
|
|
public void setSelectReason(String selectReason) { this.selectReason = selectReason; } |
|
|
|