feat(03-01): Gateway SyncDeviceInfo 方法 + DTO 字段扩展

- gateway/models.go:新增 SyncDeviceInfoReq / SyncDeviceInfoResp 结构定义
- gateway/device.go:新增 SyncDeviceInfo() 方法,POST /device/sync-info
- device_dto.go:DeviceResponse 新增 5 个 sync-info 同步字段;DeviceCardBindingResponse 新增 is_current
- asset_dto.go:BoundCardInfo 新增 is_current 字段
This commit is contained in:
2026-03-28 11:33:01 +08:00
parent 42b884aaf8
commit 825def88a4
4 changed files with 57 additions and 3 deletions

View File

@@ -40,6 +40,12 @@ type DeviceResponse struct {
ActivatedAt *time.Time `json:"activated_at,omitempty" description:"激活时间"`
CreatedAt time.Time `json:"created_at" description:"创建时间"`
UpdatedAt time.Time `json:"updated_at" description:"更新时间"`
// 设备实时同步字段(由 sync-info 接口写入)
OnlineStatus int `json:"online_status" description:"在线状态0未知 1在线 2离线"`
LastOnlineTime *time.Time `json:"last_online_time,omitempty" description:"最后在线时间"`
SoftwareVersion string `json:"software_version" description:"固件版本号"`
SwitchMode string `json:"switch_mode" description:"切卡模式0=自动1=手动"`
LastGatewaySyncAt *time.Time `json:"last_gateway_sync_at,omitempty" description:"最后 sync-info 同步时间"`
}
type ListDeviceResponse struct {
@@ -76,6 +82,7 @@ type DeviceCardBindingResponse struct {
CarrierName string `json:"carrier_name,omitempty" description:"运营商名称"`
Status int `json:"status" description:"卡状态 (1:在库, 2:已分销, 3:已激活, 4:已停用)"`
BindTime *time.Time `json:"bind_time,omitempty" description:"绑定时间"`
IsCurrent bool `json:"is_current" description:"是否为当前使用的卡"`
}
type ListDeviceCardsResponse struct {