feat(03.1-01): 修复静态 DTO 映射缺口
- toDeviceResponse() 补全 5 个 DB 缓存字段(OnlineStatus/LastOnlineTime/SoftwareVersion/SwitchMode/LastGatewaySyncAt) - ListBindings() 补全 IsCurrent 字段映射 - buildDeviceResolveResponse() 补全 isCurrentMap + BoundCardInfo.IsCurrent + 5 个 DB 缓存字段 - GetRealtimeStatus() device case 补全 isCurrentMap + BoundCardInfo.IsCurrent
This commit is contained in:
@@ -57,6 +57,7 @@ func (s *Service) ListBindings(ctx context.Context, deviceID uint) (*dto.ListDev
|
||||
CarrierName: card.CarrierName, // 直接使用 IotCard 的冗余字段
|
||||
Status: card.Status,
|
||||
BindTime: binding.BindTime,
|
||||
IsCurrent: binding.IsCurrent,
|
||||
}
|
||||
responses = append(responses, resp)
|
||||
}
|
||||
|
||||
@@ -556,6 +556,11 @@ func (s *Service) toDeviceResponse(device *model.Device, shopMap map[uint]string
|
||||
ActivatedAt: device.ActivatedAt,
|
||||
CreatedAt: device.CreatedAt,
|
||||
UpdatedAt: device.UpdatedAt,
|
||||
OnlineStatus: device.OnlineStatus,
|
||||
LastOnlineTime: device.LastOnlineTime,
|
||||
SoftwareVersion: device.SoftwareVersion,
|
||||
SwitchMode: device.SwitchMode,
|
||||
LastGatewaySyncAt: device.LastGatewaySyncAt,
|
||||
}
|
||||
|
||||
if device.ShopID != nil && *device.ShopID > 0 {
|
||||
|
||||
Reference in New Issue
Block a user