feat: 资产解析接口新增实名时间字段
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m5s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m5s
- AssetResolveResponse 新增 real_name_at 字段:card 类型取 first_realname_at,device 类型取绑定卡中最小的实名时间 - BoundCardInfo 新增 real_name_at 字段:各卡自己的 first_realname_at - RefreshCardDataFromGateway 手动刷新路径补写实名时间:检测到 0→1 变化时同步写入 first_realname_at - 同步更新 asset-resolve 规格文档 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -191,10 +191,24 @@ func (s *Service) buildDeviceResolveResponse(ctx context.Context, device *model.
|
||||
MSISDN: c.MSISDN,
|
||||
NetworkStatus: c.NetworkStatus,
|
||||
RealNameStatus: c.RealNameStatus,
|
||||
RealNameAt: c.FirstRealnameAt,
|
||||
SlotPosition: slotMap[c.ID],
|
||||
IsCurrent: isCurrentMap[c.ID],
|
||||
})
|
||||
}
|
||||
|
||||
// 聚合设备级 RealNameAt:取所有绑定卡 FirstRealnameAt 中的最小值(跳过 nil)
|
||||
var minRealNameAt *time.Time
|
||||
for _, c := range cards {
|
||||
if c.FirstRealnameAt == nil {
|
||||
continue
|
||||
}
|
||||
if minRealNameAt == nil || c.FirstRealnameAt.Before(*minRealNameAt) {
|
||||
t := *c.FirstRealnameAt
|
||||
minRealNameAt = &t
|
||||
}
|
||||
}
|
||||
resp.RealNameAt = minRealNameAt
|
||||
}
|
||||
|
||||
// 查当前主套餐
|
||||
@@ -228,6 +242,7 @@ func (s *Service) buildCardResolveResponse(ctx context.Context, card *model.IotC
|
||||
CreatedAt: card.CreatedAt,
|
||||
UpdatedAt: card.UpdatedAt,
|
||||
RealNameStatus: card.RealNameStatus,
|
||||
RealNameAt: card.FirstRealnameAt,
|
||||
NetworkStatus: card.NetworkStatus,
|
||||
ICCID: card.ICCID,
|
||||
CarrierID: card.CarrierID,
|
||||
|
||||
Reference in New Issue
Block a user