Add: Add a WebSocket connection to monitor the app's online status.

This commit is contained in:
EUForest
2025-11-06 15:34:51 +08:00
parent 066f5d6538
commit 8cce9b95b4
6 changed files with 109 additions and 1 deletions
+17
View File
@@ -239,6 +239,12 @@ type CommissionLog struct {
Timestamp int64 `json:"timestamp"`
}
type ConnectionRecords struct {
CurrentContinuousDays int64 `json:"current_continuous_days"`
HistoryContinuousDays int64 `json:"history_continuous_days"`
LongestSingleConnection int64 `json:"longest_single_connection"`
}
type Coupon struct {
Id int64 `json:"id"`
Name string `json:"name"`
@@ -822,6 +828,11 @@ type GetDeviceListResponse struct {
Total int64 `json:"total"`
}
type GetDeviceOnlineStatsResponse struct {
WeeklyStats []WeeklyStat `json:"weekly_stats"`
ConnectionRecords ConnectionRecords `json:"connection_records"`
}
type GetDocumentDetailRequest struct {
Id int64 `json:"id" validate:"required"`
}
@@ -2734,3 +2745,9 @@ type VmessProtocol struct {
Network string `json:"network"`
Transport string `json:"transport"`
}
type WeeklyStat struct {
Day int `json:"day"`
DayName string `json:"day_name"`
Hours float64 `json:"hours"`
}