refactor: simplify platformID handling and enhance UserConnContext structure

This commit is contained in:
withchao
2025-12-25 15:52:19 +08:00
parent 95ab761d8f
commit 9fefa916c8
5 changed files with 441 additions and 375 deletions
+1 -2
View File
@@ -30,7 +30,6 @@ import (
"github.com/openimsdk/tools/errs"
"github.com/openimsdk/tools/log"
"github.com/openimsdk/tools/mcontext"
"github.com/openimsdk/tools/utils/stringutil"
)
var (
@@ -85,7 +84,7 @@ type Client struct {
func (c *Client) ResetClient(ctx *UserConnContext, conn ClientConn, longConnServer LongConnServer) {
c.w = new(sync.Mutex)
c.conn = conn
c.PlatformID = stringutil.StringToInt(ctx.GetPlatformID())
c.PlatformID = ctx.GetPlatformID()
c.IsCompress = ctx.GetCompression()
c.IsBackground = ctx.GetBackground()
c.UserID = ctx.GetUserID()