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:
@@ -130,18 +130,18 @@ func RedisAgentWalletLockKey(shopID uint, walletType string) string {
|
||||
return fmt.Sprintf("agent_wallet:lock:%d:%s", shopID, walletType)
|
||||
}
|
||||
|
||||
// RedisCardWalletBalanceKey 卡钱包余额缓存 Key
|
||||
// 格式:card_wallet:balance:{resource_type}:{resource_id}
|
||||
// RedisAssetWalletBalanceKey 资产钱包余额缓存 Key
|
||||
// 格式:asset_wallet:balance:{resource_type}:{resource_id}
|
||||
// TTL:180 秒(3 分钟)
|
||||
func RedisCardWalletBalanceKey(resourceType string, resourceID uint) string {
|
||||
return fmt.Sprintf("card_wallet:balance:%s:%d", resourceType, resourceID)
|
||||
func RedisAssetWalletBalanceKey(resourceType string, resourceID uint) string {
|
||||
return fmt.Sprintf("asset_wallet:balance:%s:%d", resourceType, resourceID)
|
||||
}
|
||||
|
||||
// RedisCardWalletLockKey 卡钱包分布式锁 Key
|
||||
// 格式:card_wallet:lock:{resource_type}:{resource_id}
|
||||
// RedisAssetWalletLockKey 资产钱包分布式锁 Key
|
||||
// 格式:asset_wallet:lock:{resource_type}:{resource_id}
|
||||
// TTL:10 秒
|
||||
func RedisCardWalletLockKey(resourceType string, resourceID uint) string {
|
||||
return fmt.Sprintf("card_wallet:lock:%s:%d", resourceType, resourceID)
|
||||
func RedisAssetWalletLockKey(resourceType string, resourceID uint) string {
|
||||
return fmt.Sprintf("asset_wallet:lock:%s:%d", resourceType, resourceID)
|
||||
}
|
||||
|
||||
// ========== 兼容性别名(待清理)==========
|
||||
|
||||
@@ -39,10 +39,9 @@ type WorkerStores struct {
|
||||
PollingAlertHistory *postgres.PollingAlertHistoryStore
|
||||
DataCleanupConfig *postgres.DataCleanupConfigStore
|
||||
DataCleanupLog *postgres.DataCleanupLogStore
|
||||
// 新增代理钱包 Store
|
||||
AgentWallet *postgres.AgentWalletStore
|
||||
AgentWalletTransaction *postgres.AgentWalletTransactionStore
|
||||
CardWallet *postgres.CardWalletStore // 卡钱包 Store(用于订单取消时解冻)
|
||||
AssetWallet *postgres.AssetWalletStore
|
||||
}
|
||||
|
||||
// WorkerServices Worker 侧所有 Service 的集合
|
||||
|
||||
Reference in New Issue
Block a user