diff --git a/internal/gateway/models.go b/internal/gateway/models.go index 3bd8618..b2541e9 100644 --- a/internal/gateway/models.go +++ b/internal/gateway/models.go @@ -216,8 +216,9 @@ type SyncDeviceInfoResp struct { LANIP string `json:"lan_ip" description:"局域网网关IP地址"` // 连接相关(D-10 补全) - MaxClients FlexInt `json:"max_clients" description:"最大连接客户端数"` - ConnectTime string `json:"connect_time" description:"设备本次联网时间(秒)"` + MaxClients FlexInt `json:"max_clients" description:"最大连接客户端数"` + ClientNumber FlexInt `json:"client_number" description:"当前已连接客户端数"` + ConnectTime string `json:"connect_time" description:"设备本次联网时间(秒)"` // 设备属性(D-10 补全) Status FlexInt `json:"status" description:"设备状态:1=正常,0=禁用"` diff --git a/internal/handler/app/client_asset.go b/internal/handler/app/client_asset.go index 3c8d5a0..f2b3903 100644 --- a/internal/handler/app/client_asset.go +++ b/internal/handler/app/client_asset.go @@ -653,6 +653,10 @@ func mapDeviceGatewayInfoToClientInfo(g *dto.DeviceGatewayInfo) *dto.DeviceRealt v := int64(*g.MaxClients) info.MaxClients = &v } + if g.ClientNumber != nil { + v := int64(*g.ClientNumber) + info.ClientNumber = &v + } info.SoftwareVersion = g.SoftwareVersion if g.SwitchMode != nil { // SwitchMode 在 B 端为字符串("0"/"1"),C 端为整型(0/1),需解析转换 diff --git a/internal/model/dto/asset_dto.go b/internal/model/dto/asset_dto.go index 68d94cc..d82572c 100644 --- a/internal/model/dto/asset_dto.go +++ b/internal/model/dto/asset_dto.go @@ -184,6 +184,7 @@ type DeviceGatewayInfo struct { // 设备属性 CurrentIccid *string `json:"current_iccid,omitempty" description:"当前使用的ICCID"` MaxClients *int `json:"max_clients,omitempty" description:"最大连接客户端数"` + ClientNumber *int `json:"client_number,omitempty" description:"当前已连接客户端数"` SoftwareVersion *string `json:"software_version,omitempty" description:"软件版本号"` SwitchMode *string `json:"switch_mode,omitempty" description:"切卡模式:0=自动,1=手动"` SyncInterval *int `json:"sync_interval,omitempty" description:"信息上报周期(秒)"` diff --git a/internal/model/dto/client_asset_dto.go b/internal/model/dto/client_asset_dto.go index 34cc1ed..88d5d0e 100644 --- a/internal/model/dto/client_asset_dto.go +++ b/internal/model/dto/client_asset_dto.go @@ -103,6 +103,7 @@ type DeviceRealtimeInfo struct { // === 设备属性 === CurrentIccid *string `json:"current_iccid,omitempty" description:"当前使用的ICCID"` MaxClients *int64 `json:"max_clients,omitempty" description:"最大连接客户端数"` + ClientNumber *int64 `json:"client_number,omitempty" description:"当前已连接客户端数"` SoftwareVersion *string `json:"software_version,omitempty" description:"软件版本号"` SwitchMode *int `json:"switch_mode,omitempty" description:"切卡模式(0:自动, 1:手动)"` SyncInterval *int64 `json:"sync_interval,omitempty" description:"信息上报周期(秒)"` diff --git a/internal/service/asset/service.go b/internal/service/asset/service.go index e6f2a2b..d679945 100644 --- a/internal/service/asset/service.go +++ b/internal/service/asset/service.go @@ -385,6 +385,7 @@ func mapSyncRespToDeviceGatewayInfo(r *gateway.SyncDeviceInfoResp) *dto.DeviceGa LimitSpeed: flexIntPtr(r.LimitSpeed), CurrentIccid: strPtr(r.CurrentIccid), MaxClients: flexIntPtr(r.MaxClients), + ClientNumber: flexIntPtr(r.ClientNumber), SoftwareVersion: strPtr(r.SoftwareVersion), SwitchMode: strPtr(r.SwitchMode), SyncInterval: flexIntPtr(r.SyncInterval),