实现资产双向换货链路查询

This commit is contained in:
2026-07-22 18:05:38 +09:00
parent 7c8a4cd328
commit c58773e35b
16 changed files with 1133 additions and 40 deletions

View File

@@ -69,8 +69,24 @@ type AssetResolveResponse struct {
GatewayExtend string `json:"gateway_extend" description:"Gateway 卡状态扩展字段,原样返回上游 extend用于展示运营商侧实际停机原因"`
GatewayCardIMEI string `json:"gateway_card_imei" description:"插拔卡业务 IMEI由 Gateway 卡状态接口同步,非设备自身 IMEI无业务含义仅供查看"`
// 流量汇总字段(仅在 ?include_usage_summary=true 时返回非 null 值)
TotalVirtualUsedMB *float64 `json:"total_virtual_used_mb" description:"当前世代所有套餐虚已用之和MB未请求时为 null"`
TotalVirtualRemainingMB *float64 `json:"total_virtual_remaining_mb" description:"当前世代所有套餐虚剩余之和MB未请求时为 null"`
TotalVirtualUsedMB *float64 `json:"total_virtual_used_mb" description:"当前世代所有套餐虚已用之和MB未请求时为 null"`
TotalVirtualRemainingMB *float64 `json:"total_virtual_remaining_mb" description:"当前世代所有套餐虚剩余之和MB未请求时为 null"`
ExchangeTrace *AssetExchangeTrace `json:"exchange_trace" description:"换货链路;对象始终存在,前代或后代不存在时对应字段为 null"`
}
// AssetExchangeTrace 资产单节点双向换货链路。
type AssetExchangeTrace struct {
PreviousAsset *AssetExchangeTraceItem `json:"previous_asset" nullable:"true" description:"当前资产的换货前代,不存在时为 null"`
NextAsset *AssetExchangeTraceItem `json:"next_asset" nullable:"true" description:"当前资产的换货后代,不存在时为 null"`
}
// AssetExchangeTraceItem 换货链路中的单个关联资产。
type AssetExchangeTraceItem struct {
AssetType string `json:"asset_type" description:"资产类型 (iot_card:物联网卡, device:设备)"`
AssetID *uint `json:"asset_id" description:"关联资产数据库 ID无权限时为 null"`
Identifier string `json:"identifier" description:"换货单保存的不可变资产标识快照"`
ExchangeNo string `json:"exchange_no" description:"换货单号"`
CanView bool `json:"can_view" description:"是否有权跳转查看关联资产"`
}
// BoundCardInfo 设备绑定的卡信息