refactor: 更新 wallet 常量和队列类型以适配 asset_wallet

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-03-16 15:43:22 +08:00
parent 9c768e0719
commit 5031bf15b9
2 changed files with 11 additions and 12 deletions

View File

@@ -130,18 +130,18 @@ func RedisAgentWalletLockKey(shopID uint, walletType string) string {
return fmt.Sprintf("agent_wallet:lock:%d:%s", shopID, walletType) return fmt.Sprintf("agent_wallet:lock:%d:%s", shopID, walletType)
} }
// RedisCardWalletBalanceKey 钱包余额缓存 Key // RedisAssetWalletBalanceKey 资产钱包余额缓存 Key
// 格式:card_wallet:balance:{resource_type}:{resource_id} // 格式:asset_wallet:balance:{resource_type}:{resource_id}
// TTL180 秒3 分钟) // TTL180 秒3 分钟)
func RedisCardWalletBalanceKey(resourceType string, resourceID uint) string { func RedisAssetWalletBalanceKey(resourceType string, resourceID uint) string {
return fmt.Sprintf("card_wallet:balance:%s:%d", resourceType, resourceID) return fmt.Sprintf("asset_wallet:balance:%s:%d", resourceType, resourceID)
} }
// RedisCardWalletLockKey 钱包分布式锁 Key // RedisAssetWalletLockKey 资产钱包分布式锁 Key
// 格式:card_wallet:lock:{resource_type}:{resource_id} // 格式:asset_wallet:lock:{resource_type}:{resource_id}
// TTL10 秒 // TTL10 秒
func RedisCardWalletLockKey(resourceType string, resourceID uint) string { func RedisAssetWalletLockKey(resourceType string, resourceID uint) string {
return fmt.Sprintf("card_wallet:lock:%s:%d", resourceType, resourceID) return fmt.Sprintf("asset_wallet:lock:%s:%d", resourceType, resourceID)
} }
// ========== 兼容性别名(待清理)========== // ========== 兼容性别名(待清理)==========

View File

@@ -39,10 +39,9 @@ type WorkerStores struct {
PollingAlertHistory *postgres.PollingAlertHistoryStore PollingAlertHistory *postgres.PollingAlertHistoryStore
DataCleanupConfig *postgres.DataCleanupConfigStore DataCleanupConfig *postgres.DataCleanupConfigStore
DataCleanupLog *postgres.DataCleanupLogStore DataCleanupLog *postgres.DataCleanupLogStore
// 新增代理钱包 Store
AgentWallet *postgres.AgentWalletStore AgentWallet *postgres.AgentWalletStore
AgentWalletTransaction *postgres.AgentWalletTransactionStore AgentWalletTransaction *postgres.AgentWalletTransactionStore
CardWallet *postgres.CardWalletStore // 卡钱包 Store用于订单取消时解冻 AssetWallet *postgres.AssetWalletStore
} }
// WorkerServices Worker 侧所有 Service 的集合 // WorkerServices Worker 侧所有 Service 的集合