refactor(common): 重构缓存管理模块,将cache迁移至share包并实现泛型缓存存储

This commit is contained in:
575560454
2025-07-15 18:10:25 +00:00
parent 38ec291275
commit b647c74808
6 changed files with 43 additions and 42 deletions

View File

@@ -1,7 +1,7 @@
package rpc
import (
"blazing/common/data/cache"
"blazing/common/data/share"
"context"
"fmt"
"log"
@@ -27,7 +27,7 @@ type ServerHandler struct{}
// 实现踢人
func (h *ServerHandler) Kick(ctx context.Context, userid uint32) error {
useid1, err := cache.NewSessionManager().GetUserOnline(userid)
useid1, err := share.ShareManager.GetUserOnline(userid)
if err != nil {
return fmt.Errorf("user not found")