feat: 新增数据库迁移,重命名 device_no 为 virtual_no,新增 iot_card.virtual_no 和 package.virtual_ratio 字段
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m3s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m3s
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -285,3 +285,31 @@ func RedisOrderIdempotencyKey(businessKey string) string {
|
||||
func RedisOrderCreateLockKey(carrierType string, carrierID uint) string {
|
||||
return fmt.Sprintf("order:create:lock:%s:%d", carrierType, carrierID)
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// 设备保护期相关 Redis Key
|
||||
// ========================================
|
||||
|
||||
// RedisDeviceProtectKey 生成设备保护期 Redis 键
|
||||
// action: "stop"(停机保护期)或 "start"(复机保护期),两者互斥
|
||||
// 过期时间:DeviceProtectPeriodDuration(1 小时)
|
||||
func RedisDeviceProtectKey(deviceID uint, action string) string {
|
||||
return fmt.Sprintf("protect:device:%d:%s", deviceID, action)
|
||||
}
|
||||
|
||||
// RedisDeviceRefreshCooldownKey 生成设备刷新冷却期 Redis 键
|
||||
// 用途:防止同一设备短时间内多次调网关刷新(限频)
|
||||
// 过期时间:DeviceRefreshCooldownDuration(30 秒)
|
||||
func RedisDeviceRefreshCooldownKey(deviceID uint) string {
|
||||
return fmt.Sprintf("refresh:cooldown:device:%d", deviceID)
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// 轮询保护期队列 Redis Key
|
||||
// ========================================
|
||||
|
||||
// RedisPollingQueueProtectKey 保护期一致性检查轮询队列键
|
||||
// 用途:存储需要进行保护期一致性检查的卡 ID(ZSet,按时间排序)
|
||||
func RedisPollingQueueProtectKey() string {
|
||||
return "polling:queue:protect"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user