From 837efc90b692ebaebfb5ef1b41dfab84680db300 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 5 Dec 2022 18:29:58 +0800 Subject: [PATCH 01/13] ws connID --- internal/msg_gateway/gate/callback.go | 6 ++++-- internal/msg_gateway/gate/logic.go | 4 ++-- internal/msg_gateway/gate/ws_server.go | 12 +++++++----- pkg/call_back_struct/msg_gateway.go | 6 ++++-- pkg/common/db/extend_msg_mongo_model.go | 11 +++++++++-- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/internal/msg_gateway/gate/callback.go b/internal/msg_gateway/gate/callback.go index b2f15035e..139d89afc 100644 --- a/internal/msg_gateway/gate/callback.go +++ b/internal/msg_gateway/gate/callback.go @@ -9,7 +9,7 @@ import ( "time" ) -func callbackUserOnline(operationID, userID string, platformID int, token string, isAppBackgroundStatusChanged bool) cbApi.CommonCallbackResp { +func callbackUserOnline(operationID, userID string, platformID int, token string, isAppBackgroundStatusChanged bool, connID string) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackUserOnline.Enable { return callbackResp @@ -27,6 +27,7 @@ func callbackUserOnline(operationID, userID string, platformID int, token string }, Seq: int(time.Now().UnixNano() / 1e6), IsAppBackgroundStatusChanged: isAppBackgroundStatusChanged, + ConnID: connID, } callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: &callbackResp} if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOnlineCommand, callbackUserOnlineReq, callbackUserOnlineResp, config.Config.Callback.CallbackUserOnline.CallbackTimeOut); err != nil { @@ -36,7 +37,7 @@ func callbackUserOnline(operationID, userID string, platformID int, token string return callbackResp } -func callbackUserOffline(operationID, userID string, platformID int, isAppBackgroundStatusChanged bool) cbApi.CommonCallbackResp { +func callbackUserOffline(operationID, userID string, platformID int, isAppBackgroundStatusChanged bool, connID string) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackUserOffline.Enable { return callbackResp @@ -53,6 +54,7 @@ func callbackUserOffline(operationID, userID string, platformID int, isAppBackgr }, Seq: int(time.Now().UnixNano() / 1e6), IsAppBackgroundStatusChanged: isAppBackgroundStatusChanged, + ConnID: connID, } callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: &callbackResp} if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOfflineCommand, callbackOfflineReq, callbackUserOfflineResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil { diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index edf1c0c56..4c8283b10 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -407,12 +407,12 @@ func (ws *WServer) setUserDeviceBackground(conn *UserConn, m *Req) { req := pData.(*sdk_ws.SetAppBackgroundStatusReq) conn.IsBackground = req.IsBackground if !conn.IsBackground { - callbackResp := callbackUserOnline(m.OperationID, conn.userID, int(conn.PlatformID), conn.token, true) + callbackResp := callbackUserOnline(m.OperationID, conn.userID, int(conn.PlatformID), conn.token, true, conn.connID) if callbackResp.ErrCode != 0 { log.NewError(m.OperationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) } } else { - callbackResp := callbackUserOffline(m.OperationID, conn.userID, int(conn.PlatformID), true) + callbackResp := callbackUserOffline(m.OperationID, conn.userID, int(conn.PlatformID), true, conn.connID) if callbackResp.ErrCode != 0 { log.NewError(m.OperationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) } diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index aa68a8e75..68bfa63c4 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -15,6 +15,7 @@ import ( "context" "encoding/gob" "io/ioutil" + "strconv" "strings" go_redis "github.com/go-redis/redis/v8" @@ -37,6 +38,7 @@ type UserConn struct { userID string IsBackground bool token string + connID string } type WServer struct { @@ -82,9 +84,9 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { log.Error(operationID, "upgrade http conn err", err.Error(), query) return } else { - newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0]} + newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.RemoteAddr().String() + strconv.Itoa(int(utils.GetCurrentTimestampBySecond()))} userCount++ - ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], operationID) + ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], newConn.connID, operationID) go ws.readMsg(newConn) } } else { @@ -319,11 +321,11 @@ func (ws *WServer) sendKickMsg(oldConn *UserConn) { } } -func (ws *WServer) addUserConn(uid string, platformID int, conn *UserConn, token string, operationID string) { +func (ws *WServer) addUserConn(uid string, platformID int, conn *UserConn, token string, connID, operationID string) { rwLock.Lock() defer rwLock.Unlock() log.Info(operationID, utils.GetSelfFuncName(), " args: ", uid, platformID, conn, token, "ip: ", conn.RemoteAddr().String()) - callbackResp := callbackUserOnline(operationID, uid, platformID, token, false) + callbackResp := callbackUserOnline(operationID, uid, platformID, token, false, connID) if callbackResp.ErrCode != 0 { log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOnline resp:", callbackResp) } @@ -386,7 +388,7 @@ func (ws *WServer) delUserConn(conn *UserConn) { if err != nil { log.Error(operationID, " close err", "", "uid", uid, "platform", platform) } - callbackResp := callbackUserOffline(operationID, conn.userID, platform, false) + callbackResp := callbackUserOffline(operationID, conn.userID, platform, false, conn.connID) if callbackResp.ErrCode != 0 { log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) } diff --git a/pkg/call_back_struct/msg_gateway.go b/pkg/call_back_struct/msg_gateway.go index 87d07c19f..235f63105 100644 --- a/pkg/call_back_struct/msg_gateway.go +++ b/pkg/call_back_struct/msg_gateway.go @@ -5,6 +5,7 @@ type CallbackUserOnlineReq struct { Token string `json:"token"` Seq int `json:"seq"` IsAppBackgroundStatusChanged bool `json:"isAppBackgroundStatusChanged"` + ConnID string `json:"connID"` } type CallbackUserOnlineResp struct { @@ -13,8 +14,9 @@ type CallbackUserOnlineResp struct { type CallbackUserOfflineReq struct { UserStatusCallbackReq - Seq int `json:"seq"` - IsAppBackgroundStatusChanged bool `json:"isAppBackgroundStatusChanged"` + Seq int `json:"seq"` + IsAppBackgroundStatusChanged bool `json:"isAppBackgroundStatusChanged"` + ConnID string `json:"connID"` } type CallbackUserOfflineResp struct { diff --git a/pkg/common/db/extend_msg_mongo_model.go b/pkg/common/db/extend_msg_mongo_model.go index 6c9583839..7ee7c0650 100644 --- a/pkg/common/db/extend_msg_mongo_model.go +++ b/pkg/common/db/extend_msg_mongo_model.go @@ -25,7 +25,7 @@ type ExtendMsgSet struct { } type ReactionExtendMsgSet struct { - TypeKey string `bson:"type_key" json:"typeKey"` + UserKey string `bson:"user_key" json:"userKey"` Value string `bson:"value" json:"value"` } @@ -82,13 +82,20 @@ func (d *DataBases) InsertExtendMsg(ID string, index int32, msg *ExtendMsg) (msg return set.ExtendMsgNum, err } -func (d *DataBases) UpdateOneExtendMsgSet(ID string, index, MsgIndex int32, msg *ExtendMsg, msgSet *ExtendMsgSet) error { +func (d *DataBases) UpdateOneExtendMsgSet(ID string, index, MsgIndex int32, userIndex string, value string) error { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) _, err := c.UpdateOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}, bson.M{}) return err } +func (d *DataBases) DelOneExtendMsgSetUserKey(ID string, index, MsgIndex int32, userIndex string, userID string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) + _, err := c.DeleteOne(ctx, bson.M{"uid": GetExtendMsgSetID(ID, index)}) + return err +} + func (d *DataBases) GetExtendMsgList(ID string, index, msgStartIndex, msgEndIndex int32) (extendMsgList []*ExtendMsg, err error) { ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cExtendMsgSet) From 156c6429d3b91ac66e9ef21227c896826d266166 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 5 Dec 2022 18:34:51 +0800 Subject: [PATCH 02/13] ws connID --- internal/msg_gateway/gate/ws_server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 68bfa63c4..7897ab1dc 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -84,7 +84,8 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { log.Error(operationID, "upgrade http conn err", err.Error(), query) return } else { - newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.RemoteAddr().String() + strconv.Itoa(int(utils.GetCurrentTimestampBySecond()))} + conn.add + newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.LocalAddr().String() + conn.RemoteAddr().String() + strconv.Itoa(int(utils.GetCurrentTimestampBySecond()))} userCount++ ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], newConn.connID, operationID) go ws.readMsg(newConn) From 233ecf8b5f1f7b4aef0cca63811e08358013726b Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 5 Dec 2022 18:35:34 +0800 Subject: [PATCH 03/13] ws connID --- internal/msg_gateway/gate/ws_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 7897ab1dc..f4a3d7d89 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -85,7 +85,7 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { return } else { conn.add - newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.LocalAddr().String() + conn.RemoteAddr().String() + strconv.Itoa(int(utils.GetCurrentTimestampBySecond()))} + newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.LocalAddr().String() + "_" + conn.RemoteAddr().String() + "_" + strconv.Itoa(int(utils.GetCurrentTimestampBySecond()))} userCount++ ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], newConn.connID, operationID) go ws.readMsg(newConn) From 10ec7e8708bbee4cbb96390adc3e272e9948a694 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 5 Dec 2022 18:36:11 +0800 Subject: [PATCH 04/13] ws connID --- internal/msg_gateway/gate/ws_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index f4a3d7d89..2e338e658 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -85,7 +85,7 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { return } else { conn.add - newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.LocalAddr().String() + "_" + conn.RemoteAddr().String() + "_" + strconv.Itoa(int(utils.GetCurrentTimestampBySecond()))} + newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.LocalAddr().String() + "_" + conn.RemoteAddr().String() + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))} userCount++ ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], newConn.connID, operationID) go ws.readMsg(newConn) From 5d5788e67eccf7400d8423151c86ebc68361776b Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 5 Dec 2022 18:38:24 +0800 Subject: [PATCH 05/13] ws connID --- internal/msg_gateway/gate/ws_server.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 2e338e658..6d16c27b9 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -84,7 +84,6 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { log.Error(operationID, "upgrade http conn err", err.Error(), query) return } else { - conn.add newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.LocalAddr().String() + "_" + conn.RemoteAddr().String() + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))} userCount++ ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], newConn.connID, operationID) From 0a267f69e6c55ca1ce313bd13e6c80f3bc356fd5 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 5 Dec 2022 18:42:53 +0800 Subject: [PATCH 06/13] ws connID --- internal/msg_gateway/gate/ws_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 6d16c27b9..b9fb51cb9 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -84,7 +84,7 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { log.Error(operationID, "upgrade http conn err", err.Error(), query) return } else { - newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.LocalAddr().String() + "_" + conn.RemoteAddr().String() + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))} + newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.RemoteAddr().Network() + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))} userCount++ ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], newConn.connID, operationID) go ws.readMsg(newConn) From 4272955097b23e753342f460d672938cbe3a7306 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 5 Dec 2022 18:44:19 +0800 Subject: [PATCH 07/13] ws connID --- internal/msg_gateway/gate/ws_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index b9fb51cb9..f7283514f 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -84,7 +84,7 @@ func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { log.Error(operationID, "upgrade http conn err", err.Error(), query) return } else { - newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.RemoteAddr().Network() + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))} + newConn := &UserConn{conn, new(sync.Mutex), utils.StringToInt32(query["platformID"][0]), 0, compression, query["sendID"][0], false, query["token"][0], conn.RemoteAddr().String() + "_" + strconv.Itoa(int(utils.GetCurrentTimestampByMill()))} userCount++ ws.addUserConn(query["sendID"][0], utils.StringToInt(query["platformID"][0]), newConn, query["token"][0], newConn.connID, operationID) go ws.readMsg(newConn) From c24b0e1425de0716868f952fc7e33cc34493e782 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 6 Dec 2022 10:37:16 +0800 Subject: [PATCH 08/13] ws connID --- internal/msg_gateway/gate/relay_rpc_server.go | 1 + pkg/proto/relay/relay.pb.go | 148 +++++++++--------- pkg/proto/relay/relay.proto | 1 + 3 files changed, 80 insertions(+), 70 deletions(-) diff --git a/internal/msg_gateway/gate/relay_rpc_server.go b/internal/msg_gateway/gate/relay_rpc_server.go index 90d37a875..1db59e12c 100644 --- a/internal/msg_gateway/gate/relay_rpc_server.go +++ b/internal/msg_gateway/gate/relay_rpc_server.go @@ -159,6 +159,7 @@ func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUser ps := new(pbRelay.GetUsersOnlineStatusResp_SuccessDetail) ps.Platform = constant.PlatformIDToName(platform) ps.Status = constant.OnlineStatus + ps.ConnID = userConn.connID temp.Status = constant.OnlineStatus temp.DetailPlatformStatus = append(temp.DetailPlatformStatus, ps) } diff --git a/pkg/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go index 49ddcc546..696c1a9a9 100644 --- a/pkg/proto/relay/relay.pb.go +++ b/pkg/proto/relay/relay.pb.go @@ -37,7 +37,7 @@ func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} } func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) } func (*OnlinePushMsgReq) ProtoMessage() {} func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{0} + return fileDescriptor_relay_f693b13cb6a37b62, []int{0} } func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b) @@ -89,7 +89,7 @@ func (m *OnlinePushMsgResp) Reset() { *m = OnlinePushMsgResp{} } func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) } func (*OnlinePushMsgResp) ProtoMessage() {} func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{1} + return fileDescriptor_relay_f693b13cb6a37b62, []int{1} } func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b) @@ -129,7 +129,7 @@ func (m *SingelMsgToUserResultList) Reset() { *m = SingelMsgToUserResult func (m *SingelMsgToUserResultList) String() string { return proto.CompactTextString(m) } func (*SingelMsgToUserResultList) ProtoMessage() {} func (*SingelMsgToUserResultList) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{2} + return fileDescriptor_relay_f693b13cb6a37b62, []int{2} } func (m *SingelMsgToUserResultList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingelMsgToUserResultList.Unmarshal(m, b) @@ -183,7 +183,7 @@ func (m *OnlineBatchPushOneMsgReq) Reset() { *m = OnlineBatchPushOneMsgR func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) } func (*OnlineBatchPushOneMsgReq) ProtoMessage() {} func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{3} + return fileDescriptor_relay_f693b13cb6a37b62, []int{3} } func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b) @@ -235,7 +235,7 @@ func (m *OnlineBatchPushOneMsgResp) Reset() { *m = OnlineBatchPushOneMsg func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) } func (*OnlineBatchPushOneMsgResp) ProtoMessage() {} func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{4} + return fileDescriptor_relay_f693b13cb6a37b62, []int{4} } func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b) @@ -275,7 +275,7 @@ func (m *SingleMsgToUserPlatform) Reset() { *m = SingleMsgToUserPlatform func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) } func (*SingleMsgToUserPlatform) ProtoMessage() {} func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{5} + return fileDescriptor_relay_f693b13cb6a37b62, []int{5} } func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b) @@ -329,7 +329,7 @@ func (m *GetUsersOnlineStatusReq) Reset() { *m = GetUsersOnlineStatusReq func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusReq) ProtoMessage() {} func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{6} + return fileDescriptor_relay_f693b13cb6a37b62, []int{6} } func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b) @@ -384,7 +384,7 @@ func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusRe func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp) ProtoMessage() {} func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{7} + return fileDescriptor_relay_f693b13cb6a37b62, []int{7} } func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b) @@ -435,6 +435,7 @@ func (m *GetUsersOnlineStatusResp) GetFailedResult() []*GetUsersOnlineStatusResp type GetUsersOnlineStatusResp_SuccessDetail struct { Platform string `protobuf:"bytes,1,opt,name=platform" json:"platform,omitempty"` Status string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` + ConnID string `protobuf:"bytes,3,opt,name=connID" json:"connID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -446,7 +447,7 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() { func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{7, 0} + return fileDescriptor_relay_f693b13cb6a37b62, []int{7, 0} } func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b) @@ -480,6 +481,13 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) GetStatus() string { return "" } +func (m *GetUsersOnlineStatusResp_SuccessDetail) GetConnID() string { + if m != nil { + return m.ConnID + } + return "" +} + type GetUsersOnlineStatusResp_FailedDetail struct { UserID string `protobuf:"bytes,3,opt,name=userID" json:"userID,omitempty"` ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` @@ -493,7 +501,7 @@ func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersO func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{7, 1} + return fileDescriptor_relay_f693b13cb6a37b62, []int{7, 1} } func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b) @@ -549,7 +557,7 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() { func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{7, 2} + return fileDescriptor_relay_f693b13cb6a37b62, []int{7, 2} } func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b) @@ -603,7 +611,7 @@ func (m *KickUserOfflineReq) Reset() { *m = KickUserOfflineReq{} } func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) } func (*KickUserOfflineReq) ProtoMessage() {} func (*KickUserOfflineReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{8} + return fileDescriptor_relay_f693b13cb6a37b62, []int{8} } func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b) @@ -654,7 +662,7 @@ func (m *KickUserOfflineResp) Reset() { *m = KickUserOfflineResp{} } func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) } func (*KickUserOfflineResp) ProtoMessage() {} func (*KickUserOfflineResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{9} + return fileDescriptor_relay_f693b13cb6a37b62, []int{9} } func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b) @@ -688,7 +696,7 @@ func (m *MultiTerminalLoginCheckReq) Reset() { *m = MultiTerminalLoginCh func (m *MultiTerminalLoginCheckReq) String() string { return proto.CompactTextString(m) } func (*MultiTerminalLoginCheckReq) ProtoMessage() {} func (*MultiTerminalLoginCheckReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{10} + return fileDescriptor_relay_f693b13cb6a37b62, []int{10} } func (m *MultiTerminalLoginCheckReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MultiTerminalLoginCheckReq.Unmarshal(m, b) @@ -748,7 +756,7 @@ func (m *MultiTerminalLoginCheckResp) Reset() { *m = MultiTerminalLoginC func (m *MultiTerminalLoginCheckResp) String() string { return proto.CompactTextString(m) } func (*MultiTerminalLoginCheckResp) ProtoMessage() {} func (*MultiTerminalLoginCheckResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_714521d58943e0d9, []int{11} + return fileDescriptor_relay_f693b13cb6a37b62, []int{11} } func (m *MultiTerminalLoginCheckResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MultiTerminalLoginCheckResp.Unmarshal(m, b) @@ -1037,60 +1045,60 @@ var _Relay_serviceDesc = grpc.ServiceDesc{ Metadata: "relay/relay.proto", } -func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_714521d58943e0d9) } +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_f693b13cb6a37b62) } -var fileDescriptor_relay_714521d58943e0d9 = []byte{ - // 818 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xda, 0x4a, - 0x14, 0x96, 0x03, 0xe4, 0xe7, 0x24, 0xb9, 0x37, 0x99, 0x9b, 0x5c, 0x1c, 0x5f, 0x09, 0x88, 0x17, - 0x57, 0xa8, 0x6a, 0x40, 0xa2, 0xdd, 0x75, 0x97, 0xa0, 0xa4, 0xa8, 0x41, 0x44, 0x43, 0xaa, 0x56, - 0xd9, 0x50, 0x07, 0x06, 0xb0, 0x30, 0xf6, 0x64, 0xc6, 0x4e, 0x94, 0x4d, 0xb7, 0xdd, 0x54, 0x5d, - 0xf4, 0x01, 0xba, 0xe8, 0x4b, 0xf4, 0xf5, 0xaa, 0xf9, 0x81, 0xda, 0x80, 0x43, 0x53, 0x29, 0x9b, - 0x84, 0x73, 0x7c, 0xfe, 0xbe, 0xef, 0x7c, 0x9e, 0x31, 0xec, 0x32, 0xe2, 0x39, 0xf7, 0x55, 0xf9, - 0xb7, 0x42, 0x59, 0x10, 0x06, 0x28, 0x27, 0x0d, 0xab, 0xdc, 0xa2, 0xc4, 0x3f, 0x6a, 0x34, 0x8f, - 0xda, 0x84, 0xdd, 0x12, 0x56, 0xa5, 0xa3, 0x41, 0x55, 0x06, 0x54, 0x79, 0x6f, 0xd4, 0xb9, 0xe3, - 0xd5, 0x3b, 0xae, 0x12, 0xec, 0x2f, 0x06, 0xec, 0xb4, 0x7c, 0xcf, 0xf5, 0xc9, 0x45, 0xc4, 0x87, - 0x4d, 0x3e, 0xc0, 0xe4, 0x06, 0x95, 0x60, 0xb3, 0x45, 0x09, 0x73, 0x42, 0x37, 0xf0, 0x1b, 0x75, - 0xd3, 0x28, 0x19, 0xe5, 0x0d, 0x1c, 0x77, 0xa1, 0x97, 0xb0, 0x36, 0xe6, 0x83, 0xba, 0x13, 0x3a, - 0xe6, 0x4a, 0xc9, 0x28, 0x6f, 0xd6, 0xac, 0x0a, 0x97, 0xad, 0x3a, 0x0e, 0x75, 0x3b, 0xd4, 0x61, - 0xce, 0x98, 0x57, 0x9a, 0x2a, 0x02, 0x4f, 0x42, 0x91, 0x0d, 0x5b, 0x34, 0xe2, 0xc3, 0xcb, 0xe0, - 0x2d, 0x27, 0xac, 0x51, 0x37, 0x33, 0xb2, 0x70, 0xc2, 0x67, 0x9f, 0xc1, 0xee, 0xcc, 0x3c, 0x9c, - 0xa2, 0x1a, 0x64, 0x19, 0xe1, 0xd4, 0x34, 0x4a, 0x99, 0xf2, 0x66, 0xad, 0x50, 0x51, 0x90, 0xdb, - 0xae, 0x3f, 0xf0, 0x48, 0x93, 0x0f, 0x54, 0xf2, 0x85, 0xe7, 0x84, 0xfd, 0x80, 0x8d, 0xb1, 0x8c, - 0xb5, 0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e2, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x95, 0x44, 0xed, 0x71, 0x99, 0x09, - 0x00, 0x00, +var fileDescriptor_relay_f693b13cb6a37b62 = []byte{ + // 827 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x4f, 0xe3, 0x46, + 0x18, 0x96, 0x49, 0xc2, 0xc7, 0x0b, 0xb4, 0x30, 0x85, 0xc6, 0xb8, 0x52, 0x12, 0x7c, 0xa8, 0xa2, + 0xaa, 0x24, 0x52, 0xda, 0x5b, 0x6f, 0x10, 0x41, 0xa3, 0x12, 0x05, 0x4d, 0xa8, 0x5a, 0xb1, 0x87, + 0xac, 0x49, 0x26, 0x89, 0x15, 0xc7, 0x1e, 0x66, 0x6c, 0x10, 0x97, 0xbd, 0xee, 0x65, 0xb5, 0x87, + 0xfd, 0x01, 0x7b, 0xd8, 0x3f, 0xb4, 0x7f, 0x69, 0x35, 0x1f, 0xf1, 0xda, 0x49, 0x4c, 0x96, 0x95, + 0xb8, 0x40, 0xde, 0xc7, 0xef, 0xd7, 0xf3, 0xbc, 0xaf, 0x67, 0x0c, 0xfb, 0x8c, 0x78, 0xce, 0x63, + 0x5d, 0xfe, 0xad, 0x51, 0x16, 0x84, 0x01, 0x2a, 0x48, 0xc3, 0xaa, 0x76, 0x28, 0xf1, 0x4f, 0x5a, + 0xed, 0x93, 0x2e, 0x61, 0xf7, 0x84, 0xd5, 0xe9, 0x64, 0x54, 0x97, 0x0e, 0x75, 0x3e, 0x98, 0xf4, + 0x1e, 0x78, 0xfd, 0x81, 0xab, 0x00, 0xfb, 0xbd, 0x01, 0x7b, 0x1d, 0xdf, 0x73, 0x7d, 0x72, 0x15, + 0xf1, 0x71, 0x9b, 0x8f, 0x30, 0xb9, 0x43, 0x15, 0xd8, 0xee, 0x50, 0xc2, 0x9c, 0xd0, 0x0d, 0xfc, + 0x56, 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d, 0x6a, 0x99, 0xcb, 0x1f, 0x70, 0x8a, 0xfe, 0x83, 0x83, 0x65, 0x4b, 0x80, 0x4a, 0x4f, + 0x6e, 0xc8, 0x9d, 0x55, 0x5e, 0xb1, 0x41, 0xe8, 0x06, 0x0e, 0x97, 0x1e, 0xe7, 0xa8, 0x9c, 0xea, + 0x65, 0xf1, 0x32, 0xb2, 0x2a, 0x4f, 0x3b, 0x70, 0x8a, 0x06, 0x50, 0xee, 0x46, 0x94, 0xb0, 0x0b, + 0x16, 0x44, 0xf4, 0xc5, 0xaa, 0xfc, 0x0d, 0x3f, 0xce, 0xed, 0x17, 0x3a, 0xd2, 0x41, 0x8b, 0x7b, + 0x6f, 0x59, 0x59, 0x8f, 0x38, 0x45, 0xaf, 0xa1, 0x98, 0xb1, 0x03, 0xe8, 0x58, 0x87, 0x65, 0x6f, + 0xac, 0x65, 0xaf, 0x72, 0xe1, 0xf4, 0xf4, 0xf8, 0xa6, 0x2c, 0xbe, 0xb6, 0x7a, 0xad, 0x76, 0xe2, + 0x33, 0x4b, 0x86, 0xfd, 0x45, 0x6f, 0xb1, 0xf8, 0x7f, 0xbb, 0x2e, 0xc1, 0x3f, 0xbe, 0x04, 0x00, + 0x00, 0xff, 0xff, 0x2c, 0x2d, 0xc2, 0x83, 0xb1, 0x09, 0x00, 0x00, } diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index e0ec59e48..0520ba1d6 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -55,6 +55,7 @@ message GetUsersOnlineStatusResp{ message SuccessDetail{ string platform = 1; string status = 2; + string connID = 3; } message FailedDetail{ string userID = 3; From b5a031be9ff40c776115bb7e5737406f7a6c1997 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 6 Dec 2022 12:06:37 +0800 Subject: [PATCH 09/13] log --- pkg/common/constant/constant.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 2a45259c9..03e33301d 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -69,7 +69,7 @@ const ( ConversationOptChangeNotification = 1300 // change conversation opt UserNotificationBegin = 1301 - UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 + UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 UserNotificationEnd = 1399 OANotification = 1400 From d3af2e65470eb0b2e737d0eddca22b1e79c427e6 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 6 Dec 2022 12:51:39 +0800 Subject: [PATCH 10/13] log --- pkg/common/constant/constant.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index 03e33301d..e33b9e4fd 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -69,7 +69,7 @@ const ( ConversationOptChangeNotification = 1300 // change conversation opt UserNotificationBegin = 1301 - UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 + UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 UserNotificationEnd = 1399 OANotification = 1400 From 01b1116017319bb1d4d5f5cf2e0188d726992df7 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 6 Dec 2022 13:06:20 +0800 Subject: [PATCH 11/13] log --- pkg/common/constant/constant.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index e33b9e4fd..54a3e2bc8 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -69,7 +69,7 @@ const ( ConversationOptChangeNotification = 1300 // change conversation opt UserNotificationBegin = 1301 - UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 + UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 UserNotificationEnd = 1399 OANotification = 1400 From 4c9859a1acf181829778edbc707d91bb0f96face Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 6 Dec 2022 14:24:29 +0800 Subject: [PATCH 12/13] ws backgroundStatus --- internal/msg_gateway/gate/relay_rpc_server.go | 1 + pkg/proto/relay/relay.pb.go | 149 ++++++++++-------- pkg/proto/relay/relay.proto | 1 + 3 files changed, 81 insertions(+), 70 deletions(-) diff --git a/internal/msg_gateway/gate/relay_rpc_server.go b/internal/msg_gateway/gate/relay_rpc_server.go index 1db59e12c..00376a552 100644 --- a/internal/msg_gateway/gate/relay_rpc_server.go +++ b/internal/msg_gateway/gate/relay_rpc_server.go @@ -160,6 +160,7 @@ func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUser ps.Platform = constant.PlatformIDToName(platform) ps.Status = constant.OnlineStatus ps.ConnID = userConn.connID + ps.IsBackground = userConn.IsBackground temp.Status = constant.OnlineStatus temp.DetailPlatformStatus = append(temp.DetailPlatformStatus, ps) } diff --git a/pkg/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go index 696c1a9a9..7cf7e019c 100644 --- a/pkg/proto/relay/relay.pb.go +++ b/pkg/proto/relay/relay.pb.go @@ -37,7 +37,7 @@ func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} } func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) } func (*OnlinePushMsgReq) ProtoMessage() {} func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{0} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{0} } func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b) @@ -89,7 +89,7 @@ func (m *OnlinePushMsgResp) Reset() { *m = OnlinePushMsgResp{} } func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) } func (*OnlinePushMsgResp) ProtoMessage() {} func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{1} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{1} } func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b) @@ -129,7 +129,7 @@ func (m *SingelMsgToUserResultList) Reset() { *m = SingelMsgToUserResult func (m *SingelMsgToUserResultList) String() string { return proto.CompactTextString(m) } func (*SingelMsgToUserResultList) ProtoMessage() {} func (*SingelMsgToUserResultList) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{2} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{2} } func (m *SingelMsgToUserResultList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingelMsgToUserResultList.Unmarshal(m, b) @@ -183,7 +183,7 @@ func (m *OnlineBatchPushOneMsgReq) Reset() { *m = OnlineBatchPushOneMsgR func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) } func (*OnlineBatchPushOneMsgReq) ProtoMessage() {} func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{3} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{3} } func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b) @@ -235,7 +235,7 @@ func (m *OnlineBatchPushOneMsgResp) Reset() { *m = OnlineBatchPushOneMsg func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) } func (*OnlineBatchPushOneMsgResp) ProtoMessage() {} func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{4} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{4} } func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b) @@ -275,7 +275,7 @@ func (m *SingleMsgToUserPlatform) Reset() { *m = SingleMsgToUserPlatform func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) } func (*SingleMsgToUserPlatform) ProtoMessage() {} func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{5} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{5} } func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b) @@ -329,7 +329,7 @@ func (m *GetUsersOnlineStatusReq) Reset() { *m = GetUsersOnlineStatusReq func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusReq) ProtoMessage() {} func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{6} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{6} } func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b) @@ -384,7 +384,7 @@ func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusRe func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp) ProtoMessage() {} func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{7} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{7} } func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b) @@ -436,6 +436,7 @@ type GetUsersOnlineStatusResp_SuccessDetail struct { Platform string `protobuf:"bytes,1,opt,name=platform" json:"platform,omitempty"` Status string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` ConnID string `protobuf:"bytes,3,opt,name=connID" json:"connID,omitempty"` + IsBackground bool `protobuf:"varint,4,opt,name=isBackground" json:"isBackground,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -447,7 +448,7 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() { func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{7, 0} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{7, 0} } func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b) @@ -488,6 +489,13 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) GetConnID() string { return "" } +func (m *GetUsersOnlineStatusResp_SuccessDetail) GetIsBackground() bool { + if m != nil { + return m.IsBackground + } + return false +} + type GetUsersOnlineStatusResp_FailedDetail struct { UserID string `protobuf:"bytes,3,opt,name=userID" json:"userID,omitempty"` ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` @@ -501,7 +509,7 @@ func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersO func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {} func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{7, 1} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{7, 1} } func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b) @@ -557,7 +565,7 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() { func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) } func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {} func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{7, 2} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{7, 2} } func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b) @@ -611,7 +619,7 @@ func (m *KickUserOfflineReq) Reset() { *m = KickUserOfflineReq{} } func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) } func (*KickUserOfflineReq) ProtoMessage() {} func (*KickUserOfflineReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{8} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{8} } func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b) @@ -662,7 +670,7 @@ func (m *KickUserOfflineResp) Reset() { *m = KickUserOfflineResp{} } func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) } func (*KickUserOfflineResp) ProtoMessage() {} func (*KickUserOfflineResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{9} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{9} } func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b) @@ -696,7 +704,7 @@ func (m *MultiTerminalLoginCheckReq) Reset() { *m = MultiTerminalLoginCh func (m *MultiTerminalLoginCheckReq) String() string { return proto.CompactTextString(m) } func (*MultiTerminalLoginCheckReq) ProtoMessage() {} func (*MultiTerminalLoginCheckReq) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{10} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{10} } func (m *MultiTerminalLoginCheckReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MultiTerminalLoginCheckReq.Unmarshal(m, b) @@ -756,7 +764,7 @@ func (m *MultiTerminalLoginCheckResp) Reset() { *m = MultiTerminalLoginC func (m *MultiTerminalLoginCheckResp) String() string { return proto.CompactTextString(m) } func (*MultiTerminalLoginCheckResp) ProtoMessage() {} func (*MultiTerminalLoginCheckResp) Descriptor() ([]byte, []int) { - return fileDescriptor_relay_f693b13cb6a37b62, []int{11} + return fileDescriptor_relay_fe7346d2191b0ff8, []int{11} } func (m *MultiTerminalLoginCheckResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MultiTerminalLoginCheckResp.Unmarshal(m, b) @@ -1045,60 +1053,61 @@ var _Relay_serviceDesc = grpc.ServiceDesc{ Metadata: "relay/relay.proto", } -func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_f693b13cb6a37b62) } +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_fe7346d2191b0ff8) } -var fileDescriptor_relay_f693b13cb6a37b62 = []byte{ - // 827 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x4f, 0xe3, 0x46, - 0x18, 0x96, 0x49, 0xc2, 0xc7, 0x0b, 0xb4, 0x30, 0x85, 0xc6, 0xb8, 0x52, 0x12, 0x7c, 0xa8, 0xa2, - 0xaa, 0x24, 0x52, 0xda, 0x5b, 0x6f, 0x10, 0x41, 0xa3, 0x12, 0x05, 0x4d, 0xa8, 0x5a, 0xb1, 0x87, - 0xac, 0x49, 0x26, 0x89, 0x15, 0xc7, 0x1e, 0x66, 0x6c, 0x10, 0x97, 0xbd, 0xee, 0x65, 0xb5, 0x87, - 0xfd, 0x01, 0x7b, 0xd8, 0x3f, 0xb4, 0x7f, 0x69, 0x35, 0x1f, 0xf1, 0xda, 0x49, 0x4c, 0x96,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, 0xb1, 0xf8, 0x7f, 0xbb, 0x2e, 0xc1, 0x3f, 0xbe, 0x04, 0x00, - 0x00, 0xff, 0xff, 0x2c, 0x2d, 0xc2, 0x83, 0xb1, 0x09, 0x00, 0x00, +var fileDescriptor_relay_fe7346d2191b0ff8 = []byte{ + // 844 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x97, 0x37, 0xc9, 0xee, 0xf6, 0xb5, 0x85, 0xee, 0xd0, 0x25, 0xae, 0x91, 0x92, 0xac, 0x0f, + 0x28, 0x42, 0x34, 0x91, 0x02, 0x37, 0x6e, 0xd9, 0x68, 0x4b, 0x44, 0xa3, 0x54, 0x93, 0x45, 0xa0, + 0xbd, 0x04, 0xd7, 0x99, 0x38, 0x56, 0x1c, 0xcf, 0x74, 0xc6, 0x6e, 0xd5, 0x0b, 0x1c, 0xb9, 0x20, + 0x0e, 0x7c, 0x00, 0x0e, 0x7c, 0x45, 0xbe, 0x00, 0x9a, 0x3f, 0x31, 0x76, 0x12, 0x37, 0x14, 0xa9, + 0x97, 0x36, 0xef, 0xe7, 0xf7, 0xef, 0xf7, 0x7b, 0x6f, 0xc6, 0x86, 0x57, 0x9c, 0x44, 0xde, 0x7d, + 0x57, 0xfd, 0xed, 0x30, 0x4e, 0x13, 0x8a, 0x6a, 0xca, 0x70, 0xda, 0x63, 0x46, 0xe2, 0xf3, 0xe1, + 0xe8, 0x7c, 0x42, 0xf8, 0x2d, 0xe1, 0x5d, 0xb6, 0x0c, 0xba, 0xca, 0xa1, 0x2b, 0x66, 0xcb, 0xe9, + 0x9d, 0xe8, 0xde, 0x09, 0x1d, 0xe0, 0xfe, 0x6e, 0xc1, 0xc9, 0x38, 0x8e, 0xc2, 0x98, 0x5c, 0xa5, + 0x62, 0x31, 0x12, 0x01, 0x26, 0x37, 0xa8, 0x05, 0x87, 0x63, 0x46, 0xb8, 0x97, 0x84, 0x34, 0x1e, + 0x0e, 0x6c, 0xab, 0x65, 0xb5, 0x0f, 0x70, 0x1e, 0x42, 0x5f, 0xc3, 0x8b, 0x95, 0x08, 0x06, 0x5e, + 0xe2, 0xd9, 0xcf, 0x5a, 0x56, 0xfb, 0xb0, 0xe7, 0x74, 0x84, 0x2a, 0x35, 0xf5, 0x58, 0x38, 0x65, + 0x1e, 0xf7, 0x56, 0xa2, 0x33, 0xd2, 0x1e, 0x78, 0xed, 0x8a, 0x5c, 0x38, 0x62, 0xa9, 0x58, 0xbc, + 0xa7, 0xdf, 0x0b, 0xc2, 0x87, 0x03, 0xbb, 0xa2, 0x12, 0x17, 0x30, 0xf7, 0x02, 0x5e, 0x6d, 0xf4, + 0x23, 0x18, 0xea, 0x41, 0x95, 0x13, 0xc1, 0x6c, 0xab, 0x55, 0x69, 0x1f, 0xf6, 0x1a, 0x1d, 0x4d, + 0x79, 0x12, 0xc6, 0x41, 0x44, 0x46, 0x22, 0xd0, 0xc1, 0x57, 0x91, 0x97, 0xcc, 0x29, 0x5f, 0x61, + 0xe5, 0xeb, 0xfe, 0x6a, 0xc1, 0x99, 0xf4, 0x20, 0x51, 0xe6, 0x81, 0x89, 0x48, 0xa3, 0xe4, 0x32, + 0x14, 0x09, 0xfa, 0x14, 0x9e, 0xa7, 0xba, 0x09, 0xcd, 0xce, 0x58, 0x59, 0xa5, 0x67, 0xff, 0xbd, + 0x12, 0x6a, 0x00, 0xd0, 0xac, 0x65, 0x45, 0xea, 0x25, 0xce, 0x21, 0xee, 0x9f, 0x16, 0xd8, 0x9a, + 0x53, 0xdf, 0x4b, 0xfc, 0x85, 0xc4, 0xc6, 0x31, 0x79, 0x62, 0xad, 0xbf, 0x80, 0x93, 0xbc, 0xae, + 0x92, 0xb4, 0x5d, 0x69, 0x55, 0xda, 0x07, 0x78, 0x0b, 0x77, 0x43, 0x38, 0x2b, 0xe9, 0x4f, 0x30, + 0x74, 0x09, 0x27, 0x42, 0xd1, 0x97, 0xb8, 0x56, 0xd0, 0xcc, 0xa1, 0x95, 0x53, 0x67, 0xa7, 0xca, + 0x78, 0x2b, 0xd2, 0xbd, 0x87, 0x7a, 0x89, 0x98, 0x52, 0x46, 0xed, 0xf4, 0x96, 0xce, 0x88, 0x12, + 0xa2, 0x82, 0x73, 0x88, 0x1c, 0x19, 0x26, 0xfe, 0xed, 0x70, 0xa0, 0x64, 0x38, 0xc0, 0xc6, 0x42, + 0x9f, 0xc3, 0x47, 0xf2, 0x97, 0xcc, 0xf3, 0x8e, 0xf2, 0x95, 0xd9, 0xab, 0x1a, 0xde, 0x40, 0xdd, + 0x3b, 0xa8, 0x5f, 0x90, 0x44, 0x96, 0x14, 0x9a, 0xed, 0x24, 0xf1, 0x92, 0x54, 0xc8, 0x21, 0x34, + 0x00, 0xd2, 0x7f, 0x65, 0xb2, 0x94, 0x4c, 0x39, 0x44, 0x0e, 0x89, 0xe6, 0x86, 0xa4, 0xeb, 0xe7, + 0x21, 0xe4, 0xc0, 0x4b, 0xca, 0x0a, 0x6b, 0x9d, 0xd9, 0xee, 0xdf, 0x55, 0xb0, 0x77, 0x57, 0x16, + 0x0c, 0xd9, 0xf0, 0x82, 0x70, 0x9e, 0x51, 0xae, 0xe1, 0xb5, 0x29, 0xf9, 0x12, 0xce, 0x47, 0x22, + 0x58, 0xf3, 0xd5, 0x16, 0x9a, 0xc0, 0xb1, 0x48, 0x7d, 0x9f, 0x08, 0x61, 0xa6, 0x51, 0x51, 0xd3, + 0x38, 0x37, 0xd3, 0x28, 0xab, 0xd4, 0x99, 0xe4, 0x83, 0x70, 0x31, 0x07, 0xba, 0x82, 0xa3, 0xb9, + 0x17, 0x46, 0x64, 0x66, 0x72, 0x56, 0x55, 0xce, 0x2f, 0xf7, 0xe5, 0x7c, 0xa7, 0x62, 0x06, 0x24, + 0xf1, 0xc2, 0x08, 0x17, 0x32, 0x38, 0xbf, 0xc0, 0xb1, 0xa9, 0xa8, 0x1f, 0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, 0xde, 0x1f, 0x55, 0xd0, 0x2f, 0x61, 0xd4, 0x87, 0xe3, 0xc2, 0x9b, 0x0c, 0xd5, 0xcd, 0x58, + 0x37, 0xdf, 0xb7, 0x8e, 0xbd, 0xfb, 0x81, 0x60, 0xe8, 0x07, 0x38, 0xdd, 0xb5, 0x04, 0xa8, 0xf1, + 0xe0, 0x86, 0xdc, 0x38, 0xcd, 0x3d, 0x1b, 0x84, 0x3e, 0xc0, 0xeb, 0x9d, 0x57, 0x3e, 0x6a, 0x16, + 0x7a, 0xd9, 0x7e, 0x61, 0x39, 0xad, 0x87, 0x1d, 0x04, 0x43, 0x33, 0x68, 0x4e, 0x52, 0x46, 0xf8, + 0x05, 0xa7, 0x29, 0x7b, 0xb2, 0x2a, 0xdf, 0xc2, 0xc7, 0x1b, 0xfb, 0x85, 0xce, 0x4c, 0xd0, 0xf6, + 0xde, 0x3b, 0x4e, 0xd9, 0x23, 0xc1, 0xd0, 0x4f, 0x50, 0x2f, 0xd9, 0x01, 0xf4, 0xc6, 0x84, 0x95, + 0x6f, 0xac, 0xe3, 0xee, 0x73, 0x11, 0xac, 0xff, 0xe6, 0x43, 0x53, 0x7e, 0x91, 0x4d, 0x87, 0xa3, + 0xdc, 0xa7, 0x98, 0x0a, 0xfb, 0x86, 0x5d, 0x63, 0xf9, 0xff, 0xfa, 0xb9, 0x02, 0xbf, 0xfa, 0x27, + 0x00, 0x00, 0xff, 0xff, 0xcb, 0xed, 0x6a, 0xe8, 0xd5, 0x09, 0x00, 0x00, } diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index 0520ba1d6..ee1c926cf 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -56,6 +56,7 @@ message GetUsersOnlineStatusResp{ string platform = 1; string status = 2; string connID = 3; + bool isBackground = 4; } message FailedDetail{ string userID = 3; From ab176b5b1d2b90e226b05a48e4026085dd3fc379 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 6 Dec 2022 15:42:57 +0800 Subject: [PATCH 13/13] app background --- internal/msg_gateway/gate/callback.go | 15 +++++++-------- internal/msg_gateway/gate/logic.go | 14 +++----------- internal/msg_gateway/gate/ws_server.go | 2 +- pkg/call_back_struct/msg_gateway.go | 13 ++++++------- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/internal/msg_gateway/gate/callback.go b/internal/msg_gateway/gate/callback.go index 139d89afc..20d4837f1 100644 --- a/internal/msg_gateway/gate/callback.go +++ b/internal/msg_gateway/gate/callback.go @@ -9,7 +9,7 @@ import ( "time" ) -func callbackUserOnline(operationID, userID string, platformID int, token string, isAppBackgroundStatusChanged bool, connID string) cbApi.CommonCallbackResp { +func callbackUserOnline(operationID, userID string, platformID int, token string, isAppBackground bool, connID string) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackUserOnline.Enable { return callbackResp @@ -25,9 +25,9 @@ func callbackUserOnline(operationID, userID string, platformID int, token string }, UserID: userID, }, - Seq: int(time.Now().UnixNano() / 1e6), - IsAppBackgroundStatusChanged: isAppBackgroundStatusChanged, - ConnID: connID, + Seq: int(time.Now().UnixNano() / 1e6), + IsAppBackground: isAppBackground, + ConnID: connID, } callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: &callbackResp} if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOnlineCommand, callbackUserOnlineReq, callbackUserOnlineResp, config.Config.Callback.CallbackUserOnline.CallbackTimeOut); err != nil { @@ -37,7 +37,7 @@ func callbackUserOnline(operationID, userID string, platformID int, token string return callbackResp } -func callbackUserOffline(operationID, userID string, platformID int, isAppBackgroundStatusChanged bool, connID string) cbApi.CommonCallbackResp { +func callbackUserOffline(operationID, userID string, platformID int, connID string) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} if !config.Config.Callback.CallbackUserOffline.Enable { return callbackResp @@ -52,9 +52,8 @@ func callbackUserOffline(operationID, userID string, platformID int, isAppBackgr }, UserID: userID, }, - Seq: int(time.Now().UnixNano() / 1e6), - IsAppBackgroundStatusChanged: isAppBackgroundStatusChanged, - ConnID: connID, + Seq: int(time.Now().UnixNano() / 1e6), + ConnID: connID, } callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: &callbackResp} if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOfflineCommand, callbackOfflineReq, callbackUserOfflineResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil { diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index 4c8283b10..f249b9459 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -406,18 +406,10 @@ func (ws *WServer) setUserDeviceBackground(conn *UserConn, m *Req) { if isPass { req := pData.(*sdk_ws.SetAppBackgroundStatusReq) conn.IsBackground = req.IsBackground - if !conn.IsBackground { - callbackResp := callbackUserOnline(m.OperationID, conn.userID, int(conn.PlatformID), conn.token, true, conn.connID) - if callbackResp.ErrCode != 0 { - log.NewError(m.OperationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) - } - } else { - callbackResp := callbackUserOffline(m.OperationID, conn.userID, int(conn.PlatformID), true, conn.connID) - if callbackResp.ErrCode != 0 { - log.NewError(m.OperationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) - } + callbackResp := callbackUserOnline(m.OperationID, conn.userID, int(conn.PlatformID), conn.token, conn.IsBackground, conn.connID) + if callbackResp.ErrCode != 0 { + log.NewError(m.OperationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) } - log.NewInfo(m.OperationID, "SetUserDeviceBackground", "success", *conn, req.IsBackground) } ws.setUserDeviceBackgroundResp(conn, m, errCode, errMsg) diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index f7283514f..0d5869e11 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -388,7 +388,7 @@ func (ws *WServer) delUserConn(conn *UserConn) { if err != nil { log.Error(operationID, " close err", "", "uid", uid, "platform", platform) } - callbackResp := callbackUserOffline(operationID, conn.userID, platform, false, conn.connID) + callbackResp := callbackUserOffline(operationID, conn.userID, platform, conn.connID) if callbackResp.ErrCode != 0 { log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp) } diff --git a/pkg/call_back_struct/msg_gateway.go b/pkg/call_back_struct/msg_gateway.go index 235f63105..65d173829 100644 --- a/pkg/call_back_struct/msg_gateway.go +++ b/pkg/call_back_struct/msg_gateway.go @@ -2,10 +2,10 @@ package call_back_struct type CallbackUserOnlineReq struct { UserStatusCallbackReq - Token string `json:"token"` - Seq int `json:"seq"` - IsAppBackgroundStatusChanged bool `json:"isAppBackgroundStatusChanged"` - ConnID string `json:"connID"` + Token string `json:"token"` + Seq int `json:"seq"` + IsAppBackground bool `json:"isAppBackground"` + ConnID string `json:"connID"` } type CallbackUserOnlineResp struct { @@ -14,9 +14,8 @@ type CallbackUserOnlineResp struct { type CallbackUserOfflineReq struct { UserStatusCallbackReq - Seq int `json:"seq"` - IsAppBackgroundStatusChanged bool `json:"isAppBackgroundStatusChanged"` - ConnID string `json:"connID"` + Seq int `json:"seq"` + ConnID string `json:"connID"` } type CallbackUserOfflineResp struct {