diff --git a/internal/api/msg.go b/internal/api/msg.go index 38e207cfb..b168aea20 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -152,7 +152,7 @@ func (m *MessageApi) DeleteMsgPhysical(c *gin.Context) { } func (m *MessageApi) getSendMsgReq(c *gin.Context, req apistruct.SendMsg) (sendMsgReq *msg.SendMsgReq, err error) { - var data interface{} + var data any log.ZDebug(c, "getSendMsgReq", "req", req.Content) switch req.ContentType { case constant.Text: diff --git a/internal/msggateway/encoder.go b/internal/msggateway/encoder.go index 9791acb39..c5f1d00a8 100644 --- a/internal/msggateway/encoder.go +++ b/internal/msggateway/encoder.go @@ -22,8 +22,8 @@ import ( ) type Encoder interface { - Encode(data interface{}) ([]byte, error) - Decode(encodeData []byte, decodeData interface{}) error + Encode(data any) ([]byte, error) + Decode(encodeData []byte, decodeData any) error } type GobEncoder struct{} @@ -32,7 +32,7 @@ func NewGobEncoder() *GobEncoder { return &GobEncoder{} } -func (g *GobEncoder) Encode(data interface{}) ([]byte, error) { +func (g *GobEncoder) Encode(data any) ([]byte, error) { buff := bytes.Buffer{} enc := gob.NewEncoder(&buff) err := enc.Encode(data) @@ -42,7 +42,7 @@ func (g *GobEncoder) Encode(data interface{}) ([]byte, error) { return buff.Bytes(), nil } -func (g *GobEncoder) Decode(encodeData []byte, decodeData interface{}) error { +func (g *GobEncoder) Decode(encodeData []byte, decodeData any) error { buff := bytes.NewBuffer(encodeData) dec := gob.NewDecoder(buff) err := dec.Decode(decodeData) diff --git a/internal/msggateway/n_ws_server.go b/internal/msggateway/n_ws_server.go index a0cecd7f5..fea35397f 100644 --- a/internal/msggateway/n_ws_server.go +++ b/internal/msggateway/n_ws_server.go @@ -46,7 +46,7 @@ type LongConnServer interface { wsHandler(w http.ResponseWriter, r *http.Request) GetUserAllCons(userID string) ([]*Client, bool) GetUserPlatformCons(userID string, platform int) ([]*Client, bool, bool) - Validate(s interface{}) error + Validate(s any) error SetCacheHandler(cache cache.MsgModel) SetDiscoveryRegistry(client discoveryregistry.SvcDiscoveryRegistry) KickUserConn(client *Client) error @@ -58,7 +58,7 @@ type LongConnServer interface { } var bufferPool = sync.Pool{ - New: func() interface{} { + New: func() any { return make([]byte, 1024) }, } @@ -122,7 +122,7 @@ func (ws *WsServer) UnRegister(c *Client) { ws.unregisterChan <- c } -func (ws *WsServer) Validate(s interface{}) error { +func (ws *WsServer) Validate(s any) error { return nil } @@ -145,7 +145,7 @@ func NewWsServer(opts ...Option) (*WsServer, error) { wsMaxConnNum: config.maxConnNum, handshakeTimeout: config.handshakeTimeout, clientPool: sync.Pool{ - New: func() interface{} { + New: func() any { return new(Client) }, }, diff --git a/internal/msgtransfer/online_history_msg_handler.go b/internal/msgtransfer/online_history_msg_handler.go index b019b0120..c53043cb2 100644 --- a/internal/msgtransfer/online_history_msg_handler.go +++ b/internal/msgtransfer/online_history_msg_handler.go @@ -61,7 +61,7 @@ type TriggerChannelValue struct { type Cmd2Value struct { Cmd int - Value interface{} + Value any } type ContextMsg struct { message *sdkws.MsgData diff --git a/internal/push/offlinepush/getui/body.go b/internal/push/offlinepush/getui/body.go index 218ed67b4..01eb22e73 100644 --- a/internal/push/offlinepush/getui/body.go +++ b/internal/push/offlinepush/getui/body.go @@ -21,9 +21,9 @@ import ( ) type Resp struct { - Code int `json:"code"` - Msg string `json:"msg"` - Data interface{} `json:"data"` + Code int `json:"code"` + Msg string `json:"msg"` + Data any `json:"data"` } func (r *Resp) parseError() (err error) { diff --git a/internal/push/offlinepush/getui/push.go b/internal/push/offlinepush/getui/push.go index 1fd65647d..b657c9c23 100644 --- a/internal/push/offlinepush/getui/push.go +++ b/internal/push/offlinepush/getui/push.go @@ -159,7 +159,7 @@ func (g *Client) singlePush(ctx context.Context, token, userID string, pushReq P return g.request(ctx, pushURL, pushReq, token, nil) } -func (g *Client) request(ctx context.Context, url string, input interface{}, token string, output interface{}) error { +func (g *Client) request(ctx context.Context, url string, input any, token string, output any) error { header := map[string]string{"token": token} resp := &Resp{} resp.Data = output @@ -170,7 +170,7 @@ func (g *Client) postReturn( ctx context.Context, url string, header map[string]string, - input interface{}, + input any, output RespI, timeout int, ) error { diff --git a/internal/push/offlinepush/jpush/body/audience.go b/internal/push/offlinepush/jpush/body/audience.go index f29930886..43a7148b8 100644 --- a/internal/push/offlinepush/jpush/body/audience.go +++ b/internal/push/offlinepush/jpush/body/audience.go @@ -23,7 +23,7 @@ const ( ) type Audience struct { - Object interface{} + Object any audience map[string][]string } diff --git a/internal/push/offlinepush/jpush/body/message.go b/internal/push/offlinepush/jpush/body/message.go index 670cd4c78..e885d1d69 100644 --- a/internal/push/offlinepush/jpush/body/message.go +++ b/internal/push/offlinepush/jpush/body/message.go @@ -15,10 +15,10 @@ package body type Message struct { - MsgContent string `json:"msg_content"` - Title string `json:"title,omitempty"` - ContentType string `json:"content_type,omitempty"` - Extras map[string]interface{} `json:"extras,omitempty"` + MsgContent string `json:"msg_content"` + Title string `json:"title,omitempty"` + ContentType string `json:"content_type,omitempty"` + Extras map[string]any `json:"extras,omitempty"` } func (m *Message) SetMsgContent(c string) { @@ -33,9 +33,9 @@ func (m *Message) SetContentType(c string) { m.ContentType = c } -func (m *Message) SetExtras(key string, value interface{}) { +func (m *Message) SetExtras(key string, value any) { if m.Extras == nil { - m.Extras = make(map[string]interface{}) + m.Extras = make(map[string]any) } m.Extras[key] = value } diff --git a/internal/push/offlinepush/jpush/body/platform.go b/internal/push/offlinepush/jpush/body/platform.go index 9de2b8711..1ef136f2c 100644 --- a/internal/push/offlinepush/jpush/body/platform.go +++ b/internal/push/offlinepush/jpush/body/platform.go @@ -29,7 +29,7 @@ const ( ) type Platform struct { - Os interface{} + Os any osArry []string } diff --git a/internal/push/offlinepush/jpush/body/pushobj.go b/internal/push/offlinepush/jpush/body/pushobj.go index c8c112f69..3dc133d0a 100644 --- a/internal/push/offlinepush/jpush/body/pushobj.go +++ b/internal/push/offlinepush/jpush/body/pushobj.go @@ -15,11 +15,11 @@ package body type PushObj struct { - Platform interface{} `json:"platform"` - Audience interface{} `json:"audience"` - Notification interface{} `json:"notification,omitempty"` - Message interface{} `json:"message,omitempty"` - Options interface{} `json:"options,omitempty"` + Platform any `json:"platform"` + Audience any `json:"audience"` + Notification any `json:"notification,omitempty"` + Message any `json:"message,omitempty"` + Options any `json:"options,omitempty"` } func (p *PushObj) SetPlatform(pf *Platform) { diff --git a/internal/push/offlinepush/jpush/push.go b/internal/push/offlinepush/jpush/push.go index 44de7ff65..567269f3c 100644 --- a/internal/push/offlinepush/jpush/push.go +++ b/internal/push/offlinepush/jpush/push.go @@ -69,11 +69,11 @@ func (j *JPush) Push(ctx context.Context, userIDs []string, title, content strin pushObj.SetNotification(&no) pushObj.SetMessage(&msg) pushObj.SetOptions(&opt) - var resp interface{} + var resp any return j.request(ctx, pushObj, resp, 5) } -func (j *JPush) request(ctx context.Context, po body.PushObj, resp interface{}, timeout int) error { +func (j *JPush) request(ctx context.Context, po body.PushObj, resp any, timeout int) error { return http2.PostReturn( ctx, config.Config.Push.Jpns.PushUrl, diff --git a/internal/push/push_to_client.go b/internal/push/push_to_client.go index b4fb35d8e..b3e2cfad5 100644 --- a/internal/push/push_to_client.go +++ b/internal/push/push_to_client.go @@ -131,7 +131,7 @@ func (p *Pusher) Push2User(ctx context.Context, userIDs []string, msg *sdkws.Msg return nil } -func (p *Pusher) UnmarshalNotificationElem(bytes []byte, t interface{}) error { +func (p *Pusher) UnmarshalNotificationElem(bytes []byte, t any) error { var notification sdkws.NotificationElem if err := json.Unmarshal(bytes, ¬ification); err != nil { return err diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index d39881b35..f117847aa 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -145,7 +145,7 @@ func (c *conversationServer) SetConversations(ctx context.Context, conversation.ConversationType = req.Conversation.ConversationType conversation.UserID = req.Conversation.UserID conversation.GroupID = req.Conversation.GroupID - m := make(map[string]interface{}) + m := make(map[string]any) if req.Conversation.RecvMsgOpt != nil { m["recv_msg_opt"] = req.Conversation.RecvMsgOpt.Value if req.Conversation.RecvMsgOpt.Value != conv.RecvMsgOpt { @@ -284,7 +284,7 @@ func (c *conversationServer) CreateGroupChatConversations(ctx context.Context, r func (c *conversationServer) SetConversationMaxSeq(ctx context.Context, req *pbconversation.SetConversationMaxSeqReq) (*pbconversation.SetConversationMaxSeqResp, error) { if err := c.conversationDatabase.UpdateUsersConversationFiled(ctx, req.OwnerUserID, req.ConversationID, - map[string]interface{}{"max_seq": req.MaxSeq}); err != nil { + map[string]any{"max_seq": req.MaxSeq}); err != nil { return nil, err } return &pbconversation.SetConversationMaxSeqResp{}, nil diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index f2ceb3beb..e0f29d27d 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -150,7 +150,7 @@ func (s *userServer) SetGlobalRecvMessageOpt(ctx context.Context, req *pbuser.Se if _, err := s.FindWithError(ctx, []string{req.UserID}); err != nil { return nil, err } - m := make(map[string]interface{}, 1) + m := make(map[string]any, 1) m["global_recv_msg_opt"] = req.GlobalRecvMsgOpt if err := s.UpdateByMap(ctx, req.UserID, m); err != nil { return nil, err @@ -172,7 +172,7 @@ func (s *userServer) AccountCheck(ctx context.Context, req *pbuser.AccountCheckR if err != nil { return nil, err } - userIDs := make(map[string]interface{}, 0) + userIDs := make(map[string]any, 0) for _, v := range users { userIDs[v.UserID] = nil } diff --git a/internal/tools/conversation.go b/internal/tools/conversation.go index 05d963a17..1dbb900b1 100644 --- a/internal/tools/conversation.go +++ b/internal/tools/conversation.go @@ -133,7 +133,7 @@ func (c *MsgTool) ConversationsDestructMsgs() { continue } if len(seqs) > 0 { - if err := c.conversationDatabase.UpdateUsersConversationFiled(ctx, []string{conversation.OwnerUserID}, conversation.ConversationID, map[string]interface{}{"latest_msg_destruct_time": now}); err != nil { + if err := c.conversationDatabase.UpdateUsersConversationFiled(ctx, []string{conversation.OwnerUserID}, conversation.ConversationID, map[string]any{"latest_msg_destruct_time": now}); err != nil { log.ZError(ctx, "updateUsersConversationFiled failed", err, "conversationID", conversation.ConversationID, "ownerUserID", conversation.OwnerUserID) continue } diff --git a/pkg/apistruct/manage.go b/pkg/apistruct/manage.go index 1e0ab3214..a48f5253c 100644 --- a/pkg/apistruct/manage.go +++ b/pkg/apistruct/manage.go @@ -36,7 +36,7 @@ type SendMsg struct { SenderPlatformID int32 `json:"senderPlatformID"` // Content is the actual content of the message, required and excluded from Swagger documentation. - Content map[string]interface{} `json:"content" binding:"required" swaggerignore:"true"` + Content map[string]any `json:"content" binding:"required" swaggerignore:"true"` // ContentType is an integer that represents the type of the content. ContentType int32 `json:"contentType" binding:"required"` diff --git a/pkg/authverify/token.go b/pkg/authverify/token.go index a8e577fde..fd01e8c5a 100644 --- a/pkg/authverify/token.go +++ b/pkg/authverify/token.go @@ -28,7 +28,7 @@ import ( ) func Secret() jwt.Keyfunc { - return func(token *jwt.Token) (interface{}, error) { + return func(token *jwt.Token) (any, error) { return []byte(config.Config.Secret), nil } } @@ -55,7 +55,7 @@ func CheckAdmin(ctx context.Context) error { return errs.ErrNoPermission.Wrap(fmt.Sprintf("user %s is not admin userID", mcontext.GetOpUserID(ctx))) } -func ParseRedisInterfaceToken(redisToken interface{}) (*tokenverify.Claims, error) { +func ParseRedisInterfaceToken(redisToken any) (*tokenverify.Claims, error) { return tokenverify.GetClaimFromToken(string(redisToken.([]uint8)), Secret()) } diff --git a/pkg/common/config/parse.go b/pkg/common/config/parse.go index f2ea962ee..22e458e00 100644 --- a/pkg/common/config/parse.go +++ b/pkg/common/config/parse.go @@ -71,7 +71,7 @@ func GetOptionsByNotification(cfg NotificationConf) msgprocessor.Options { return opts } -func initConfig(config interface{}, configName, configFolderPath string) error { +func initConfig(config any, configName, configFolderPath string) error { configFolderPath = filepath.Join(configFolderPath, configName) _, err := os.Stat(configFolderPath) if err != nil { diff --git a/pkg/common/config/parse_test.go b/pkg/common/config/parse_test.go index e34aa5b7f..38171ec08 100644 --- a/pkg/common/config/parse_test.go +++ b/pkg/common/config/parse_test.go @@ -76,7 +76,7 @@ func TestGetOptionsByNotification(t *testing.T) { func Test_initConfig(t *testing.T) { type args struct { - config interface{} + config any configName string configFolderPath string } diff --git a/pkg/common/db/cache/msg.go b/pkg/common/db/cache/msg.go index c8346a1d4..dd4418a09 100644 --- a/pkg/common/db/cache/msg.go +++ b/pkg/common/db/cache/msg.go @@ -325,7 +325,7 @@ func (c *msgCache) GetTokensWithoutError(ctx context.Context, userID string, pla func (c *msgCache) SetTokenMapByUidPid(ctx context.Context, userID string, platform int, m map[string]int) error { key := uidPidToken + userID + ":" + constant.PlatformIDToName(platform) - mm := make(map[string]interface{}) + mm := make(map[string]any) for k, v := range m { mm[k] = v } diff --git a/pkg/common/db/controller/conversation.go b/pkg/common/db/controller/conversation.go index 0aaa95880..670becf64 100644 --- a/pkg/common/db/controller/conversation.go +++ b/pkg/common/db/controller/conversation.go @@ -31,7 +31,7 @@ import ( type ConversationDatabase interface { // UpdateUserConversationFiled 更新用户该会话的属性信息 - UpdateUsersConversationFiled(ctx context.Context, userIDs []string, conversationID string, args map[string]interface{}) error + UpdateUsersConversationFiled(ctx context.Context, userIDs []string, conversationID string, args map[string]any) error // CreateConversation 创建一批新的会话 CreateConversation(ctx context.Context, conversations []*relationtb.ConversationModel) error // SyncPeerUserPrivateConversation 同步对端私聊会话内部保证事务操作 @@ -45,7 +45,7 @@ type ConversationDatabase interface { // SetUserConversations 设置用户多个会话属性,如果会话不存在则创建,否则更新,内部保证原子性 SetUserConversations(ctx context.Context, ownerUserID string, conversations []*relationtb.ConversationModel) error // SetUsersConversationFiledTx 设置多个用户会话关于某个字段的更新操作,如果会话不存在则创建,否则更新,内部保证事务操作 - SetUsersConversationFiledTx(ctx context.Context, userIDs []string, conversation *relationtb.ConversationModel, filedMap map[string]interface{}) error + SetUsersConversationFiledTx(ctx context.Context, userIDs []string, conversation *relationtb.ConversationModel, filedMap map[string]any) error CreateGroupChatConversation(ctx context.Context, groupID string, userIDs []string) error GetConversationIDs(ctx context.Context, userID string) ([]string, error) GetUserConversationIDsHash(ctx context.Context, ownerUserID string) (hash uint64, err error) @@ -72,7 +72,7 @@ type conversationDatabase struct { tx tx.Tx } -func (c *conversationDatabase) SetUsersConversationFiledTx(ctx context.Context, userIDs []string, conversation *relationtb.ConversationModel, filedMap map[string]interface{}) (err error) { +func (c *conversationDatabase) SetUsersConversationFiledTx(ctx context.Context, userIDs []string, conversation *relationtb.ConversationModel, filedMap map[string]any) (err error) { cache := c.cache.NewCache() if conversation.GroupID != "" { cache = cache.DelSuperGroupRecvMsgNotNotifyUserIDs(conversation.GroupID).DelSuperGroupRecvMsgNotNotifyUserIDsHash(conversation.GroupID) @@ -125,7 +125,7 @@ func (c *conversationDatabase) SetUsersConversationFiledTx(ctx context.Context, return cache.ExecDel(ctx) } -func (c *conversationDatabase) UpdateUsersConversationFiled(ctx context.Context, userIDs []string, conversationID string, args map[string]interface{}) error { +func (c *conversationDatabase) UpdateUsersConversationFiled(ctx context.Context, userIDs []string, conversationID string, args map[string]any) error { _, err := c.conversationDB.UpdateByMap(ctx, userIDs, conversationID, args) if err != nil { return err @@ -165,7 +165,7 @@ func (c *conversationDatabase) SyncPeerUserPrivateConversationTx(ctx context.Con return err } if len(haveUserIDs) > 0 { - _, err := conversationTx.UpdateByMap(ctx, []string{ownerUserID}, conversation.ConversationID, map[string]interface{}{"is_private_chat": conversation.IsPrivateChat}) + _, err := conversationTx.UpdateByMap(ctx, []string{ownerUserID}, conversation.ConversationID, map[string]any{"is_private_chat": conversation.IsPrivateChat}) if err != nil { return err } @@ -281,7 +281,7 @@ func (c *conversationDatabase) CreateGroupChatConversation(ctx context.Context, return err } } - _, err = c.conversationDB.UpdateByMap(ctx, existConversationUserIDs, conversationID, map[string]interface{}{"max_seq": 0}) + _, err = c.conversationDB.UpdateByMap(ctx, existConversationUserIDs, conversationID, map[string]any{"max_seq": 0}) if err != nil { return err } diff --git a/pkg/common/db/controller/friend.go b/pkg/common/db/controller/friend.go index 7816ef935..5d1c2617f 100644 --- a/pkg/common/db/controller/friend.go +++ b/pkg/common/db/controller/friend.go @@ -127,7 +127,7 @@ func (f *friendDatabase) AddFriendRequest( } // 无错误 则更新 if err == nil { - m := make(map[string]interface{}, 1) + m := make(map[string]any, 1) m["handle_result"] = 0 m["handle_msg"] = "" m["req_msg"] = reqMsg diff --git a/pkg/common/db/controller/user.go b/pkg/common/db/controller/user.go index b3726123f..eccb86bcb 100644 --- a/pkg/common/db/controller/user.go +++ b/pkg/common/db/controller/user.go @@ -40,7 +40,7 @@ type UserDatabase interface { // Update update (non-zero value) external guarantee userID exists //Update(ctx context.Context, user *relation.UserModel) (err error) // UpdateByMap update (zero value) external guarantee userID exists - UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) (err error) + UpdateByMap(ctx context.Context, userID string, args map[string]any) (err error) // Page If not found, no error is returned Page(ctx context.Context, pageNumber, showNumber int32) (users []*relation.UserModel, count int64, err error) // IsExist true as long as one exists @@ -138,7 +138,7 @@ func (u *userDatabase) Update(ctx context.Context, user *relation.UserModel) (er } // UpdateByMap update (zero value) externally guarantees that userID exists. -func (u *userDatabase) UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) (err error) { +func (u *userDatabase) UpdateByMap(ctx context.Context, userID string, args map[string]any) (err error) { if err := u.userDB.UpdateByMap(ctx, userID, args); err != nil { return err } diff --git a/pkg/common/db/newmgo/user.go b/pkg/common/db/newmgo/user.go index 1b5b9036b..7b20811ec 100644 --- a/pkg/common/db/newmgo/user.go +++ b/pkg/common/db/newmgo/user.go @@ -21,7 +21,7 @@ type UserModel struct { type UserModelInterface interface { Create(ctx context.Context, users []*UserModel) (err error) - UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) (err error) + UpdateByMap(ctx context.Context, userID string, args map[string]any) (err error) // 获取指定用户信息 不存在,也不返回错误 Find(ctx context.Context, userIDs []string) (users []*UserModel, err error) // 获取某个用户信息 不存在,则返回错误 diff --git a/pkg/common/db/relation/black_model.go b/pkg/common/db/relation/black_model.go index 34123c7a3..458012d15 100644 --- a/pkg/common/db/relation/black_model.go +++ b/pkg/common/db/relation/black_model.go @@ -47,7 +47,7 @@ func (b *BlackGorm) Delete(ctx context.Context, blacks []*relation.BlackModel) ( func (b *BlackGorm) UpdateByMap( ctx context.Context, ownerUserID, blockUserID string, - args map[string]interface{}, + args map[string]any, ) (err error) { return utils.Wrap( b.db(ctx).Where("block_user_id = ? and block_user_id = ?", ownerUserID, blockUserID).Updates(args).Error, @@ -63,9 +63,9 @@ func (b *BlackGorm) Find( ctx context.Context, blacks []*relation.BlackModel, ) (blackList []*relation.BlackModel, err error) { - var where [][]interface{} + var where [][]any for _, black := range blacks { - where = append(where, []interface{}{black.OwnerUserID, black.BlockUserID}) + where = append(where, []any{black.OwnerUserID, black.BlockUserID}) } return blackList, utils.Wrap( b.db(ctx).Where("(owner_user_id, block_user_id) in ?", where).Find(&blackList).Error, diff --git a/pkg/common/db/relation/conversation_model.go b/pkg/common/db/relation/conversation_model.go index f39047bf6..329c35f94 100644 --- a/pkg/common/db/relation/conversation_model.go +++ b/pkg/common/db/relation/conversation_model.go @@ -50,7 +50,7 @@ func (c *ConversationGorm) UpdateByMap( ctx context.Context, userIDList []string, conversationID string, - args map[string]interface{}, + args map[string]any, ) (rows int64, err error) { result := c.db(ctx).Where("owner_user_id IN (?) and conversation_id=?", userIDList, conversationID).Updates(args) return result.RowsAffected, utils.Wrap(result.Error, "") diff --git a/pkg/common/db/relation/friend_model.go b/pkg/common/db/relation/friend_model.go index 869254455..50f4451b5 100644 --- a/pkg/common/db/relation/friend_model.go +++ b/pkg/common/db/relation/friend_model.go @@ -58,7 +58,7 @@ func (f *FriendGorm) UpdateByMap( ctx context.Context, ownerUserID string, friendUserID string, - args map[string]interface{}, + args map[string]any, ) (err error) { return utils.Wrap( f.db(ctx).Where("owner_user_id = ? AND friend_user_id = ? ", ownerUserID, friendUserID).Updates(args).Error, @@ -82,7 +82,7 @@ func (f *FriendGorm) UpdateRemark(ctx context.Context, ownerUserID, friendUserID "", ) } - m := make(map[string]interface{}, 1) + m := make(map[string]any, 1) m["remark"] = "" return utils.Wrap(f.db(ctx).Where("owner_user_id = ?", ownerUserID).Updates(m).Error, "") } diff --git a/pkg/common/db/relation/friend_request_model.go b/pkg/common/db/relation/friend_request_model.go index 5678f7b7b..6ee25b26c 100644 --- a/pkg/common/db/relation/friend_request_model.go +++ b/pkg/common/db/relation/friend_request_model.go @@ -57,7 +57,7 @@ func (f *FriendRequestGorm) UpdateByMap( ctx context.Context, fromUserID string, toUserID string, - args map[string]interface{}, + args map[string]any, ) (err error) { return utils.Wrap( f.db(ctx). diff --git a/pkg/common/db/relation/group_model.go b/pkg/common/db/relation/group_model.go index 7a8eee9f0..4f41f8fcf 100644 --- a/pkg/common/db/relation/group_model.go +++ b/pkg/common/db/relation/group_model.go @@ -47,7 +47,7 @@ func (g *GroupGorm) Create(ctx context.Context, groups []*relation.GroupModel) ( return utils.Wrap(g.DB.Create(&groups).Error, "") } -func (g *GroupGorm) UpdateMap(ctx context.Context, groupID string, args map[string]interface{}) (err error) { +func (g *GroupGorm) UpdateMap(ctx context.Context, groupID string, args map[string]any) (err error) { return utils.Wrap(g.DB.Where("group_id = ?", groupID).Model(&relation.GroupModel{}).Updates(args).Error, "") } diff --git a/pkg/common/db/relation/user_model.go b/pkg/common/db/relation/user_model.go index b04c29816..fd7ba3f84 100644 --- a/pkg/common/db/relation/user_model.go +++ b/pkg/common/db/relation/user_model.go @@ -41,7 +41,7 @@ func (u *UserGorm) Create(ctx context.Context, users []*relation.UserModel) (err } // 更新用户信息 零值. -func (u *UserGorm) UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) (err error) { +func (u *UserGorm) UpdateByMap(ctx context.Context, userID string, args map[string]any) (err error) { return utils.Wrap(u.db(ctx).Model(&relation.UserModel{}).Where("user_id = ?", userID).Updates(args).Error, "") } diff --git a/pkg/common/db/s3/cos/internal.go b/pkg/common/db/s3/cos/internal.go index 0e58a851c..02afde684 100644 --- a/pkg/common/db/s3/cos/internal.go +++ b/pkg/common/db/s3/cos/internal.go @@ -10,4 +10,4 @@ import ( ) //go:linkname newRequest github.com/tencentyun/cos-go-sdk-v5.(*Client).newRequest -func newRequest(c *cos.Client, ctx context.Context, baseURL *url.URL, uri, method string, body interface{}, optQuery interface{}, optHeader interface{}) (req *http.Request, err error) +func newRequest(c *cos.Client, ctx context.Context, baseURL *url.URL, uri, method string, body any, optQuery any, optHeader any) (req *http.Request, err error) diff --git a/pkg/common/db/s3/oss/internal.go b/pkg/common/db/s3/oss/internal.go index 4ca1acc47..155708ffd 100644 --- a/pkg/common/db/s3/oss/internal.go +++ b/pkg/common/db/s3/oss/internal.go @@ -26,7 +26,7 @@ import ( func signHeader(c oss.Conn, req *http.Request, canonicalizedResource string) //go:linkname getURLParams github.com/aliyun/aliyun-oss-go-sdk/oss.Conn.getURLParams -func getURLParams(c oss.Conn, params map[string]interface{}) string +func getURLParams(c oss.Conn, params map[string]any) string //go:linkname getURL github.com/aliyun/aliyun-oss-go-sdk/oss.urlMaker.getURL func getURL(um urlMaker, bucket, object, params string) *url.URL diff --git a/pkg/common/db/table/relation/black.go b/pkg/common/db/table/relation/black.go index 59dd12122..1697eaec6 100644 --- a/pkg/common/db/table/relation/black.go +++ b/pkg/common/db/table/relation/black.go @@ -39,7 +39,7 @@ func (BlackModel) TableName() string { type BlackModelInterface interface { Create(ctx context.Context, blacks []*BlackModel) (err error) Delete(ctx context.Context, blacks []*BlackModel) (err error) - UpdateByMap(ctx context.Context, ownerUserID, blockUserID string, args map[string]interface{}) (err error) + UpdateByMap(ctx context.Context, ownerUserID, blockUserID string, args map[string]any) (err error) Update(ctx context.Context, blacks []*BlackModel) (err error) Find(ctx context.Context, blacks []*BlackModel) (blackList []*BlackModel, err error) Take(ctx context.Context, ownerUserID, blockUserID string) (black *BlackModel, err error) diff --git a/pkg/common/db/table/relation/conversation.go b/pkg/common/db/table/relation/conversation.go index e9680873f..07de85d59 100644 --- a/pkg/common/db/table/relation/conversation.go +++ b/pkg/common/db/table/relation/conversation.go @@ -51,7 +51,7 @@ func (ConversationModel) TableName() string { type ConversationModelInterface interface { Create(ctx context.Context, conversations []*ConversationModel) (err error) Delete(ctx context.Context, groupIDs []string) (err error) - UpdateByMap(ctx context.Context, userIDs []string, conversationID string, args map[string]interface{}) (rows int64, err error) + UpdateByMap(ctx context.Context, userIDs []string, conversationID string, args map[string]any) (rows int64, err error) Update(ctx context.Context, conversation *ConversationModel) (err error) Find(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []*ConversationModel, err error) FindUserID(ctx context.Context, userIDs []string, conversationIDs []string) ([]string, error) diff --git a/pkg/common/db/table/relation/friend.go b/pkg/common/db/table/relation/friend.go index 58d8d1d34..24aac756e 100644 --- a/pkg/common/db/table/relation/friend.go +++ b/pkg/common/db/table/relation/friend.go @@ -43,7 +43,7 @@ type FriendModelInterface interface { // 删除ownerUserID指定的好友 Delete(ctx context.Context, ownerUserID string, friendUserIDs []string) (err error) // 更新ownerUserID单个好友信息 更新零值 - UpdateByMap(ctx context.Context, ownerUserID string, friendUserID string, args map[string]interface{}) (err error) + UpdateByMap(ctx context.Context, ownerUserID string, friendUserID string, args map[string]any) (err error) // 更新好友信息的非零值 Update(ctx context.Context, friends []*FriendModel) (err error) // 更新好友备注(也支持零值 ) diff --git a/pkg/common/db/table/relation/friend_request.go b/pkg/common/db/table/relation/friend_request.go index 51ea0ef6e..e101aee6a 100644 --- a/pkg/common/db/table/relation/friend_request.go +++ b/pkg/common/db/table/relation/friend_request.go @@ -43,7 +43,7 @@ type FriendRequestModelInterface interface { // 删除记录 Delete(ctx context.Context, fromUserID, toUserID string) (err error) // 更新零值 - UpdateByMap(ctx context.Context, formUserID string, toUserID string, args map[string]interface{}) (err error) + UpdateByMap(ctx context.Context, formUserID string, toUserID string, args map[string]any) (err error) // 更新多条记录 (非零值) Update(ctx context.Context, friendRequest *FriendRequestModel) (err error) // 获取来指定用户的好友申请 未找到 不返回错误 diff --git a/pkg/common/db/table/relation/group.go b/pkg/common/db/table/relation/group.go index 6759e0d35..fd9c5b3d0 100644 --- a/pkg/common/db/table/relation/group.go +++ b/pkg/common/db/table/relation/group.go @@ -48,7 +48,7 @@ func (GroupModel) TableName() string { type GroupModelInterface interface { NewTx(tx any) GroupModelInterface Create(ctx context.Context, groups []*GroupModel) (err error) - UpdateMap(ctx context.Context, groupID string, args map[string]interface{}) (err error) + UpdateMap(ctx context.Context, groupID string, args map[string]any) (err error) UpdateStatus(ctx context.Context, groupID string, status int32) (err error) Find(ctx context.Context, groupIDs []string) (groups []*GroupModel, err error) FindNotDismissedGroup(ctx context.Context, groupIDs []string) (groups []*GroupModel, err error) diff --git a/pkg/common/db/table/relation/user.go b/pkg/common/db/table/relation/user.go index 10a715bda..07da7adc7 100644 --- a/pkg/common/db/table/relation/user.go +++ b/pkg/common/db/table/relation/user.go @@ -55,7 +55,7 @@ func (UserModel) TableName() string { type UserModelInterface interface { Create(ctx context.Context, users []*UserModel) (err error) - UpdateByMap(ctx context.Context, userID string, args map[string]interface{}) (err error) + UpdateByMap(ctx context.Context, userID string, args map[string]any) (err error) Update(ctx context.Context, user *UserModel) (err error) // 获取指定用户信息 不存在,也不返回错误 Find(ctx context.Context, userIDs []string) (users []*UserModel, err error) diff --git a/pkg/common/db/unrelation/msg_convert.go b/pkg/common/db/unrelation/msg_convert.go index 810b4f419..373bc843e 100644 --- a/pkg/common/db/unrelation/msg_convert.go +++ b/pkg/common/db/unrelation/msg_convert.go @@ -48,7 +48,7 @@ func (m *MsgMongoDriver) ConvertMsgsDocLen(ctx context.Context, conversationIDs log.ZError(ctx, "convertAll delete many failed", err, "conversationID", conversationID) continue } - var newMsgDocs []interface{} + var newMsgDocs []any for _, msgDoc := range msgDocs { if int64(len(msgDoc.Msg)) == m.model.GetSingleGocMsgNum() { continue diff --git a/pkg/common/http/http_client.go b/pkg/common/http/http_client.go index e0cedf357..b1fdf37ef 100644 --- a/pkg/common/http/http_client.go +++ b/pkg/common/http/http_client.go @@ -58,7 +58,7 @@ func Get(url string) (response []byte, err error) { return body, nil } -func Post(ctx context.Context, url string, header map[string]string, data interface{}, timeout int) (content []byte, err error) { +func Post(ctx context.Context, url string, header map[string]string, data any, timeout int) (content []byte, err error) { if timeout > 0 { var cancel func() ctx, cancel = context.WithTimeout(ctx, time.Second*time.Duration(timeout)) @@ -97,7 +97,7 @@ func Post(ctx context.Context, url string, header map[string]string, data interf return result, nil } -func PostReturn(ctx context.Context, url string, header map[string]string, input, output interface{}, timeOutSecond int) error { +func PostReturn(ctx context.Context, url string, header map[string]string, input, output any, timeOutSecond int) error { b, err := Post(ctx, url, header, input, timeOutSecond) if err != nil { return err @@ -106,7 +106,7 @@ func PostReturn(ctx context.Context, url string, header map[string]string, input return err } -func callBackPostReturn(ctx context.Context, url, command string, input interface{}, output callbackstruct.CallbackResp, callbackConfig config.CallBackConfig) error { +func callBackPostReturn(ctx context.Context, url, command string, input any, output callbackstruct.CallbackResp, callbackConfig config.CallBackConfig) error { defer log.ZDebug(ctx, "callback", "url", url, "command", command, "input", input, "callbackConfig", callbackConfig) v := urllib.Values{} diff --git a/pkg/common/http/http_client_test.go b/pkg/common/http/http_client_test.go index 1735a3da7..5d2588673 100644 --- a/pkg/common/http/http_client_test.go +++ b/pkg/common/http/http_client_test.go @@ -54,7 +54,7 @@ func TestPost(t *testing.T) { ctx context.Context url string header map[string]string - data interface{} + data any timeout int } tests := []struct { @@ -84,8 +84,8 @@ func TestPostReturn(t *testing.T) { ctx context.Context url string header map[string]string - input interface{} - output interface{} + input any + output any timeOutSecond int } tests := []struct { @@ -109,7 +109,7 @@ func Test_callBackPostReturn(t *testing.T) { ctx context.Context url string command string - input interface{} + input any output callbackstruct.CallbackResp callbackConfig config.CallBackConfig } diff --git a/test/e2e/api/token/token.go b/test/e2e/api/token/token.go index 679c0bbda..4c578e8f7 100644 --- a/test/e2e/api/token/token.go +++ b/test/e2e/api/token/token.go @@ -125,7 +125,7 @@ func RegisterUser(token, userID, nickname, faceURL string) error { return err } - var respData map[string]interface{} + var respData map[string]any if err := json.Unmarshal(respBody, &respData); err != nil { return err } diff --git a/test/e2e/api/user/user.go b/test/e2e/api/user/user.go index 66419b735..9facf76ac 100644 --- a/test/e2e/api/user/user.go +++ b/test/e2e/api/user/user.go @@ -71,7 +71,7 @@ func GetUsers(token string, pageNumber, showNumber int) error { } // sendPostRequestWithToken sends a POST request with a token in the header -func sendPostRequestWithToken(url, token string, body interface{}) error { +func sendPostRequestWithToken(url, token string, body any) error { reqBytes, err := json.Marshal(body) if err != nil { return err @@ -98,7 +98,7 @@ func sendPostRequestWithToken(url, token string, body interface{}) error { return err } - var respData map[string]interface{} + var respData map[string]any if err := json.Unmarshal(respBody, &respData); err != nil { return err } diff --git a/test/e2e/framework/config/config.go b/test/e2e/framework/config/config.go index f790de5f3..ed3c6a258 100644 --- a/test/e2e/framework/config/config.go +++ b/test/e2e/framework/config/config.go @@ -43,8 +43,8 @@ type Config struct { // LoadConfig loads the configurations from environment variables or default values. func LoadConfig() *Config { return &Config{ - APIHost: getEnv("OPENIM_API_HOST", "127.0.0.1"), - APIPort: getEnv("API_OPENIM_PORT", "10002"), + APIHost: getEnv("OPENIM_API_HOST", "127.0.0.1"), + APIPort: getEnv("API_OPENIM_PORT", "10002"), // TODO: Set default variable MsgGatewayHost: getEnv("OPENIM_MSGGATEWAY_HOST", "default-msggateway-host"), diff --git a/test/jwt/main.go b/test/jwt/main.go index a669df9d6..0ef845237 100644 --- a/test/jwt/main.go +++ b/test/jwt/main.go @@ -25,7 +25,7 @@ func main() { // Verify the token claims := &jwt.MapClaims{} - parsedT, err := jwt.ParseWithClaims(rawJWT, claims, func(token *jwt.Token) (interface{}, error) { + parsedT, err := jwt.ParseWithClaims(rawJWT, claims, func(token *jwt.Token) (any, error) { // Validate the alg is HMAC signature if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"]) diff --git a/test/typecheck/typecheck.go b/test/typecheck/typecheck.go index 0fc33597b..83e3c63ed 100644 --- a/test/typecheck/typecheck.go +++ b/test/typecheck/typecheck.go @@ -239,7 +239,7 @@ func dedup(errors []packages.Error) []string { var outMu sync.Mutex -func serialFprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { +func serialFprintf(w io.Writer, format string, a ...any) (n int, err error) { outMu.Lock() defer outMu.Unlock() return fmt.Fprintf(w, format, a...) diff --git a/tools/data-conversion/openim/proto/msg/msg.pb.go b/tools/data-conversion/openim/proto/msg/msg.pb.go index 2954a3a76..a0a6cdf02 100644 --- a/tools/data-conversion/openim/proto/msg/msg.pb.go +++ b/tools/data-conversion/openim/proto/msg/msg.pb.go @@ -2703,7 +2703,7 @@ func RegisterMsgServer(s *grpc.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_GetMaxAndMinSeq_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(sdk_ws.GetMaxAndMinSeqReq) if err := dec(in); err != nil { return nil, err @@ -2715,13 +2715,13 @@ func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/msg.msg/GetMaxAndMinSeq", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).GetMaxAndMinSeq(ctx, req.(*sdk_ws.GetMaxAndMinSeqReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_PullMessageBySeqList_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(sdk_ws.PullMessageBySeqListReq) if err := dec(in); err != nil { return nil, err @@ -2733,13 +2733,13 @@ func _Msg_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec Server: srv, FullMethod: "/msg.msg/PullMessageBySeqList", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).PullMessageBySeqList(ctx, req.(*sdk_ws.PullMessageBySeqListReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_SendMsg_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(SendMsgReq) if err := dec(in); err != nil { return nil, err @@ -2751,13 +2751,13 @@ func _Msg_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interfa Server: srv, FullMethod: "/msg.msg/SendMsg", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).SendMsg(ctx, req.(*SendMsgReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_DelMsgList_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(sdk_ws.DelMsgListReq) if err := dec(in); err != nil { return nil, err @@ -2769,13 +2769,13 @@ func _Msg_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(inte Server: srv, FullMethod: "/msg.msg/DelMsgList", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).DelMsgList(ctx, req.(*sdk_ws.DelMsgListReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_DelSuperGroupMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_DelSuperGroupMsg_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(DelSuperGroupMsgReq) if err := dec(in); err != nil { return nil, err @@ -2787,13 +2787,13 @@ func _Msg_DelSuperGroupMsg_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/msg.msg/DelSuperGroupMsg", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).DelSuperGroupMsg(ctx, req.(*DelSuperGroupMsgReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_ClearMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_ClearMsg_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(ClearMsgReq) if err := dec(in); err != nil { return nil, err @@ -2805,13 +2805,13 @@ func _Msg_ClearMsg_Handler(srv interface{}, ctx context.Context, dec func(interf Server: srv, FullMethod: "/msg.msg/ClearMsg", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).ClearMsg(ctx, req.(*ClearMsgReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_SetMsgMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_SetMsgMinSeq_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(SetMsgMinSeqReq) if err := dec(in); err != nil { return nil, err @@ -2823,13 +2823,13 @@ func _Msg_SetMsgMinSeq_Handler(srv interface{}, ctx context.Context, dec func(in Server: srv, FullMethod: "/msg.msg/SetMsgMinSeq", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).SetMsgMinSeq(ctx, req.(*SetMsgMinSeqReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_SetSendMsgStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_SetSendMsgStatus_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(SetSendMsgStatusReq) if err := dec(in); err != nil { return nil, err @@ -2841,13 +2841,13 @@ func _Msg_SetSendMsgStatus_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/msg.msg/SetSendMsgStatus", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).SetSendMsgStatus(ctx, req.(*SetSendMsgStatusReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_GetSendMsgStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_GetSendMsgStatus_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetSendMsgStatusReq) if err := dec(in); err != nil { return nil, err @@ -2859,13 +2859,13 @@ func _Msg_GetSendMsgStatus_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/msg.msg/GetSendMsgStatus", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).GetSendMsgStatus(ctx, req.(*GetSendMsgStatusReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_GetSuperGroupMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_GetSuperGroupMsg_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetSuperGroupMsgReq) if err := dec(in); err != nil { return nil, err @@ -2877,13 +2877,13 @@ func _Msg_GetSuperGroupMsg_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/msg.msg/GetSuperGroupMsg", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).GetSuperGroupMsg(ctx, req.(*GetSuperGroupMsgReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_GetWriteDiffMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_GetWriteDiffMsg_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetWriteDiffMsgReq) if err := dec(in); err != nil { return nil, err @@ -2895,13 +2895,13 @@ func _Msg_GetWriteDiffMsg_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/msg.msg/GetWriteDiffMsg", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).GetWriteDiffMsg(ctx, req.(*GetWriteDiffMsgReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_SetMessageReactionExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_SetMessageReactionExtensions_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(SetMessageReactionExtensionsReq) if err := dec(in); err != nil { return nil, err @@ -2913,13 +2913,13 @@ func _Msg_SetMessageReactionExtensions_Handler(srv interface{}, ctx context.Cont Server: srv, FullMethod: "/msg.msg/SetMessageReactionExtensions", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).SetMessageReactionExtensions(ctx, req.(*SetMessageReactionExtensionsReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_GetMessageListReactionExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_GetMessageListReactionExtensions_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetMessageListReactionExtensionsReq) if err := dec(in); err != nil { return nil, err @@ -2931,13 +2931,13 @@ func _Msg_GetMessageListReactionExtensions_Handler(srv interface{}, ctx context. Server: srv, FullMethod: "/msg.msg/GetMessageListReactionExtensions", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).GetMessageListReactionExtensions(ctx, req.(*GetMessageListReactionExtensionsReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_AddMessageReactionExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_AddMessageReactionExtensions_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(AddMessageReactionExtensionsReq) if err := dec(in); err != nil { return nil, err @@ -2949,13 +2949,13 @@ func _Msg_AddMessageReactionExtensions_Handler(srv interface{}, ctx context.Cont Server: srv, FullMethod: "/msg.msg/AddMessageReactionExtensions", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).AddMessageReactionExtensions(ctx, req.(*AddMessageReactionExtensionsReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_DeleteMessageReactionExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Msg_DeleteMessageReactionExtensions_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(DeleteMessageListReactionExtensionsReq) if err := dec(in); err != nil { return nil, err @@ -2967,7 +2967,7 @@ func _Msg_DeleteMessageReactionExtensions_Handler(srv interface{}, ctx context.C Server: srv, FullMethod: "/msg.msg/DeleteMessageReactionExtensions", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(MsgServer).DeleteMessageReactionExtensions(ctx, req.(*DeleteMessageListReactionExtensionsReq)) } return interceptor(ctx, in, info, handler) diff --git a/tools/data-conversion/openim/proto/sdk_ws/ws.pb.go b/tools/data-conversion/openim/proto/sdk_ws/ws.pb.go index 097280860..94b6f9be6 100644 --- a/tools/data-conversion/openim/proto/sdk_ws/ws.pb.go +++ b/tools/data-conversion/openim/proto/sdk_ws/ws.pb.go @@ -4156,8 +4156,8 @@ func (m *SignalReq) GetGetTokenByRoomID() *SignalGetTokenByRoomIDReq { } // XXX_OneofFuncs is for the internal use of the proto package. -func (*SignalReq) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _SignalReq_OneofMarshaler, _SignalReq_OneofUnmarshaler, _SignalReq_OneofSizer, []interface{}{ +func (*SignalReq) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []any) { + return _SignalReq_OneofMarshaler, _SignalReq_OneofUnmarshaler, _SignalReq_OneofSizer, []any{ (*SignalReq_Invite)(nil), (*SignalReq_InviteInGroup)(nil), (*SignalReq_Cancel)(nil), @@ -4523,8 +4523,8 @@ func (m *SignalResp) GetGetTokenByRoomID() *SignalGetTokenByRoomIDReply { } // XXX_OneofFuncs is for the internal use of the proto package. -func (*SignalResp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _SignalResp_OneofMarshaler, _SignalResp_OneofUnmarshaler, _SignalResp_OneofSizer, []interface{}{ +func (*SignalResp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []any) { + return _SignalResp_OneofMarshaler, _SignalResp_OneofUnmarshaler, _SignalResp_OneofSizer, []any{ (*SignalResp_Invite)(nil), (*SignalResp_InviteInGroup)(nil), (*SignalResp_Cancel)(nil),