| 03-device-system |
01 |
device |
| migration |
| model |
| gateway |
| dto |
|
| requires |
provides |
affects |
|
|
| tb_device 5个 sync-info 存储字段 |
| tb_device_sim_binding.is_current 字段 |
| Gateway SyncDeviceInfo() 方法 |
| DeviceResponse 5个新字段 |
| DeviceCardBindingResponse.IsCurrent |
| BoundCardInfo.IsCurrent |
|
| Plan 03-02(依赖本 Plan 全部产出:模型字段 + Gateway 方法 + DTO 定义) |
|
|
| added |
patterns |
|
|
| golang-migrate 迁移文件(up/down 对) |
| GORM 模型字段追加(保持 gorm tag 格式一致性) |
| Gateway 泛型 doRequestWithResponse[T] 调用模式 |
|
|
| created |
modified |
| migrations/000090_device_fields_extension.up.sql |
| migrations/000090_device_fields_extension.down.sql |
| migrations/000091_device_sim_binding_is_current.up.sql |
| migrations/000091_device_sim_binding_is_current.down.sql |
|
| internal/model/device.go |
| internal/model/device_sim_binding.go |
| internal/gateway/models.go |
| internal/gateway/device.go |
| internal/model/dto/device_dto.go |
| internal/model/dto/asset_dto.go |
|
|
| 5 个 sync-info 字段有离线存储意义(设备下线后保留最后状态),非实时字段(rssi/battery)不入库 |
| SyncDeviceInfo 使用同步 doRequestWithResponse[T] 泛型调用,与现有 GetDeviceInfo 区分(async vs sync) |
| is_current 字段位于 tb_device_sim_binding,由 sync-info current_iccid 决定 |
|
| duration |
completed_date |
tasks |
files |
| 8min |
2026-03-28 |
2 |
10 |
|