From 5a9af63ffb125cded010b3dc18909a89ee0aa9ff Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Mon, 21 Oct 2024 17:49:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=B1=E5=8C=85=E7=BC=93=E5=AD=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/user/internal/model/walletsmodel.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/user/internal/model/walletsmodel.go b/apps/user/internal/model/walletsmodel.go index 89ecb57..185ca27 100644 --- a/apps/user/internal/model/walletsmodel.go +++ b/apps/user/internal/model/walletsmodel.go @@ -78,6 +78,13 @@ func (m *customWalletsModel) UpdateBalance(session sqlx.Session, ctx context.Con if rowsAffected == 0 { return ErrVersionMismatch } + + walletsUserIdKey := fmt.Sprintf("%s%v", cacheWalletsUserIdPrefix, userId) + cacheErrors := m.DelCacheCtx(ctx, walletsUserIdKey) + if cacheErrors != nil { + return cacheErrors + } + return nil } func (m *customWalletsModel) InsertWalletsTrans(ctx context.Context, wallets *Wallets, session sqlx.Session) (sql.Result, error) {