f
This commit is contained in:
@@ -3,6 +3,8 @@ package admin_platform_user
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"xingfucha-server/app/main/api/internal/svc"
|
||||
"xingfucha-server/app/main/api/internal/types"
|
||||
@@ -65,6 +67,9 @@ func (l *AdminUpdatePlatformUserLogic) AdminUpdatePlatformUser(req *types.AdminU
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "更新用户失败: %v", err)
|
||||
}
|
||||
// 更新封禁状态缓存,使封禁/解封即时生效,避免中间件继续用旧缓存
|
||||
disableKey := fmt.Sprintf(types.UserDisableCacheKey, req.Id)
|
||||
_ = l.svcCtx.Redis.Setex(disableKey, strconv.FormatInt(user.Disable, 10), types.UserDisableCacheTTL)
|
||||
resp = &types.AdminUpdatePlatformUserResp{Success: true}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user