From 33b96859853842576322be00945cdfe2cf2d1d49 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 6 Dec 2021 20:03:59 +0800 Subject: [PATCH 01/47] send message by message receive opt --- internal/rpc/chat/send_msg.go | 56 ++++++++++++++++++++++++++++++----- pkg/utils/map.go | 5 +++- pkg/utils/strings.go | 10 +++++++ 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index 298f3ab65..530db7fd4 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -5,6 +5,7 @@ import ( "Open_IM/internal/push/content_struct" "Open_IM/pkg/common/config" "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" http2 "Open_IM/pkg/common/http" "Open_IM/pkg/common/log" "Open_IM/pkg/grpc-etcdv3/getcdv3" @@ -105,9 +106,17 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (* } switch pbData.SessionType { case constant.SingleChatType: - err1 := rpc.sendMsgToKafka(&pbData, pbData.RecvID) + isSend := modifyMessageByUserMessageReceiveOpt(pbData.RecvID, pbData.SendID, constant.SingleChatType, &pbData) + if isSend { + err1 := rpc.sendMsgToKafka(&pbData, pbData.RecvID) + if err1 != nil { + log.NewError(pbData.OperationID, "kafka send msg err:RecvID", pbData.RecvID, pbData.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } err2 := rpc.sendMsgToKafka(&pbData, pbData.SendID) - if err1 != nil || err2 != nil { + if err2 != nil { + log.NewError(pbData.OperationID, "kafka send msg err:SendID", pbData.SendID, pbData.String()) return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) } return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) @@ -154,16 +163,25 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (* groupID := pbData.RecvID for i, v := range reply.MemberList { pbData.RecvID = v.UserId + " " + groupID - err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i)) - if err != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + isSend := modifyMessageByUserMessageReceiveOpt(v.UserId, groupID, constant.GroupChatType, &pbData) + if isSend { + err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i)) + if err != nil { + log.NewError(pbData.OperationID, "kafka send msg err:UserId", v.UserId, pbData.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } } + } for i, v := range addUidList { pbData.RecvID = v + " " + groupID - err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i+1)) - if err != nil { - return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + isSend := modifyMessageByUserMessageReceiveOpt(v, groupID, constant.GroupChatType, &pbData) + if isSend { + err := rpc.sendMsgToKafka(&pbData, utils.IntToString(i+1)) + if err != nil { + log.NewError(pbData.OperationID, "kafka send msg err:UserId", v, pbData.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } } } return returnMsg(&replay, pb, 0, "", serverMsgID, pbData.SendTime) @@ -193,3 +211,25 @@ func returnMsg(replay *pbChat.UserSendMsgResp, pb *pbChat.UserSendMsgReq, errCod replay.SendTime = sendTime return replay, nil } +func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType int, msg *pbChat.WSToMsgSvrChatMsg) bool { + conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) + opt, err := db.DB.GetConversationMsgOpt(userID, conversationID) + if err != nil { + log.NewError(msg.OperationID, "GetConversationMsgOpt from redis err", msg.String()) + return true + } + switch opt { + case constant.ReceiveMessage: + return true + case constant.NotReceiveMessage: + return false + case constant.ReceiveNotNotifyMessage: + m := utils.JsonStringToMap(msg.OfflineInfo) + utils.SetSwitchFromOptions(m, "offlinePush", 0) + s := utils.MapToJsonString(m) + msg.OfflineInfo = s + return true + } + + return true +} diff --git a/pkg/utils/map.go b/pkg/utils/map.go index 2807805db..48acadc60 100644 --- a/pkg/utils/map.go +++ b/pkg/utils/map.go @@ -116,8 +116,11 @@ func JsonStringToMap(str string) (tempMap map[string]interface{}) { return tempMap } func GetSwitchFromOptions(Options map[string]interface{}, key string) (result bool) { - if flag, ok := Options[key]; !ok || flag == 1 { + if flag, ok := Options[key]; !ok || flag.(int) == 1 { return true } return false } +func SetSwitchFromOptions(Options map[string]interface{}, key string, value interface{}) { + Options[key] = value +} diff --git a/pkg/utils/strings.go b/pkg/utils/strings.go index 4249eee6b..5ee2a6503 100644 --- a/pkg/utils/strings.go +++ b/pkg/utils/strings.go @@ -7,6 +7,7 @@ package utils import ( + "Open_IM/pkg/common/constant" "encoding/json" "math/rand" "strconv" @@ -63,6 +64,15 @@ func GetMsgID(sendID string) string { t := int64ToString(GetCurrentTimestampByNano()) return Md5(t + sendID + int64ToString(rand.Int63n(GetCurrentTimestampByNano()))) } +func GetConversationIDBySessionType(sourceID string, sessionType int) string { + switch sessionType { + case constant.SingleChatType: + return "single_" + sourceID + case constant.GroupChatType: + return "group_" + sourceID + } + return "" +} func int64ToString(i int64) string { return strconv.FormatInt(i, 10) } From d50a0abd2a3336c384b4628de864188078b5f596 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 7 Dec 2021 10:22:49 +0800 Subject: [PATCH 02/47] send message by message receive opt --- internal/rpc/chat/send_msg.go | 4 ++-- pkg/common/db/redisModel.go | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index 530db7fd4..b0e8f663a 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -213,9 +213,9 @@ func returnMsg(replay *pbChat.UserSendMsgResp, pb *pbChat.UserSendMsgReq, errCod } func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType int, msg *pbChat.WSToMsgSvrChatMsg) bool { conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) - opt, err := db.DB.GetConversationMsgOpt(userID, conversationID) + opt, err := db.DB.GetSingleConversationMsgOpt(userID, conversationID) if err != nil { - log.NewError(msg.OperationID, "GetConversationMsgOpt from redis err", msg.String()) + log.NewError(msg.OperationID, "GetSingleConversationMsgOpt from redis err", msg.String()) return true } switch opt { diff --git a/pkg/common/db/redisModel.go b/pkg/common/db/redisModel.go index 362eec15d..3fb8c076a 100644 --- a/pkg/common/db/redisModel.go +++ b/pkg/common/db/redisModel.go @@ -91,12 +91,25 @@ func (d *DataBases) SetTokenMapByUidPid(userID string, platformID int32, m map[s _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) return err } -func (d *DataBases) SetConversationMsgOpt(userID, conversationID string, opt int) error { +func (d *DataBases) SetSingleConversationMsgOpt(userID, conversationID string, opt int) error { key := conversationReceiveMessageOpt + userID _, err1 := d.Exec("HSet", key, conversationID, opt) return err1 } -func (d *DataBases) GetConversationMsgOpt(userID, conversationID string) (int, error) { +func (d *DataBases) GetSingleConversationMsgOpt(userID, conversationID string) (int, error) { key := conversationReceiveMessageOpt + userID return redis.Int(d.Exec("HGet", key, conversationID)) } +func (d *DataBases) GetAllConversationMsgOpt(userID string) (map[string]int, error) { + key := conversationReceiveMessageOpt + userID + return redis.IntMap(d.Exec("HGETALL", key)) +} +func (d *DataBases) SetMultiConversationMsgOpt(userID string, m map[string]int) error { + key := conversationReceiveMessageOpt + userID + _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) + return err +} +func (d *DataBases) GetMultiConversationMsgOpt(userID string, conversationIDs []string) ([]int, error) { + key := conversationReceiveMessageOpt + userID + return redis.Ints(d.Exec("hmget", key, redis.Args{}.Add().AddFlat(conversationIDs)...)) +} From 7da98935b96bd3365bbb83f12f3ac33020eefcc4 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 7 Dec 2021 11:46:24 +0800 Subject: [PATCH 03/47] redis add func --- pkg/common/db/redisModel.go | 13 +++++++++++-- pkg/common/db/redisModel_test.go | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pkg/common/db/redisModel.go b/pkg/common/db/redisModel.go index 3fb8c076a..a9d552699 100644 --- a/pkg/common/db/redisModel.go +++ b/pkg/common/db/redisModel.go @@ -109,7 +109,16 @@ func (d *DataBases) SetMultiConversationMsgOpt(userID string, m map[string]int) _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) return err } -func (d *DataBases) GetMultiConversationMsgOpt(userID string, conversationIDs []string) ([]int, error) { +func (d *DataBases) GetMultiConversationMsgOpt(userID string, conversationIDs []string) (m map[string]int, err error) { + m = make(map[string]int) key := conversationReceiveMessageOpt + userID - return redis.Ints(d.Exec("hmget", key, redis.Args{}.Add().AddFlat(conversationIDs)...)) + i, err := redis.Ints(d.Exec("hmget", key, redis.Args{}.Add().AddFlat(conversationIDs)...)) + if err != nil { + return m, err + } + for k, v := range conversationIDs { + m[v] = i[k] + } + return m, nil + } diff --git a/pkg/common/db/redisModel_test.go b/pkg/common/db/redisModel_test.go index 7da463a5b..1d9d254b7 100644 --- a/pkg/common/db/redisModel_test.go +++ b/pkg/common/db/redisModel_test.go @@ -19,3 +19,9 @@ func Test_GetTokenMapByUidPid(t *testing.T) { assert.Nil(t, err) fmt.Println(m) } + +func TestDataBases_GetMultiConversationMsgOpt(t *testing.T) { + m, err := DB.GetMultiConversationMsgOpt("fg", []string{"user", "age", "color"}) + assert.Nil(t, err) + fmt.Println(m) +} From d6298744682c9813f885ab1c1e541d2411cc8018 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 14:28:07 +0800 Subject: [PATCH 04/47] ReceiveMessageOpt --- cmd/open_im_api/main.go | 15 +- internal/api/conversation/conversation.go | 155 ++++++ internal/push/logic/push_to_client.go | 2 +- pkg/proto/user/user.pb.go | 590 ++++++++++++++++++++-- pkg/proto/user/user.proto | 46 +- 5 files changed, 745 insertions(+), 63 deletions(-) create mode 100644 internal/api/conversation/conversation.go diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 42e0dcabf..0bd70d7e3 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -3,6 +3,7 @@ package main import ( apiAuth "Open_IM/internal/api/auth" apiChat "Open_IM/internal/api/chat" + "Open_IM/internal/api/conversation" "Open_IM/internal/api/friend" "Open_IM/internal/api/group" "Open_IM/internal/api/manage" @@ -17,15 +18,6 @@ import ( ) func main() { - - //logFile, err := os.OpenFile("./fatal.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0660) - // if err != nil { - - // return - // } - //syscall.Dup2(int(logFile.Fd()), int(os.Stderr.Fd())) - - //log.Info("", "", "api server running...") r := gin.Default() r.Use(utils.CorsHandler()) // user routing group, which handles user registration and login services @@ -100,8 +92,9 @@ func main() { //Conversation conversationGroup := r.Group("/conversation") { - conversationGroup.POST("/delete_user", manage.DeleteUser) - + conversationGroup.POST("/set_receive_message_opt", conversation.SetReceiveMessageOpt) + conversationGroup.POST("/get_receive_message_opt", conversation.GetReceiveMessageOpt) + conversationGroup.POST("/get_all_conversation_message_opt", conversation.GetAllConversationMessageOpt) } log.NewPrivateLog("api") diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go new file mode 100644 index 000000000..c73e161c5 --- /dev/null +++ b/internal/api/conversation/conversation.go @@ -0,0 +1,155 @@ +package conversation + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/user" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +type paramsSetReceiveMessageOpt struct { + OperationID string `json:"operationID" binding:"required"` + Option int32 `json:"operationID" binding:"required"` + ConversationIdList []string `json:"conversationIdList" binding:"required"` +} + +type SetReceiveMessageOptResp struct { + ErrCode int32 `json:"errCode"` + ErrMsg string `json:"errMsg"` + Data []*user.OptResult `json:"data"` +} + +type paramGetReceiveMessageOpt struct { + ConversationIdList []string `json:"ConversationIdList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type GetReceiveMessageOptResp struct { + SetReceiveMessageOptResp +} + +type paramGetAllConversationMessageOpt struct { + OperationID string `json:"operationID" binding:"required"` +} + +type GetAllConversationMessageOptResp struct { + SetReceiveMessageOptResp +} + +func GetAllConversationMessageOpt(c *gin.Context) { + params := paramGetAllConversationMessageOpt{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError(params.OperationID, "bind json failed ", err.Error(), c) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + + claims, err := token_verify.ParseToken(c.Request.Header.Get("token")) + if err != nil { + log.NewError(params.OperationID, "ParseToken failed, ", err.Error(), c.Request.Header.Get("token")) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "ParseToken failed, " + err.Error()}) + return + } + + req := &user.GetAllConversationMsgOptReq{ + UId: claims.UID, + OperationID: params.OperationID, + } + log.NewInfo(req.OperationID, "GetAllConversationMsgOpt req: ", req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := user.NewUserClient(etcdConn) + resp, err := client.GetAllConversationMsgOpt(context.Background(), req) + if err != nil { + log.NewError(params.OperationID, "GetAllConversationMsgOpt rpc failed, ", req, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + var ginResp GetAllConversationMessageOptResp + ginResp.ErrCode = resp.ErrCode + ginResp.ErrMsg = resp.ErrMsg + ginResp.Data = resp.ConversationOptResult + log.NewInfo(req.OperationID, "GetAllConversationMsgOpt resp: ", ginResp, req) + c.JSON(http.StatusOK, ginResp) +} + +func GetReceiveMessageOpt(c *gin.Context) { + params := paramGetReceiveMessageOpt{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError(params.OperationID, "bind json failed ", err.Error(), c) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + + claims, err := token_verify.ParseToken(c.Request.Header.Get("token")) + if err != nil { + log.NewError(params.OperationID, "ParseToken failed, ", err.Error(), c.Request.Header.Get("token")) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "ParseToken failed, " + err.Error()}) + return + } + + req := &user.GetReceiveMessageOptReq{ + UId: claims.UID, + ConversationId: params.ConversationIdList, + OperationID: params.OperationID, + } + log.NewInfo(req.OperationID, "GetReceiveMessageOptReq req: ", req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := user.NewUserClient(etcdConn) + resp, err := client.GetReceiveMessageOpt(context.Background(), req) + if err != nil { + log.NewError(params.OperationID, "GetReceiveMessageOpt rpc failed, ", req, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "GetReceiveMessageOpt rpc failed, " + err.Error()}) + return + } + var ginResp GetReceiveMessageOptResp + ginResp.ErrCode = resp.ErrCode + ginResp.ErrMsg = resp.ErrMsg + ginResp.Data = resp.ConversationOptResult + log.NewInfo(req.OperationID, "GetReceiveMessageOpt resp: ", ginResp) + c.JSON(http.StatusOK, ginResp) +} + +func SetReceiveMessageOpt(c *gin.Context) { + params := paramsSetReceiveMessageOpt{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError(params.OperationID, "bind json failed ", err.Error(), c) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + + claims, err := token_verify.ParseToken(c.Request.Header.Get("token")) + if err != nil { + log.NewError(params.OperationID, "ParseToken failed, ", err.Error(), c.Request.Header.Get("token")) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "ParseToken failed, " + err.Error()}) + return + } + + req := &user.SetReceiveMessageOptReq{ + UId: claims.UID, + Opt: params.Option, + ConversationId: params.ConversationIdList, + OperationID: params.OperationID, + } + log.NewInfo(req.OperationID, "SetReceiveMessageOpt req: ", req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := user.NewUserClient(etcdConn) + resp, err := client.SetReceiveMessageOpt(context.Background(), req) + if err != nil { + log.NewError(params.OperationID, "SetReceiveMessageOpt rpc failed, ", req, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "SetReceiveMessageOpt rpc failed, " + err.Error()}) + return + } + + ginResp := SetReceiveMessageOptResp{ + ErrCode: resp.ErrCode, + ErrMsg: resp.ErrMsg, + Data: resp.OptResult, + } + log.NewInfo(req.OperationID, "SetReceiveMessageOpt resp: ", ginResp) + c.JSON(http.StatusOK, ginResp) +} diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index c2d986a59..390ba42c5 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -146,8 +146,8 @@ func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) { default: } - } + func sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string, flag string) { pid, offset, err := producer.SendMessage(m, key) if err != nil { diff --git a/pkg/proto/user/user.pb.go b/pkg/proto/user/user.pb.go index 298512e1b..af16cf75a 100644 --- a/pkg/proto/user/user.pb.go +++ b/pkg/proto/user/user.pb.go @@ -35,7 +35,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{0} + return fileDescriptor_user_2aac409c3ed42d0b, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -81,7 +81,7 @@ func (m *DeleteUsersResp) Reset() { *m = DeleteUsersResp{} } func (m *DeleteUsersResp) String() string { return proto.CompactTextString(m) } func (*DeleteUsersResp) ProtoMessage() {} func (*DeleteUsersResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{1} + return fileDescriptor_user_2aac409c3ed42d0b, []int{1} } func (m *DeleteUsersResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUsersResp.Unmarshal(m, b) @@ -128,7 +128,7 @@ func (m *DeleteUsersReq) Reset() { *m = DeleteUsersReq{} } func (m *DeleteUsersReq) String() string { return proto.CompactTextString(m) } func (*DeleteUsersReq) ProtoMessage() {} func (*DeleteUsersReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{2} + return fileDescriptor_user_2aac409c3ed42d0b, []int{2} } func (m *DeleteUsersReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteUsersReq.Unmarshal(m, b) @@ -181,7 +181,7 @@ func (m *GetAllUsersUidReq) Reset() { *m = GetAllUsersUidReq{} } func (m *GetAllUsersUidReq) String() string { return proto.CompactTextString(m) } func (*GetAllUsersUidReq) ProtoMessage() {} func (*GetAllUsersUidReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{3} + return fileDescriptor_user_2aac409c3ed42d0b, []int{3} } func (m *GetAllUsersUidReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllUsersUidReq.Unmarshal(m, b) @@ -227,7 +227,7 @@ func (m *GetAllUsersUidResp) Reset() { *m = GetAllUsersUidResp{} } func (m *GetAllUsersUidResp) String() string { return proto.CompactTextString(m) } func (*GetAllUsersUidResp) ProtoMessage() {} func (*GetAllUsersUidResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{4} + return fileDescriptor_user_2aac409c3ed42d0b, []int{4} } func (m *GetAllUsersUidResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetAllUsersUidResp.Unmarshal(m, b) @@ -274,7 +274,7 @@ func (m *GetUserInfoReq) Reset() { *m = GetUserInfoReq{} } func (m *GetUserInfoReq) String() string { return proto.CompactTextString(m) } func (*GetUserInfoReq) ProtoMessage() {} func (*GetUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{5} + return fileDescriptor_user_2aac409c3ed42d0b, []int{5} } func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) @@ -328,7 +328,7 @@ func (m *GetUserInfoResp) Reset() { *m = GetUserInfoResp{} } func (m *GetUserInfoResp) String() string { return proto.CompactTextString(m) } func (*GetUserInfoResp) ProtoMessage() {} func (*GetUserInfoResp) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{6} + return fileDescriptor_user_2aac409c3ed42d0b, []int{6} } func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) @@ -387,7 +387,7 @@ func (m *UserInfo) Reset() { *m = UserInfo{} } func (m *UserInfo) String() string { return proto.CompactTextString(m) } func (*UserInfo) ProtoMessage() {} func (*UserInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{7} + return fileDescriptor_user_2aac409c3ed42d0b, []int{7} } func (m *UserInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserInfo.Unmarshal(m, b) @@ -475,7 +475,7 @@ func (m *LogoutReq) Reset() { *m = LogoutReq{} } func (m *LogoutReq) String() string { return proto.CompactTextString(m) } func (*LogoutReq) ProtoMessage() {} func (*LogoutReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{8} + return fileDescriptor_user_2aac409c3ed42d0b, []int{8} } func (m *LogoutReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LogoutReq.Unmarshal(m, b) @@ -529,7 +529,7 @@ func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} } func (m *UpdateUserInfoReq) String() string { return proto.CompactTextString(m) } func (*UpdateUserInfoReq) ProtoMessage() {} func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { - return fileDescriptor_user_23985c8245c722d0, []int{9} + return fileDescriptor_user_2aac409c3ed42d0b, []int{9} } func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) @@ -619,6 +619,376 @@ func (m *UpdateUserInfoReq) GetUid() string { return "" } +type SetReceiveMessageOptReq struct { + UId string `protobuf:"bytes,1,opt,name=uId" json:"uId,omitempty"` + Opt int32 `protobuf:"varint,2,opt,name=opt" json:"opt,omitempty"` + ConversationId []string `protobuf:"bytes,3,rep,name=conversationId" json:"conversationId,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetReceiveMessageOptReq) Reset() { *m = SetReceiveMessageOptReq{} } +func (m *SetReceiveMessageOptReq) String() string { return proto.CompactTextString(m) } +func (*SetReceiveMessageOptReq) ProtoMessage() {} +func (*SetReceiveMessageOptReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_2aac409c3ed42d0b, []int{10} +} +func (m *SetReceiveMessageOptReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetReceiveMessageOptReq.Unmarshal(m, b) +} +func (m *SetReceiveMessageOptReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetReceiveMessageOptReq.Marshal(b, m, deterministic) +} +func (dst *SetReceiveMessageOptReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetReceiveMessageOptReq.Merge(dst, src) +} +func (m *SetReceiveMessageOptReq) XXX_Size() int { + return xxx_messageInfo_SetReceiveMessageOptReq.Size(m) +} +func (m *SetReceiveMessageOptReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetReceiveMessageOptReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetReceiveMessageOptReq proto.InternalMessageInfo + +func (m *SetReceiveMessageOptReq) GetUId() string { + if m != nil { + return m.UId + } + return "" +} + +func (m *SetReceiveMessageOptReq) GetOpt() int32 { + if m != nil { + return m.Opt + } + return 0 +} + +func (m *SetReceiveMessageOptReq) GetConversationId() []string { + if m != nil { + return m.ConversationId + } + return nil +} + +func (m *SetReceiveMessageOptReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetReceiveMessageOptResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + OptResult []*OptResult `protobuf:"bytes,3,rep,name=optResult" json:"optResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetReceiveMessageOptResp) Reset() { *m = SetReceiveMessageOptResp{} } +func (m *SetReceiveMessageOptResp) String() string { return proto.CompactTextString(m) } +func (*SetReceiveMessageOptResp) ProtoMessage() {} +func (*SetReceiveMessageOptResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_2aac409c3ed42d0b, []int{11} +} +func (m *SetReceiveMessageOptResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetReceiveMessageOptResp.Unmarshal(m, b) +} +func (m *SetReceiveMessageOptResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetReceiveMessageOptResp.Marshal(b, m, deterministic) +} +func (dst *SetReceiveMessageOptResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetReceiveMessageOptResp.Merge(dst, src) +} +func (m *SetReceiveMessageOptResp) XXX_Size() int { + return xxx_messageInfo_SetReceiveMessageOptResp.Size(m) +} +func (m *SetReceiveMessageOptResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetReceiveMessageOptResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetReceiveMessageOptResp proto.InternalMessageInfo + +func (m *SetReceiveMessageOptResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *SetReceiveMessageOptResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *SetReceiveMessageOptResp) GetOptResult() []*OptResult { + if m != nil { + return m.OptResult + } + return nil +} + +type GetReceiveMessageOptReq struct { + UId string `protobuf:"bytes,1,opt,name=uId" json:"uId,omitempty"` + ConversationId []string `protobuf:"bytes,2,rep,name=conversationId" json:"conversationId,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetReceiveMessageOptReq) Reset() { *m = GetReceiveMessageOptReq{} } +func (m *GetReceiveMessageOptReq) String() string { return proto.CompactTextString(m) } +func (*GetReceiveMessageOptReq) ProtoMessage() {} +func (*GetReceiveMessageOptReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_2aac409c3ed42d0b, []int{12} +} +func (m *GetReceiveMessageOptReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetReceiveMessageOptReq.Unmarshal(m, b) +} +func (m *GetReceiveMessageOptReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetReceiveMessageOptReq.Marshal(b, m, deterministic) +} +func (dst *GetReceiveMessageOptReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetReceiveMessageOptReq.Merge(dst, src) +} +func (m *GetReceiveMessageOptReq) XXX_Size() int { + return xxx_messageInfo_GetReceiveMessageOptReq.Size(m) +} +func (m *GetReceiveMessageOptReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetReceiveMessageOptReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetReceiveMessageOptReq proto.InternalMessageInfo + +func (m *GetReceiveMessageOptReq) GetUId() string { + if m != nil { + return m.UId + } + return "" +} + +func (m *GetReceiveMessageOptReq) GetConversationId() []string { + if m != nil { + return m.ConversationId + } + return nil +} + +func (m *GetReceiveMessageOptReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type OptResult struct { + ConversationId string `protobuf:"bytes,1,opt,name=conversationId" json:"conversationId,omitempty"` + Result int32 `protobuf:"varint,2,opt,name=result" json:"result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OptResult) Reset() { *m = OptResult{} } +func (m *OptResult) String() string { return proto.CompactTextString(m) } +func (*OptResult) ProtoMessage() {} +func (*OptResult) Descriptor() ([]byte, []int) { + return fileDescriptor_user_2aac409c3ed42d0b, []int{13} +} +func (m *OptResult) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OptResult.Unmarshal(m, b) +} +func (m *OptResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OptResult.Marshal(b, m, deterministic) +} +func (dst *OptResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_OptResult.Merge(dst, src) +} +func (m *OptResult) XXX_Size() int { + return xxx_messageInfo_OptResult.Size(m) +} +func (m *OptResult) XXX_DiscardUnknown() { + xxx_messageInfo_OptResult.DiscardUnknown(m) +} + +var xxx_messageInfo_OptResult proto.InternalMessageInfo + +func (m *OptResult) GetConversationId() string { + if m != nil { + return m.ConversationId + } + return "" +} + +func (m *OptResult) GetResult() int32 { + if m != nil { + return m.Result + } + return 0 +} + +type GetReceiveMessageOptResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + ConversationOptResult []*OptResult `protobuf:"bytes,3,rep,name=conversationOptResult" json:"conversationOptResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetReceiveMessageOptResp) Reset() { *m = GetReceiveMessageOptResp{} } +func (m *GetReceiveMessageOptResp) String() string { return proto.CompactTextString(m) } +func (*GetReceiveMessageOptResp) ProtoMessage() {} +func (*GetReceiveMessageOptResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_2aac409c3ed42d0b, []int{14} +} +func (m *GetReceiveMessageOptResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetReceiveMessageOptResp.Unmarshal(m, b) +} +func (m *GetReceiveMessageOptResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetReceiveMessageOptResp.Marshal(b, m, deterministic) +} +func (dst *GetReceiveMessageOptResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetReceiveMessageOptResp.Merge(dst, src) +} +func (m *GetReceiveMessageOptResp) XXX_Size() int { + return xxx_messageInfo_GetReceiveMessageOptResp.Size(m) +} +func (m *GetReceiveMessageOptResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetReceiveMessageOptResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetReceiveMessageOptResp proto.InternalMessageInfo + +func (m *GetReceiveMessageOptResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetReceiveMessageOptResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetReceiveMessageOptResp) GetConversationOptResult() []*OptResult { + if m != nil { + return m.ConversationOptResult + } + return nil +} + +type GetAllConversationMsgOptReq struct { + UId string `protobuf:"bytes,1,opt,name=uId" json:"uId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAllConversationMsgOptReq) Reset() { *m = GetAllConversationMsgOptReq{} } +func (m *GetAllConversationMsgOptReq) String() string { return proto.CompactTextString(m) } +func (*GetAllConversationMsgOptReq) ProtoMessage() {} +func (*GetAllConversationMsgOptReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_2aac409c3ed42d0b, []int{15} +} +func (m *GetAllConversationMsgOptReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllConversationMsgOptReq.Unmarshal(m, b) +} +func (m *GetAllConversationMsgOptReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllConversationMsgOptReq.Marshal(b, m, deterministic) +} +func (dst *GetAllConversationMsgOptReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllConversationMsgOptReq.Merge(dst, src) +} +func (m *GetAllConversationMsgOptReq) XXX_Size() int { + return xxx_messageInfo_GetAllConversationMsgOptReq.Size(m) +} +func (m *GetAllConversationMsgOptReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllConversationMsgOptReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllConversationMsgOptReq proto.InternalMessageInfo + +func (m *GetAllConversationMsgOptReq) GetUId() string { + if m != nil { + return m.UId + } + return "" +} + +func (m *GetAllConversationMsgOptReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetAllConversationMsgOptResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + ConversationOptResult []*OptResult `protobuf:"bytes,3,rep,name=conversationOptResult" json:"conversationOptResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAllConversationMsgOptResp) Reset() { *m = GetAllConversationMsgOptResp{} } +func (m *GetAllConversationMsgOptResp) String() string { return proto.CompactTextString(m) } +func (*GetAllConversationMsgOptResp) ProtoMessage() {} +func (*GetAllConversationMsgOptResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_2aac409c3ed42d0b, []int{16} +} +func (m *GetAllConversationMsgOptResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllConversationMsgOptResp.Unmarshal(m, b) +} +func (m *GetAllConversationMsgOptResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllConversationMsgOptResp.Marshal(b, m, deterministic) +} +func (dst *GetAllConversationMsgOptResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllConversationMsgOptResp.Merge(dst, src) +} +func (m *GetAllConversationMsgOptResp) XXX_Size() int { + return xxx_messageInfo_GetAllConversationMsgOptResp.Size(m) +} +func (m *GetAllConversationMsgOptResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllConversationMsgOptResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllConversationMsgOptResp proto.InternalMessageInfo + +func (m *GetAllConversationMsgOptResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetAllConversationMsgOptResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetAllConversationMsgOptResp) GetConversationOptResult() []*OptResult { + if m != nil { + return m.ConversationOptResult + } + return nil +} + func init() { proto.RegisterType((*CommonResp)(nil), "user.CommonResp") proto.RegisterType((*DeleteUsersResp)(nil), "user.DeleteUsersResp") @@ -630,6 +1000,13 @@ func init() { proto.RegisterType((*UserInfo)(nil), "user.UserInfo") proto.RegisterType((*LogoutReq)(nil), "user.LogoutReq") proto.RegisterType((*UpdateUserInfoReq)(nil), "user.UpdateUserInfoReq") + proto.RegisterType((*SetReceiveMessageOptReq)(nil), "user.SetReceiveMessageOptReq") + proto.RegisterType((*SetReceiveMessageOptResp)(nil), "user.SetReceiveMessageOptResp") + proto.RegisterType((*GetReceiveMessageOptReq)(nil), "user.GetReceiveMessageOptReq") + proto.RegisterType((*OptResult)(nil), "user.OptResult") + proto.RegisterType((*GetReceiveMessageOptResp)(nil), "user.GetReceiveMessageOptResp") + proto.RegisterType((*GetAllConversationMsgOptReq)(nil), "user.GetAllConversationMsgOptReq") + proto.RegisterType((*GetAllConversationMsgOptResp)(nil), "user.GetAllConversationMsgOptResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -647,6 +1024,9 @@ type UserClient interface { UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*CommonResp, error) DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) GetAllUsersUid(ctx context.Context, in *GetAllUsersUidReq, opts ...grpc.CallOption) (*GetAllUsersUidResp, error) + SetReceiveMessageOpt(ctx context.Context, in *SetReceiveMessageOptReq, opts ...grpc.CallOption) (*SetReceiveMessageOptResp, error) + GetReceiveMessageOpt(ctx context.Context, in *GetReceiveMessageOptReq, opts ...grpc.CallOption) (*GetReceiveMessageOptResp, error) + GetAllConversationMsgOpt(ctx context.Context, in *GetAllConversationMsgOptReq, opts ...grpc.CallOption) (*GetAllConversationMsgOptResp, error) } type userClient struct { @@ -693,6 +1073,33 @@ func (c *userClient) GetAllUsersUid(ctx context.Context, in *GetAllUsersUidReq, return out, nil } +func (c *userClient) SetReceiveMessageOpt(ctx context.Context, in *SetReceiveMessageOptReq, opts ...grpc.CallOption) (*SetReceiveMessageOptResp, error) { + out := new(SetReceiveMessageOptResp) + err := grpc.Invoke(ctx, "/user.user/SetReceiveMessageOpt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetReceiveMessageOpt(ctx context.Context, in *GetReceiveMessageOptReq, opts ...grpc.CallOption) (*GetReceiveMessageOptResp, error) { + out := new(GetReceiveMessageOptResp) + err := grpc.Invoke(ctx, "/user.user/GetReceiveMessageOpt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetAllConversationMsgOpt(ctx context.Context, in *GetAllConversationMsgOptReq, opts ...grpc.CallOption) (*GetAllConversationMsgOptResp, error) { + out := new(GetAllConversationMsgOptResp) + err := grpc.Invoke(ctx, "/user.user/GetAllConversationMsgOpt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for User service type UserServer interface { @@ -700,6 +1107,9 @@ type UserServer interface { UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*CommonResp, error) DeleteUsers(context.Context, *DeleteUsersReq) (*DeleteUsersResp, error) GetAllUsersUid(context.Context, *GetAllUsersUidReq) (*GetAllUsersUidResp, error) + SetReceiveMessageOpt(context.Context, *SetReceiveMessageOptReq) (*SetReceiveMessageOptResp, error) + GetReceiveMessageOpt(context.Context, *GetReceiveMessageOptReq) (*GetReceiveMessageOptResp, error) + GetAllConversationMsgOpt(context.Context, *GetAllConversationMsgOptReq) (*GetAllConversationMsgOptResp, error) } func RegisterUserServer(s *grpc.Server, srv UserServer) { @@ -778,6 +1188,60 @@ func _User_GetAllUsersUid_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _User_SetReceiveMessageOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetReceiveMessageOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).SetReceiveMessageOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/SetReceiveMessageOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).SetReceiveMessageOpt(ctx, req.(*SetReceiveMessageOptReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetReceiveMessageOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReceiveMessageOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetReceiveMessageOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetReceiveMessageOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetReceiveMessageOpt(ctx, req.(*GetReceiveMessageOptReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetAllConversationMsgOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllConversationMsgOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetAllConversationMsgOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetAllConversationMsgOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetAllConversationMsgOpt(ctx, req.(*GetAllConversationMsgOptReq)) + } + return interceptor(ctx, in, info, handler) +} + var _User_serviceDesc = grpc.ServiceDesc{ ServiceName: "user.user", HandlerType: (*UserServer)(nil), @@ -798,49 +1262,75 @@ var _User_serviceDesc = grpc.ServiceDesc{ MethodName: "GetAllUsersUid", Handler: _User_GetAllUsersUid_Handler, }, + { + MethodName: "SetReceiveMessageOpt", + Handler: _User_SetReceiveMessageOpt_Handler, + }, + { + MethodName: "GetReceiveMessageOpt", + Handler: _User_GetReceiveMessageOpt_Handler, + }, + { + MethodName: "GetAllConversationMsgOpt", + Handler: _User_GetAllConversationMsgOpt_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/user.proto", } -func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_23985c8245c722d0) } - -var fileDescriptor_user_23985c8245c722d0 = []byte{ - // 562 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x95, 0xed, 0x24, 0x8d, 0x27, 0x6a, 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, 0x6c, 0x08, 0x36, 0x3e, 0xf2, 0x3e, 0x41, 0x36, 0x3e, 0x7a, 0x4b, 0x70, - 0x6f, 0xd4, 0x56, 0xed, 0xb5, 0x29, 0x44, 0x2d, 0xa5, 0x56, 0x23, 0xa5, 0xed, 0xa5, 0xf0, 0x7e, - 0x5b, 0x70, 0x11, 0x24, 0x22, 0xcc, 0x5b, 0xbe, 0x28, 0x6b, 0x61, 0xcd, 0x2a, 0x59, 0x6b, 0x4b, - 0xc1, 0xc9, 0xae, 0xf3, 0x84, 0xdd, 0x4e, 0xbb, 0xdd, 0x6e, 0xab, 0xdd, 0x5e, 0xd3, 0xee, 0x59, - 0x61, 0xf7, 0x74, 0xff, 0xfe, 0x5f, 0x5a, 0xc9, 0x6d, 0xfa, 0x1e, 0x83, 0x13, 0x48, 0xc1, 0x21, - 0x2f, 0x66, 0x20, 0xc5, 0xe2, 0xa7, 0x0d, 0x34, 0xa1, 0xd8, 0x7b, 0x18, 0x6c, 0x4f, 0x5d, 0xc6, - 0x2e, 0xf3, 0xce, 0xa8, 0xb6, 0xf8, 0xe4, 0x59, 0x0b, 0x9a, 0x25, 0xec, 0x0a, 0x86, 0xd5, 0xbc, - 0xb1, 0x17, 0x87, 0xc6, 0xaa, 0x67, 0x73, 0xd2, 0x78, 0x6e, 0x46, 0xb8, 0x34, 0x67, 0x0a, 0xe1, - 0xea, 0xe8, 0x29, 0x84, 0xeb, 0xb3, 0x6f, 0x49, 0x8f, 0xb0, 0xf4, 0xcc, 0x0b, 0xe1, 0xc6, 0x24, - 0x99, 0xf0, 0xf6, 0x8d, 0x2c, 0xf9, 0x78, 0xfe, 0x75, 0x30, 0xa7, 0x89, 0x7d, 0x65, 0x3e, 0x9b, - 0x1e, 0xcd, 0xed, 0x77, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, 0xbd, 0x59, 0x5b, 0xca, 0x05, - 0x00, 0x00, +func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_2aac409c3ed42d0b) } + +var fileDescriptor_user_2aac409c3ed42d0b = []byte{ + // 796 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcb, 0x6e, 0xdb, 0x3a, + 0x10, 0x85, 0xfc, 0x8a, 0x35, 0x46, 0xec, 0x84, 0xc8, 0x83, 0xf0, 0xcd, 0x0d, 0x7c, 0x89, 0x8b, + 0xc2, 0x9b, 0xa6, 0x45, 0xba, 0x6b, 0x56, 0xad, 0xdd, 0x1a, 0x46, 0x12, 0x18, 0x55, 0xe1, 0x4d, + 0x57, 0x55, 0xac, 0x89, 0x23, 0xd4, 0x16, 0x55, 0x49, 0x0e, 0x02, 0xf4, 0x03, 0xba, 0x2e, 0xba, + 0xe8, 0x6f, 0xf4, 0xd7, 0xfa, 0x07, 0x05, 0x49, 0xcb, 0xa2, 0x1e, 0x76, 0x82, 0xb6, 0x40, 0x37, + 0x02, 0xe7, 0x90, 0x3c, 0xc3, 0x33, 0x33, 0xe4, 0x08, 0x5a, 0x8b, 0x10, 0x83, 0x27, 0xe2, 0x73, + 0xe2, 0x07, 0x3c, 0xe2, 0xa4, 0x22, 0xc6, 0xec, 0x35, 0x40, 0x8f, 0xcf, 0xe7, 0xdc, 0xb3, 0x30, + 0xf4, 0xc9, 0x11, 0x98, 0x18, 0x04, 0x3c, 0xe8, 0x71, 0x07, 0xa9, 0xd1, 0x31, 0xba, 0x55, 0x2b, + 0x01, 0x48, 0x1b, 0xea, 0xd2, 0xb8, 0x0c, 0xa7, 0xb4, 0xd4, 0x31, 0xba, 0xa6, 0xb5, 0xb2, 0x99, + 0x0b, 0xad, 0x3e, 0xce, 0x30, 0xc2, 0x71, 0x88, 0x41, 0x28, 0xc9, 0x9e, 0x02, 0x4c, 0x56, 0xd4, + 0x92, 0xad, 0x71, 0xba, 0x73, 0x22, 0x4f, 0x90, 0xb8, 0xb4, 0xb4, 0x35, 0xe4, 0x7f,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9e, 0x08, 0x7d, 0x32, 0x86, 0xbd, 0xa2, 0x6b, 0x4c, 0xfe, 0x55, 0x3b, 0xd6, 0xbc, 0x35, 0xed, + 0xe3, 0x4d, 0xd3, 0x8a, 0x76, 0xb0, 0x81, 0x76, 0xb0, 0x99, 0x76, 0xed, 0xb5, 0xb0, 0xe5, 0x95, + 0x29, 0xac, 0x24, 0xf2, 0x9f, 0xae, 0xb1, 0xb0, 0x7a, 0xdb, 0xec, 0xbe, 0x25, 0xa1, 0xff, 0x72, + 0xfb, 0x5d, 0xe3, 0x44, 0xfe, 0x10, 0x9e, 0x89, 0xcf, 0x55, 0x4d, 0xfe, 0x16, 0x3e, 0xfb, 0x19, + 0x00, 0x00, 0xff, 0xff, 0xac, 0xcf, 0xd3, 0x1b, 0x29, 0x0a, 0x00, 0x00, } diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index 883ab5d73..2e9c98e39 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -65,11 +65,55 @@ message UpdateUserInfoReq{ string Uid = 10; } +message SetReceiveMessageOptReq{ + string uId = 1; + int32 opt = 2; + repeated string conversationId = 3; + string operationID = 4; +} + +message SetReceiveMessageOptResp{ + int32 errCode = 1; + string errMsg = 2; + repeated OptResult optResult = 3; +} + + +message GetReceiveMessageOptReq{ + string uId = 1; + repeated string conversationId = 2; + string operationID = 3; +} + +message OptResult{ + string conversationId = 1; + int32 result = 2; //-1: failed; 0:default; 1: not receive ; 2: not jpush +} + +message GetReceiveMessageOptResp{ + int32 errCode = 1; + string errMsg = 2; + repeated OptResult conversationOptResult = 3; +} + +message GetAllConversationMsgOptReq{ + string uId = 1; + string operationID = 2; +} + +message GetAllConversationMsgOptResp{ + int32 errCode = 1; + string errMsg = 2; + repeated OptResult conversationOptResult = 3; +} + service user { rpc getUserInfo(GetUserInfoReq) returns(GetUserInfoResp); rpc UpdateUserInfo(UpdateUserInfoReq) returns(CommonResp); rpc DeleteUsers(DeleteUsersReq)returns(DeleteUsersResp); rpc GetAllUsersUid(GetAllUsersUidReq)returns(GetAllUsersUidResp); - + rpc SetReceiveMessageOpt(SetReceiveMessageOptReq)returns(SetReceiveMessageOptResp); + rpc GetReceiveMessageOpt(GetReceiveMessageOptReq)returns(GetReceiveMessageOptResp); + rpc GetAllConversationMsgOpt(GetAllConversationMsgOptReq)returns(GetAllConversationMsgOptResp); } From e4e5608c8c6c78afded9400672e9ed4b8d3b3d4c Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 14:34:41 +0800 Subject: [PATCH 05/47] ReceiveMessageOpt --- internal/rpc/user/conversation.go | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 internal/rpc/user/conversation.go diff --git a/internal/rpc/user/conversation.go b/internal/rpc/user/conversation.go new file mode 100644 index 000000000..1f87c1cd4 --- /dev/null +++ b/internal/rpc/user/conversation.go @@ -0,0 +1,59 @@ +package user + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + pbUser "Open_IM/pkg/proto/user" + "context" +) + +func (s *userServer) SetReceiveMessageOpt(ctx context.Context, req *pbUser.SetReceiveMessageOptReq) (*pbUser.SetReceiveMessageOptResp, error) { + m := make(map[string]int, len(req.ConversationId)) + for _, v := range req.ConversationId { + m[v] = int(req.Opt) + } + err := db.DB.SetMultiConversationMsgOpt(req.UId, m) + if err != nil { + log.NewError(req.OperationID, "SetMultiConversationMsgOpt failed ", err.Error(), req) + return &pbUser.SetReceiveMessageOptResp{ErrCode: constant.DatabaseError, ErrMsg: err.Error()}, nil + } + var resp pbUser.SetReceiveMessageOptResp + resp.ErrCode = 0 + + for _, v := range req.ConversationId { + resp.OptResult = append(resp.OptResult, &pbUser.OptResult{ConversationId: v, Result: 0}) + } + log.NewInfo(req.OperationID, "SetReceiveMessageOpt req, resp ", req, resp) + return &resp, nil +} + +func (s *userServer) GetReceiveMessageOpt(ctx context.Context, req *pbUser.GetReceiveMessageOptReq) (*pbUser.GetReceiveMessageOptResp, error) { + m, err := db.DB.GetMultiConversationMsgOpt(req.UId, req.ConversationId) + if err != nil { + log.NewError(req.OperationID, "GetMultiConversationMsgOpt failed ", err.Error(), req) + return &pbUser.GetReceiveMessageOptResp{ErrCode: constant.DatabaseError, ErrMsg: err.Error()}, nil + } + var resp pbUser.GetReceiveMessageOptResp + resp.ErrCode = 0 + for k, v := range m { + resp.ConversationOptResult = append(resp.ConversationOptResult, &pbUser.OptResult{ConversationId: k, Result: int32(v)}) + } + log.NewInfo(req.OperationID, "GetReceiveMessageOpt, req, resp", req, resp) + return &resp, nil +} + +func (s *userServer) GetAllConversationMsgOpt(ctx context.Context, req *pbUser.GetAllConversationMsgOptReq) (*pbUser.GetAllConversationMsgOptResp, error) { + m, err := db.DB.GetAllConversationMsgOpt(req.UId) + if err != nil { + log.NewError(req.OperationID, "GetAllConversationMsgOpt failed ", err.Error(), req) + return &pbUser.GetAllConversationMsgOptResp{ErrCode: constant.DatabaseError, ErrMsg: err.Error()}, nil + } + var resp pbUser.GetAllConversationMsgOptResp + resp.ErrCode = 0 + for k, v := range m { + resp.ConversationOptResult = append(resp.ConversationOptResult, &pbUser.OptResult{ConversationId: k, Result: int32(v)}) + } + log.NewInfo(req.OperationID, "GetAllConversationMsgOpt, req, resp", req, resp) + return &resp, nil +} From 52498bf05e2a82b95756f5f1830b9ab1e5a19509 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 14:39:56 +0800 Subject: [PATCH 06/47] ReceiveMessageOpt --- internal/api/conversation/conversation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index c73e161c5..4046f611c 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -14,7 +14,7 @@ import ( type paramsSetReceiveMessageOpt struct { OperationID string `json:"operationID" binding:"required"` - Option int32 `json:"operationID" binding:"required"` + Option int32 `json:"option" binding:"required"` ConversationIdList []string `json:"conversationIdList" binding:"required"` } From 9dbad9ce53777bb2af242bb424edba0d16d525b8 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 15:44:12 +0800 Subject: [PATCH 07/47] ReceiveMessageOpt --- internal/api/conversation/conversation.go | 46 ++++++++++++++++--- pkg/utils/utils.go | 55 +++++++++++++++++++++++ 2 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 pkg/utils/utils.go diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 4046f611c..41d82474a 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -6,6 +6,7 @@ import ( "Open_IM/pkg/common/token_verify" "Open_IM/pkg/grpc-etcdv3/getcdv3" "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" "context" "github.com/gin-gonic/gin" "net/http" @@ -18,10 +19,15 @@ type paramsSetReceiveMessageOpt struct { ConversationIdList []string `json:"conversationIdList" binding:"required"` } +type OptResult struct { + ConversationId string `json:"conversationId" binding:"required"` + Result int32 `json:"result" binding:"required"` +} + type SetReceiveMessageOptResp struct { - ErrCode int32 `json:"errCode"` - ErrMsg string `json:"errMsg"` - Data []*user.OptResult `json:"data"` + ErrCode int32 `json:"errCode"` + ErrMsg string `json:"errMsg"` + Data []OptResult `json:"data"` } type paramGetReceiveMessageOpt struct { @@ -41,6 +47,8 @@ type GetAllConversationMessageOptResp struct { SetReceiveMessageOptResp } +//CopyStructFields + func GetAllConversationMessageOpt(c *gin.Context) { params := paramGetAllConversationMessageOpt{} if err := c.BindJSON(¶ms); err != nil { @@ -72,7 +80,15 @@ func GetAllConversationMessageOpt(c *gin.Context) { var ginResp GetAllConversationMessageOptResp ginResp.ErrCode = resp.ErrCode ginResp.ErrMsg = resp.ErrMsg - ginResp.Data = resp.ConversationOptResult + for _, v := range resp.ConversationOptResult { + var opt OptResult + err := utils.CopyStructFields(&opt, v) + if err != nil { + log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) + continue + } + ginResp.Data = append(ginResp.Data, opt) + } log.NewInfo(req.OperationID, "GetAllConversationMsgOpt resp: ", ginResp, req) c.JSON(http.StatusOK, ginResp) } @@ -109,7 +125,16 @@ func GetReceiveMessageOpt(c *gin.Context) { var ginResp GetReceiveMessageOptResp ginResp.ErrCode = resp.ErrCode ginResp.ErrMsg = resp.ErrMsg - ginResp.Data = resp.ConversationOptResult + + for _, v := range resp.ConversationOptResult { + var opt OptResult + err := utils.CopyStructFields(&opt, v) + if err != nil { + log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) + continue + } + ginResp.Data = append(ginResp.Data, opt) + } log.NewInfo(req.OperationID, "GetReceiveMessageOpt resp: ", ginResp) c.JSON(http.StatusOK, ginResp) } @@ -148,7 +173,16 @@ func SetReceiveMessageOpt(c *gin.Context) { ginResp := SetReceiveMessageOptResp{ ErrCode: resp.ErrCode, ErrMsg: resp.ErrMsg, - Data: resp.OptResult, + } + + for _, v := range resp.OptResult { + var opt OptResult + err := utils.CopyStructFields(&opt, v) + if err != nil { + log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) + continue + } + ginResp.Data = append(ginResp.Data, opt) } log.NewInfo(req.OperationID, "SetReceiveMessageOpt resp: ", ginResp) c.JSON(http.StatusOK, ginResp) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go new file mode 100644 index 000000000..5f6e9a6ca --- /dev/null +++ b/pkg/utils/utils.go @@ -0,0 +1,55 @@ +package utils + +import ( + "fmt" + "reflect" +) + +// copy a by b b->a +func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error) { + at := reflect.TypeOf(a) + av := reflect.ValueOf(a) + bt := reflect.TypeOf(b) + bv := reflect.ValueOf(b) + + if at.Kind() != reflect.Ptr { + err = fmt.Errorf("a must be a struct pointer") + return err + } + av = reflect.ValueOf(av.Interface()) + + _fields := make([]string, 0) + if len(fields) > 0 { + _fields = fields + } else { + for i := 0; i < bv.NumField(); i++ { + _fields = append(_fields, bt.Field(i).Name) + } + } + + if len(_fields) == 0 { + err = fmt.Errorf("no fields to copy") + return err + } + + for i := 0; i < len(_fields); i++ { + name := _fields[i] + f := av.Elem().FieldByName(name) + bValue := bv.FieldByName(name) + + if f.IsValid() && f.Kind() == bValue.Kind() { + f.Set(bValue) + } + } + return nil +} + +type S1 struct { + Name string + Age int +} + +type S2 struct { + Name string + Age int32 +} From 2adbf9f686777460425080668dfa5ac49c5b5b41 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 15:56:33 +0800 Subject: [PATCH 08/47] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 41d82474a..f08b1103b 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -128,7 +128,9 @@ func GetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.ConversationOptResult { var opt OptResult + log.NewDebug("CopyStructFields begin ", v, req.OperationID) err := utils.CopyStructFields(&opt, v) + log.NewDebug("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) continue From 5dd494d9a2e55a315cfa6504368c7175f11e4810 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:01:48 +0800 Subject: [PATCH 09/47] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index f08b1103b..f1e1fd05a 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -128,9 +128,9 @@ func GetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.ConversationOptResult { var opt OptResult - log.NewDebug("CopyStructFields begin ", v, req.OperationID) + log.NewInfo("CopyStructFields begin ", v, req.OperationID) err := utils.CopyStructFields(&opt, v) - log.NewDebug("CopyStructFields end ", v, req.OperationID) + log.NewInfo("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) continue From 19489afefc0e22c60f8575d87ce20de49976ab44 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:07:56 +0800 Subject: [PATCH 10/47] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index f1e1fd05a..3840ee987 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -122,6 +122,7 @@ func GetReceiveMessageOpt(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "GetReceiveMessageOpt rpc failed, " + err.Error()}) return } + log.NewInfo(req.OperationID, "GetReceiveMessageOptReq req: ", req, resp) var ginResp GetReceiveMessageOptResp ginResp.ErrCode = resp.ErrCode ginResp.ErrMsg = resp.ErrMsg @@ -171,7 +172,7 @@ func SetReceiveMessageOpt(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "SetReceiveMessageOpt rpc failed, " + err.Error()}) return } - + log.NewInfo(req.OperationID, "SetReceiveMessageOpt req: ", req, resp) ginResp := SetReceiveMessageOptResp{ ErrCode: resp.ErrCode, ErrMsg: resp.ErrMsg, From 31212d4f4b39a68c871d3853c26e0ed3a1b97007 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:10:49 +0800 Subject: [PATCH 11/47] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 3840ee987..b8c96fc28 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -180,7 +180,9 @@ func SetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.OptResult { var opt OptResult + log.NewDebug("CopyStructFields begin ", v, req.OperationID) err := utils.CopyStructFields(&opt, v) + log.NewDebug("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) continue From 053792e89da7d6199616f71dd2ff9f5887f0b7b6 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:12:55 +0800 Subject: [PATCH 12/47] ReceiveMessageOpt debug log --- internal/api/conversation/conversation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index b8c96fc28..4d0330f77 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -181,7 +181,7 @@ func SetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.OptResult { var opt OptResult log.NewDebug("CopyStructFields begin ", v, req.OperationID) - err := utils.CopyStructFields(&opt, v) + err := utils.CopyStructFields(&opt, *v, "ConversationId", "Result") log.NewDebug("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) From 570c0cb9a1ec7cab4111ff02bc8e88bf37b9bf15 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 7 Dec 2021 16:13:11 +0800 Subject: [PATCH 13/47] remove log --- cmd/open_im_timer_task/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/open_im_timer_task/main.go b/cmd/open_im_timer_task/main.go index d5cf8150c..56fd6a4c0 100644 --- a/cmd/open_im_timer_task/main.go +++ b/cmd/open_im_timer_task/main.go @@ -42,17 +42,17 @@ func main() { for { uidList, err := im_mysql_model.SelectAllUID() if err != nil { - log.NewError("999999", err.Error()) + //log.NewError("999999", err.Error()) } else { for _, v := range uidList { minSeq, err := commonDB.DB.GetMinSeqFromMongo(v) if err != nil { - log.NewError("999999", "get user minSeq err", err.Error(), v) + //log.NewError("999999", "get user minSeq err", err.Error(), v) continue } else { err := commonDB.DB.SetUserMinSeq(v, minSeq) if err != nil { - log.NewError("999999", "set user minSeq err", err.Error(), v) + //log.NewError("999999", "set user minSeq err", err.Error(), v) } } time.Sleep(time.Duration(100) * time.Millisecond) From d7028f22e20a24e42418aae528e518c9bfa57500 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Tue, 7 Dec 2021 16:15:21 +0800 Subject: [PATCH 14/47] fix bug --- internal/api/conversation/conversation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 4d0330f77..718af6f9f 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -82,7 +82,7 @@ func GetAllConversationMessageOpt(c *gin.Context) { ginResp.ErrMsg = resp.ErrMsg for _, v := range resp.ConversationOptResult { var opt OptResult - err := utils.CopyStructFields(&opt, v) + err := utils.CopyStructFields(&opt, *v, "ConversationId", "Result") if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) continue @@ -130,7 +130,7 @@ func GetReceiveMessageOpt(c *gin.Context) { for _, v := range resp.ConversationOptResult { var opt OptResult log.NewInfo("CopyStructFields begin ", v, req.OperationID) - err := utils.CopyStructFields(&opt, v) + err := utils.CopyStructFields(&opt, *v, "ConversationId", "Result") log.NewInfo("CopyStructFields end ", v, req.OperationID) if err != nil { log.NewError(req.OperationID, "CopyStructFields failed ", err.Error()) From 5b026e13f6ef58366d31ea0fdf4cf11b093b5f7a Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 10:42:04 +0800 Subject: [PATCH 15/47] conversation update --- internal/api/conversation/conversation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 718af6f9f..c1e42daf8 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -31,7 +31,7 @@ type SetReceiveMessageOptResp struct { } type paramGetReceiveMessageOpt struct { - ConversationIdList []string `json:"ConversationIdList" binding:"required"` + ConversationIdList []string `json:"conversationIdList" binding:"required"` OperationID string `json:"operationID" binding:"required"` } From c9a48081fdb13df59d76422cffffcec139e9a25a Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 12:24:55 +0800 Subject: [PATCH 16/47] conversation update --- internal/api/conversation/conversation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index c1e42daf8..810e157db 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -15,7 +15,7 @@ import ( type paramsSetReceiveMessageOpt struct { OperationID string `json:"operationID" binding:"required"` - Option int32 `json:"option" binding:"required"` + Option int32 `json:"option"` ConversationIdList []string `json:"conversationIdList" binding:"required"` } From a090e602b321cfdd036bb5a587ef2136cc53f0bc Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 12:30:17 +0800 Subject: [PATCH 17/47] conversation update --- internal/api/conversation/conversation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go index 810e157db..4e4316b05 100644 --- a/internal/api/conversation/conversation.go +++ b/internal/api/conversation/conversation.go @@ -15,7 +15,7 @@ import ( type paramsSetReceiveMessageOpt struct { OperationID string `json:"operationID" binding:"required"` - Option int32 `json:"option"` + Option *int32 `json:"option" binding:"required"` ConversationIdList []string `json:"conversationIdList" binding:"required"` } @@ -159,7 +159,7 @@ func SetReceiveMessageOpt(c *gin.Context) { req := &user.SetReceiveMessageOptReq{ UId: claims.UID, - Opt: params.Option, + Opt: *params.Option, ConversationId: params.ConversationIdList, OperationID: params.OperationID, } From 93ffbe2a7938c11a01ceea1c2ff21e662e21a528 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 8 Dec 2021 14:49:47 +0800 Subject: [PATCH 18/47] demo log --- internal/demo/register/verify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/demo/register/verify.go b/internal/demo/register/verify.go index c60b17c70..fc04a1b85 100644 --- a/internal/demo/register/verify.go +++ b/internal/demo/register/verify.go @@ -42,7 +42,7 @@ func Verify(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verified successfully!", "data": data}) return } - + log.NewInfo("0", "params.VerificationCode != config.Config.Demo.SuperCode", params.VerificationCode, config.Config.Demo) log.InfoByKv("begin get form redis", account) v, err := redis.String(db.DB.Exec("GET", account)) log.InfoByKv("redis phone number and verificating Code", account, v) From 1f40c87dd98f72b3bb74bbbaa03402328ebb3fa2 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 8 Dec 2021 14:56:09 +0800 Subject: [PATCH 19/47] demo log --- internal/demo/register/verify.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/demo/register/verify.go b/internal/demo/register/verify.go index fc04a1b85..b52da8216 100644 --- a/internal/demo/register/verify.go +++ b/internal/demo/register/verify.go @@ -26,6 +26,7 @@ func Verify(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) return } + log.NewInfo("recv req: ", params) var account string if params.Email != "" { @@ -42,7 +43,7 @@ func Verify(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verified successfully!", "data": data}) return } - log.NewInfo("0", "params.VerificationCode != config.Config.Demo.SuperCode", params.VerificationCode, config.Config.Demo) + log.NewInfo("0", " params.VerificationCode != config.Config.Demo.SuperCode", params.VerificationCode, config.Config.Demo) log.InfoByKv("begin get form redis", account) v, err := redis.String(db.DB.Exec("GET", account)) log.InfoByKv("redis phone number and verificating Code", account, v) From 687933a63ed87deefebc9e8144588c3c1879a7f5 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 17:23:26 +0800 Subject: [PATCH 20/47] conversation update --- pkg/utils/map.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/map.go b/pkg/utils/map.go index 48acadc60..f2c2d07b5 100644 --- a/pkg/utils/map.go +++ b/pkg/utils/map.go @@ -116,7 +116,7 @@ func JsonStringToMap(str string) (tempMap map[string]interface{}) { return tempMap } func GetSwitchFromOptions(Options map[string]interface{}, key string) (result bool) { - if flag, ok := Options[key]; !ok || flag.(int) == 1 { + if flag, ok := Options[key]; !ok || flag.(float64) == 1 { return true } return false From ebd867a6d5d32db9769f676f744bdc7b75e906bf Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 17:44:16 +0800 Subject: [PATCH 21/47] conversation update --- internal/api/chat/get_max_min_seq.go | 3 ++- internal/api/chat/pull_msg.go | 3 ++- internal/api/chat/send_msg.go | 7 ++++++- internal/rpc/chat/send_msg.go | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/api/chat/get_max_min_seq.go b/internal/api/chat/get_max_min_seq.go index 7103cae4a..984497c18 100644 --- a/internal/api/chat/get_max_min_seq.go +++ b/internal/api/chat/get_max_min_seq.go @@ -42,7 +42,8 @@ func UserGetSeq(c *gin.Context) { msgClient := pbMsg.NewChatClient(grpcConn) reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) if err != nil { - log.ErrorByKv("rpc call failed to getNewSeq", pbData.OperationID, "err", err, "pbData", pbData.String()) + log.NewError(params.OperationID, "UserGetSeq rpc failed, ", params, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "UserGetSeq rpc failed, " + err.Error()}) return } diff --git a/internal/api/chat/pull_msg.go b/internal/api/chat/pull_msg.go index 46b568284..c0fa578e9 100644 --- a/internal/api/chat/pull_msg.go +++ b/internal/api/chat/pull_msg.go @@ -43,7 +43,8 @@ func UserPullMsg(c *gin.Context) { msgClient := pbChat.NewChatClient(grpcConn) reply, err := msgClient.PullMessage(context.Background(), &pbData) if err != nil { - log.ErrorByKv("PullMessage error", pbData.OperationID, "err", err.Error()) + log.NewError(params.OperationID, "UserPullMsg rpc failed, ", params, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "UserPullMsg rpc failed, " + err.Error()}) return } log.InfoByKv("rpc call success to pullMsgRep", pbData.OperationID, "ReplyArgs", reply.String(), "maxSeq", reply.GetMaxSeq(), diff --git a/internal/api/chat/send_msg.go b/internal/api/chat/send_msg.go index 6d7294109..4d53bf769 100644 --- a/internal/api/chat/send_msg.go +++ b/internal/api/chat/send_msg.go @@ -77,7 +77,12 @@ func UserSendMsg(c *gin.Context) { log.Info("", "", "api UserSendMsg call, api call rpc...") - reply, _ := client.UserSendMsg(context.Background(), pbData) + reply, err := client.UserSendMsg(context.Background(), pbData) + if err != nil { + log.NewError(params.OperationID, "UserSendMsg rpc failed, ", params, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "UserSendMsg rpc failed, " + err.Error()}) + return + } log.Info("", "", "api UserSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) c.JSON(http.StatusOK, gin.H{ diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index b0e8f663a..42d83e1a7 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -224,7 +224,7 @@ func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType i case constant.NotReceiveMessage: return false case constant.ReceiveNotNotifyMessage: - m := utils.JsonStringToMap(msg.OfflineInfo) + m := utils.JsonStringToMap(msg.Options) utils.SetSwitchFromOptions(m, "offlinePush", 0) s := utils.MapToJsonString(m) msg.OfflineInfo = s From 058a191e6150bc205684efa246ec83ab548b69e2 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 18:08:48 +0800 Subject: [PATCH 22/47] rpc protocol update --- pkg/proto/chat/chat.proto | 6 +-- pkg/proto/push/push.pb.go | 106 ++++++++++++++++++++------------------ pkg/proto/push/push.proto | 2 +- 3 files changed, 59 insertions(+), 55 deletions(-) diff --git a/pkg/proto/chat/chat.proto b/pkg/proto/chat/chat.proto index 3c66c99dc..f65b1de73 100644 --- a/pkg/proto/chat/chat.proto +++ b/pkg/proto/chat/chat.proto @@ -16,7 +16,7 @@ message WSToMsgSvrChatMsg{ string MsgID = 11; string Token = 12; string OfflineInfo =13; - string Options = 14; + map Options = 14; int32 PlatformID =15; repeated string ForceList = 16; string ClientMsgID = 17; @@ -37,7 +37,7 @@ message MsgSvrToPushSvrChatMsg { string OperationID = 11; string MsgID = 12; string OfflineInfo = 13; - string Options =14; + map Options =14; int32 PlatformID =15; string ClientMsgID = 16; @@ -121,7 +121,7 @@ message UserSendMsgReq { string RecvID = 11; repeated string ForceList = 12; string Content = 13; - string Options = 14; + map Options = 14; string ClientMsgID = 15; string OffLineInfo = 16; string Ex = 17; diff --git a/pkg/proto/push/push.pb.go b/pkg/proto/push/push.pb.go index 2fdbd2f53..ea30d3911 100644 --- a/pkg/proto/push/push.pb.go +++ b/pkg/proto/push/push.pb.go @@ -24,32 +24,32 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type PushMsgReq struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,7,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,9,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,10,opt,name=MsgID" json:"MsgID,omitempty"` - OfflineInfo string `protobuf:"bytes,11,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,12,opt,name=Options" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID" json:"PlatformID,omitempty"` - SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` + SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,7,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,9,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,10,opt,name=MsgID" json:"MsgID,omitempty"` + OfflineInfo string `protobuf:"bytes,11,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options map[string]int32 `protobuf:"bytes,12,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID" json:"PlatformID,omitempty"` + SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PushMsgReq) Reset() { *m = PushMsgReq{} } func (m *PushMsgReq) String() string { return proto.CompactTextString(m) } func (*PushMsgReq) ProtoMessage() {} func (*PushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_push_4f08d2ff54ba8af2, []int{0} + return fileDescriptor_push_380e4afdaa5f6119, []int{0} } func (m *PushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgReq.Unmarshal(m, b) @@ -146,11 +146,11 @@ func (m *PushMsgReq) GetOfflineInfo() string { return "" } -func (m *PushMsgReq) GetOptions() string { +func (m *PushMsgReq) GetOptions() map[string]int32 { if m != nil { return m.Options } - return "" + return nil } func (m *PushMsgReq) GetPlatformID() int32 { @@ -192,7 +192,7 @@ func (m *PushMsgResp) Reset() { *m = PushMsgResp{} } func (m *PushMsgResp) String() string { return proto.CompactTextString(m) } func (*PushMsgResp) ProtoMessage() {} func (*PushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_push_4f08d2ff54ba8af2, []int{1} + return fileDescriptor_push_380e4afdaa5f6119, []int{1} } func (m *PushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgResp.Unmarshal(m, b) @@ -221,6 +221,7 @@ func (m *PushMsgResp) GetResultCode() int32 { func init() { proto.RegisterType((*PushMsgReq)(nil), "push.PushMsgReq") + proto.RegisterMapType((map[string]int32)(nil), "push.PushMsgReq.OptionsEntry") proto.RegisterType((*PushMsgResp)(nil), "push.PushMsgResp") } @@ -296,32 +297,35 @@ var _PushMsgService_serviceDesc = grpc.ServiceDesc{ Metadata: "push/push.proto", } -func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_4f08d2ff54ba8af2) } - -var fileDescriptor_push_4f08d2ff54ba8af2 = []byte{ - // 378 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x5d, 0xeb, 0xda, 0x30, - 0x14, 0xc6, 0xe9, 0xb4, 0xbe, 0x1c, 0xe7, 0xcb, 0xc2, 0x18, 0xc1, 0x8b, 0x51, 0x64, 0x0c, 0x6f, - 0xd6, 0xc1, 0x76, 0xb9, 0x9b, 0x31, 0x8b, 0x50, 0x98, 0x2f, 0xa4, 0xee, 0x66, 0x77, 0xb5, 0x9e, - 0x6a, 0x59, 0x9b, 0xc4, 0xa6, 0x0a, 0xfb, 0xd2, 0xfb, 0x0c, 0x23, 0x49, 0xd5, 0xfe, 0xbd, 0x29, - 0x7d, 0x7e, 0xe7, 0x39, 0x87, 0x27, 0xc9, 0x81, 0xb1, 0xbc, 0xa8, 0xd3, 0x67, 0xfd, 0xf1, 0x65, - 0x29, 0x2a, 0x41, 0xda, 0xfa, 0x7f, 0xf6, 0xaf, 0x05, 0xb0, 0xbd, 0xa8, 0xd3, 0x4a, 0x1d, 0x19, - 0x9e, 0xc9, 0x3b, 0xe8, 0x44, 0xc8, 0x0f, 0x61, 0x40, 0x1d, 0xcf, 0x99, 0xf7, 0x59, 0xad, 0x34, - 0x67, 0x98, 0x5c, 0xc3, 0x80, 0xbe, 0xb2, 0xdc, 0x2a, 0x42, 0xa1, 0xbb, 0x10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0xb7, 0x92, 0x3a, 0x1e, 0x43, 0x75, 0xc9, 0xab, 0x85, 0x38, 0xa0, 0x79, 0x74, - 0x97, 0x35, 0xc8, 0x97, 0xef, 0x30, 0xaa, 0xed, 0x11, 0x96, 0xd7, 0x2c, 0x41, 0xe2, 0x43, 0xb7, - 0x26, 0x64, 0xe2, 0x9b, 0x7d, 0x7a, 0xec, 0xcf, 0xf4, 0xcd, 0x13, 0x51, 0xf2, 0xc7, 0xf8, 0xf7, - 0xd0, 0x37, 0x7b, 0xf7, 0x4d, 0xee, 0x35, 0xdf, 0x77, 0xcc, 0xfe, 0x7d, 0xfd, 0x1f, 0x00, 0x00, - 0xff, 0xff, 0x6b, 0x53, 0xf4, 0xd4, 0x92, 0x02, 0x00, 0x00, +func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_380e4afdaa5f6119) } + +var fileDescriptor_push_380e4afdaa5f6119 = []byte{ + // 426 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x5f, 0x6b, 0xdb, 0x30, + 0x14, 0xc5, 0x71, 0x13, 0x27, 0xed, 0x4d, 0xf3, 0x67, 0x62, 0x0c, 0x11, 0xd8, 0x30, 0x65, 0x8c, + 0xbc, 0xcc, 0x83, 0xee, 0x61, 0xa3, 0x7b, 0x19, 0xab, 0x57, 0x30, 0x2c, 0x6d, 0x51, 0xba, 0x97, + 0xbd, 0xb9, 0xe9, 0x4d, 0x6a, 0xea, 0x48, 0xaa, 0x25, 0x07, 0xf2, 0x11, 0xf7, 0xad, 0x86, 0xae, + 0xec, 0xc6, 0xcb, 0x8b, 0xd1, 0xf9, 0xdd, 0xa3, 0x6b, 0xdd, 0xc3, 0x85, 0xb1, 0xae, 0xcc, 0xe3, + 0x27, 0xf7, 0x89, 0x75, 0xa9, 0xac, 0x62, 0x5d, 0x77, 0x3e, 0xfb, 0xdb, 0x05, 0xb8, 0xad, 0xcc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, 0x7a, 0x73, 0x8b, 0xb0, 0x0f, 0x30, 0x72, 0xe1, 0x60, 0x79, 0x9d, + 0x2f, 0x9f, 0xae, 0xb3, 0x0d, 0xf2, 0x11, 0xfd, 0xfd, 0x80, 0xb2, 0xf7, 0x30, 0xf4, 0xe4, 0x2a, + 0x5b, 0xe2, 0x6f, 0xf1, 0x8b, 0x8f, 0xc9, 0xf6, 0x3f, 0xa4, 0x10, 0x8b, 0x1c, 0xa5, 0xf5, 0x43, + 0x4e, 0xfc, 0x20, 0x2d, 0x34, 0xbd, 0x80, 0xd3, 0xf6, 0x43, 0xd9, 0x04, 0x3a, 0x4f, 0xb8, 0xab, + 0xb7, 0xc1, 0x1d, 0x5d, 0x44, 0xdb, 0xac, 0xa8, 0x90, 0x36, 0x21, 0x14, 0x5e, 0x5c, 0x1c, 0x7d, + 0x0d, 0xce, 0x3e, 0xc2, 0xe0, 0x65, 0x5e, 0xa3, 0xdd, 0x68, 0x02, 0x4d, 0x55, 0xd8, 0x4b, 0xf5, + 0x80, 0xd4, 0x21, 0x14, 0x2d, 0x72, 0xfe, 0x1d, 0x46, 0xb5, 0x7d, 0x81, 0xe5, 0x36, 0x5f, 0x22, + 0x8b, 0xa1, 0x5f, 0x13, 0x36, 0x39, 0xcc, 0x6f, 0xfa, 0xea, 0x80, 0x18, 0xfd, 0x63, 0xfc, 0x67, + 0x18, 0xd3, 0x4a, 0x7f, 0xd3, 0xf7, 0x8e, 0xdf, 0xf7, 0x68, 0xb5, 0x3f, 0xff, 0x0b, 0x00, 0x00, + 0xff, 0xff, 0xf0, 0x9a, 0xaa, 0x81, 0xed, 0x02, 0x00, 0x00, } diff --git a/pkg/proto/push/push.proto b/pkg/proto/push/push.proto index 60fddfe3b..ed8dd4337 100644 --- a/pkg/proto/push/push.proto +++ b/pkg/proto/push/push.proto @@ -14,7 +14,7 @@ message PushMsgReq { string OperationID = 9; string MsgID = 10; string OfflineInfo = 11; - string Options =12; + map Options =12; int32 PlatformID =13; string SenderNickName = 14; string SenderFaceURL = 15; From 0e99fb27b551423014bc01bd931cf4e143e09c12 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 18:09:34 +0800 Subject: [PATCH 23/47] rpc protocol update --- pkg/proto/chat/chat.pb.go | 293 +++++++++++++++++++------------------- 1 file changed, 150 insertions(+), 143 deletions(-) diff --git a/pkg/proto/chat/chat.pb.go b/pkg/proto/chat/chat.pb.go index b48d2cee1..06118c3d1 100644 --- a/pkg/proto/chat/chat.pb.go +++ b/pkg/proto/chat/chat.pb.go @@ -24,33 +24,33 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type WSToMsgSvrChatMsg struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - SendTime int64 `protobuf:"varint,4,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,5,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - SenderNickName string `protobuf:"bytes,6,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,7,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ContentType int32 `protobuf:"varint,8,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,9,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,11,opt,name=MsgID" json:"MsgID,omitempty"` - Token string `protobuf:"bytes,12,opt,name=Token" json:"Token,omitempty"` - OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` - ForceList []string `protobuf:"bytes,16,rep,name=ForceList" json:"ForceList,omitempty"` - ClientMsgID string `protobuf:"bytes,17,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + SendTime int64 `protobuf:"varint,4,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,5,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + SenderNickName string `protobuf:"bytes,6,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,7,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ContentType int32 `protobuf:"varint,8,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,11,opt,name=MsgID" json:"MsgID,omitempty"` + Token string `protobuf:"bytes,12,opt,name=Token" json:"Token,omitempty"` + OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options map[string]int32 `protobuf:"bytes,14,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` + ForceList []string `protobuf:"bytes,16,rep,name=ForceList" json:"ForceList,omitempty"` + ClientMsgID string `protobuf:"bytes,17,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *WSToMsgSvrChatMsg) Reset() { *m = WSToMsgSvrChatMsg{} } func (m *WSToMsgSvrChatMsg) String() string { return proto.CompactTextString(m) } func (*WSToMsgSvrChatMsg) ProtoMessage() {} func (*WSToMsgSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{0} + return fileDescriptor_chat_3707ac912effe95d, []int{0} } func (m *WSToMsgSvrChatMsg) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_WSToMsgSvrChatMsg.Unmarshal(m, b) @@ -161,11 +161,11 @@ func (m *WSToMsgSvrChatMsg) GetOfflineInfo() string { return "" } -func (m *WSToMsgSvrChatMsg) GetOptions() string { +func (m *WSToMsgSvrChatMsg) GetOptions() map[string]int32 { if m != nil { return m.Options } - return "" + return nil } func (m *WSToMsgSvrChatMsg) GetPlatformID() int32 { @@ -190,32 +190,32 @@ func (m *WSToMsgSvrChatMsg) GetClientMsgID() string { } type MsgSvrToPushSvrChatMsg struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - SenderNickName string `protobuf:"bytes,7,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,8,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ContentType int32 `protobuf:"varint,9,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,10,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,11,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,12,opt,name=MsgID" json:"MsgID,omitempty"` - OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` - PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` + SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + SenderNickName string `protobuf:"bytes,7,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,8,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ContentType int32 `protobuf:"varint,9,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,10,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,11,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,12,opt,name=MsgID" json:"MsgID,omitempty"` + OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options map[string]int32 `protobuf:"bytes,14,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` + ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *MsgSvrToPushSvrChatMsg) Reset() { *m = MsgSvrToPushSvrChatMsg{} } func (m *MsgSvrToPushSvrChatMsg) String() string { return proto.CompactTextString(m) } func (*MsgSvrToPushSvrChatMsg) ProtoMessage() {} func (*MsgSvrToPushSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{1} + return fileDescriptor_chat_3707ac912effe95d, []int{1} } func (m *MsgSvrToPushSvrChatMsg) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Unmarshal(m, b) @@ -326,11 +326,11 @@ func (m *MsgSvrToPushSvrChatMsg) GetOfflineInfo() string { return "" } -func (m *MsgSvrToPushSvrChatMsg) GetOptions() string { +func (m *MsgSvrToPushSvrChatMsg) GetOptions() map[string]int32 { if m != nil { return m.Options } - return "" + return nil } func (m *MsgSvrToPushSvrChatMsg) GetPlatformID() int32 { @@ -361,7 +361,7 @@ func (m *PullMessageReq) Reset() { *m = PullMessageReq{} } func (m *PullMessageReq) String() string { return proto.CompactTextString(m) } func (*PullMessageReq) ProtoMessage() {} func (*PullMessageReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{2} + return fileDescriptor_chat_3707ac912effe95d, []int{2} } func (m *PullMessageReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageReq.Unmarshal(m, b) @@ -425,7 +425,7 @@ func (m *PullMessageResp) Reset() { *m = PullMessageResp{} } func (m *PullMessageResp) String() string { return proto.CompactTextString(m) } func (*PullMessageResp) ProtoMessage() {} func (*PullMessageResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{3} + return fileDescriptor_chat_3707ac912effe95d, []int{3} } func (m *PullMessageResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageResp.Unmarshal(m, b) @@ -500,7 +500,7 @@ func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListReq) ProtoMessage() {} func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{4} + return fileDescriptor_chat_3707ac912effe95d, []int{4} } func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) @@ -553,7 +553,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{5} + return fileDescriptor_chat_3707ac912effe95d, []int{5} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -601,7 +601,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{6} + return fileDescriptor_chat_3707ac912effe95d, []int{6} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -663,7 +663,7 @@ func (m *GatherFormat) Reset() { *m = GatherFormat{} } func (m *GatherFormat) String() string { return proto.CompactTextString(m) } func (*GatherFormat) ProtoMessage() {} func (*GatherFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{7} + return fileDescriptor_chat_3707ac912effe95d, []int{7} } func (m *GatherFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GatherFormat.Unmarshal(m, b) @@ -731,7 +731,7 @@ func (m *MsgFormat) Reset() { *m = MsgFormat{} } func (m *MsgFormat) String() string { return proto.CompactTextString(m) } func (*MsgFormat) ProtoMessage() {} func (*MsgFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{8} + return fileDescriptor_chat_3707ac912effe95d, []int{8} } func (m *MsgFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgFormat.Unmarshal(m, b) @@ -836,34 +836,34 @@ func (m *MsgFormat) GetClientMsgID() string { } type UserSendMsgReq struct { - ReqIdentifier int32 `protobuf:"varint,1,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` - SendID string `protobuf:"bytes,3,opt,name=SendID" json:"SendID,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` - SenderNickName string `protobuf:"bytes,5,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,6,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - PlatformID int32 `protobuf:"varint,7,opt,name=PlatformID" json:"PlatformID,omitempty"` - SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` - MsgFrom int32 `protobuf:"varint,9,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,10,opt,name=ContentType" json:"ContentType,omitempty"` - RecvID string `protobuf:"bytes,11,opt,name=RecvID" json:"RecvID,omitempty"` - ForceList []string `protobuf:"bytes,12,rep,name=ForceList" json:"ForceList,omitempty"` - Content string `protobuf:"bytes,13,opt,name=Content" json:"Content,omitempty"` - Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` - ClientMsgID string `protobuf:"bytes,15,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - OffLineInfo string `protobuf:"bytes,16,opt,name=OffLineInfo" json:"OffLineInfo,omitempty"` - Ex string `protobuf:"bytes,17,opt,name=Ex" json:"Ex,omitempty"` - SendTime int64 `protobuf:"varint,18,opt,name=sendTime" json:"sendTime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ReqIdentifier int32 `protobuf:"varint,1,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` + SendID string `protobuf:"bytes,3,opt,name=SendID" json:"SendID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + SenderNickName string `protobuf:"bytes,5,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,6,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + PlatformID int32 `protobuf:"varint,7,opt,name=PlatformID" json:"PlatformID,omitempty"` + SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,9,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,10,opt,name=ContentType" json:"ContentType,omitempty"` + RecvID string `protobuf:"bytes,11,opt,name=RecvID" json:"RecvID,omitempty"` + ForceList []string `protobuf:"bytes,12,rep,name=ForceList" json:"ForceList,omitempty"` + Content string `protobuf:"bytes,13,opt,name=Content" json:"Content,omitempty"` + Options map[string]int32 `protobuf:"bytes,14,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + ClientMsgID string `protobuf:"bytes,15,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + OffLineInfo string `protobuf:"bytes,16,opt,name=OffLineInfo" json:"OffLineInfo,omitempty"` + Ex string `protobuf:"bytes,17,opt,name=Ex" json:"Ex,omitempty"` + SendTime int64 `protobuf:"varint,18,opt,name=sendTime" json:"sendTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } func (*UserSendMsgReq) ProtoMessage() {} func (*UserSendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{9} + return fileDescriptor_chat_3707ac912effe95d, []int{9} } func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) @@ -974,11 +974,11 @@ func (m *UserSendMsgReq) GetContent() string { return "" } -func (m *UserSendMsgReq) GetOptions() string { +func (m *UserSendMsgReq) GetOptions() map[string]int32 { if m != nil { return m.Options } - return "" + return nil } func (m *UserSendMsgReq) GetClientMsgID() string { @@ -1025,7 +1025,7 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_feb94a5514034c46, []int{10} + return fileDescriptor_chat_3707ac912effe95d, []int{10} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -1089,7 +1089,9 @@ func (m *UserSendMsgResp) GetSendTime() int64 { func init() { proto.RegisterType((*WSToMsgSvrChatMsg)(nil), "pbChat.WSToMsgSvrChatMsg") + proto.RegisterMapType((map[string]int32)(nil), "pbChat.WSToMsgSvrChatMsg.OptionsEntry") proto.RegisterType((*MsgSvrToPushSvrChatMsg)(nil), "pbChat.MsgSvrToPushSvrChatMsg") + proto.RegisterMapType((map[string]int32)(nil), "pbChat.MsgSvrToPushSvrChatMsg.OptionsEntry") proto.RegisterType((*PullMessageReq)(nil), "pbChat.PullMessageReq") proto.RegisterType((*PullMessageResp)(nil), "pbChat.PullMessageResp") proto.RegisterType((*PullMessageBySeqListReq)(nil), "pbChat.PullMessageBySeqListReq") @@ -1098,6 +1100,7 @@ func init() { proto.RegisterType((*GatherFormat)(nil), "pbChat.GatherFormat") proto.RegisterType((*MsgFormat)(nil), "pbChat.MsgFormat") proto.RegisterType((*UserSendMsgReq)(nil), "pbChat.UserSendMsgReq") + proto.RegisterMapType((map[string]int32)(nil), "pbChat.UserSendMsgReq.OptionsEntry") proto.RegisterType((*UserSendMsgResp)(nil), "pbChat.UserSendMsgResp") } @@ -1272,70 +1275,74 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ Metadata: "chat/chat.proto", } -func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_feb94a5514034c46) } - -var fileDescriptor_chat_feb94a5514034c46 = []byte{ - // 981 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xdd, 0x6a, 0xe3, 0x46, - 0x14, 0xc6, 0x92, 0x2d, 0xdb, 0xc7, 0xbf, 0x99, 0x86, 0xec, 0x90, 0x96, 0xd6, 0x88, 0x6d, 0x31, - 0xbd, 0x48, 0x61, 0x7b, 0x53, 0x5a, 0x58, 0x68, 0x62, 0x27, 0xa8, 0x44, 0xd9, 0x20, 0x7b, 0x29, - 0xf4, 0x4e, 0x6b, 0x8f, 0x15, 0xb1, 0xb6, 0x24, 0xcf, 0x28, 0x69, 0xf6, 0xa6, 0xaf, 0xd0, 0x97, - 0xe8, 0x65, 0x5f, 0xa4, 0x8f, 0xd2, 0x57, 0x28, 0x14, 0xca, 0xcc, 0x48, 0xd6, 0xe8, 0xc7, 0x49, - 0xd8, 0xb2, 0x7b, 0x13, 0x38, 0x9f, 0xce, 0xfc, 0x9c, 0xf3, 0x7d, 0xf3, 0x1d, 0x07, 0x06, 0x8b, - 0x1b, 0x37, 0xfe, 0x86, 0xff, 0x39, 0x89, 0x68, 0x18, 0x87, 0xc8, 0x88, 0xde, 0x9c, 0xdd, 0xb8, - 0xb1, 0xf9, 0x7b, 0x1d, 0x0e, 0x7e, 0x9e, 0xcd, 0x43, 0x9b, 0x79, 0xb3, 0x3b, 0xca, 0x21, 0x9b, - 0x79, 0xe8, 0x08, 0x8c, 0x19, 0x09, 0x96, 0xd6, 0x04, 0xd7, 0x46, 0xb5, 0x71, 0xdb, 0x49, 0x22, - 0x8e, 0x3b, 0x64, 0x71, 0x67, 0x4d, 0xb0, 0x26, 0x71, 0x19, 0x21, 0x0c, 0xcd, 0xb3, 0x30, 0x88, - 0x49, 0x10, 0x63, 0x5d, 0x7c, 0x48, 0x43, 0x74, 0x0c, 0x2d, 0xbe, 0x76, 0xee, 0x6f, 0x08, 0xae, - 0x8f, 0x6a, 0x63, 0xdd, 0xd9, 0xc5, 0x7c, 0x95, 0xcd, 0xbc, 0x73, 0x1a, 0x6e, 0x70, 0x63, 0x54, - 0x1b, 0x37, 0x9c, 0x34, 0x44, 0x5f, 0x41, 0x9f, 0x67, 0x11, 0x7a, 0xe5, 0x2f, 0xde, 0x5e, 0xb9, - 0x1b, 0x82, 0x0d, 0xb1, 0x6d, 0x01, 0x45, 0xcf, 0xa1, 0x27, 0x91, 0x73, 0x77, 0x41, 0x5e, 0x3b, - 0x97, 0xb8, 0x29, 0xd2, 0xf2, 0x20, 0x1a, 0x41, 0x27, 0xb9, 0xce, 0xfc, 0x5d, 0x44, 0x70, 0x4b, - 0x9c, 0xa5, 0x42, 0x3c, 0x63, 0x46, 0x18, 0xf3, 0xc3, 0x40, 0x64, 0xb4, 0x65, 0x86, 0x02, 0xf1, - 0x8c, 0x57, 0x11, 0xa1, 0x6e, 0xec, 0x87, 0x81, 0x35, 0xc1, 0x20, 0xce, 0x51, 0x21, 0x74, 0x08, - 0x0d, 0x9b, 0x79, 0xd6, 0x04, 0x77, 0xc4, 0x37, 0x19, 0x70, 0x74, 0x1e, 0xbe, 0x25, 0x01, 0xee, - 0x4a, 0x54, 0x04, 0x62, 0xb7, 0xd5, 0x6a, 0xed, 0x07, 0xc4, 0x0a, 0x56, 0x21, 0xee, 0x25, 0xbb, - 0x65, 0x10, 0xef, 0xcd, 0xab, 0x88, 0xef, 0xcc, 0x70, 0x5f, 0x76, 0x34, 0x09, 0xd1, 0xe7, 0x00, - 0xd7, 0x6b, 0x37, 0x5e, 0x85, 0x74, 0x63, 0x4d, 0xf0, 0x40, 0x5c, 0x55, 0x41, 0xd0, 0x67, 0xd0, - 0x3e, 0x0f, 0xe9, 0x82, 0x5c, 0xfa, 0x2c, 0xc6, 0xc3, 0x91, 0x3e, 0x6e, 0x3b, 0x19, 0x20, 0x7a, - 0xb1, 0xf6, 0x49, 0x10, 0xcb, 0xbb, 0x1e, 0xc8, 0x93, 0x15, 0xc8, 0xfc, 0x47, 0x87, 0x23, 0xa9, - 0x86, 0x79, 0x78, 0x7d, 0xcb, 0x6e, 0x3e, 0x88, 0x2c, 0x30, 0x34, 0x79, 0xce, 0x8c, 0x6c, 0x13, - 0x55, 0xa4, 0x61, 0x4e, 0x30, 0x8d, 0xfd, 0x82, 0x31, 0x1e, 0x13, 0x4c, 0xf3, 0x69, 0x82, 0x69, - 0x3d, 0x41, 0x30, 0xed, 0x47, 0x05, 0x03, 0x8f, 0x0a, 0xa6, 0xf3, 0x80, 0x60, 0xba, 0xaa, 0x60, - 0x3e, 0xa4, 0x34, 0x0a, 0xe4, 0x0f, 0xcb, 0xe4, 0xff, 0x06, 0xfd, 0xeb, 0xdb, 0xf5, 0xda, 0x26, - 0x8c, 0xb9, 0x1e, 0x71, 0xc8, 0x96, 0x73, 0xfb, 0x9a, 0x11, 0x9a, 0x71, 0x2e, 0x23, 0xc9, 0xd3, - 0xf6, 0x94, 0x78, 0x7e, 0x20, 0x58, 0x17, 0x3c, 0xc9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24, 0xbb, 0x4c, 0x27, 0xd9, 0x70, 0x37, 0xc9, 0x52, 0x88, - 0xbf, 0xdc, 0xe9, 0x7d, 0xf2, 0x1b, 0x44, 0x9b, 0xde, 0x73, 0x29, 0xb3, 0x54, 0xca, 0x48, 0x4a, - 0x39, 0x8d, 0xcd, 0xbf, 0x6a, 0x30, 0xc8, 0xc9, 0xe5, 0xbd, 0xbc, 0xa6, 0xa4, 0x30, 0xbd, 0x4a, - 0x61, 0x85, 0x07, 0x5a, 0x2f, 0x3f, 0xd0, 0x42, 0xf5, 0x8d, 0x72, 0xf5, 0x6a, 0x2d, 0x46, 0xbe, - 0x96, 0x17, 0x7f, 0x68, 0x50, 0xe7, 0x9e, 0x84, 0x7e, 0x82, 0x41, 0xc1, 0x43, 0xd1, 0xf1, 0x6e, - 0x72, 0x94, 0xcc, 0xfa, 0xf8, 0xd3, 0xbd, 0xdf, 0x58, 0x84, 0x5e, 0x42, 0x47, 0x19, 0x27, 0xe8, - 0x28, 0xcd, 0xcd, 0xcf, 0xf3, 0xe3, 0x67, 0x95, 0x38, 0x8b, 0xd0, 0x35, 0x1c, 0x56, 0x8d, 0x23, - 0xf4, 0x45, 0xc5, 0x02, 0x75, 0x58, 0xed, 0xdf, 0xf1, 0x25, 0x74, 0x14, 0xc6, 0xb2, 0x1b, 0xe5, - 0x5f, 0x7d, 0xb6, 0xbe, 0x40, 0xef, 0xe9, 0xe0, 0x97, 0xde, 0x89, 0xf8, 0x9f, 0xe5, 0x07, 0x99, - 0xf0, 0xc6, 0x10, 0xff, 0xbb, 0x7c, 0xfb, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x44, 0x4e, - 0x52, 0xce, 0x0c, 0x00, 0x00, +func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_3707ac912effe95d) } + +var fileDescriptor_chat_3707ac912effe95d = []byte{ + // 1049 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x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d7, 0xe8, 0xfb, 0x23, 0x07, 0x75, 0x2d, 0xa9, 0x27, 0x89, + 0x59, 0x0a, 0x61, 0x33, 0x0b, 0xe1, 0x84, 0x02, 0xe4, 0xd3, 0x0a, 0x90, 0xa8, 0x9c, 0x95, 0xae, + 0x9c, 0x5a, 0x87, 0x82, 0x5e, 0x87, 0x97, 0xbf, 0x1b, 0x90, 0xe7, 0x5d, 0x42, 0x3f, 0x42, 0x3d, + 0x21, 0xd2, 0xa8, 0xb9, 0x19, 0x4d, 0xa9, 0x69, 0xd0, 0xfc, 0x78, 0xeb, 0x33, 0xb6, 0x42, 0xaf, + 0xa1, 0xac, 0xcc, 0x2b, 0x74, 0x18, 0xc5, 0xea, 0x17, 0x86, 0xe6, 0xb3, 0x4c, 0x3f, 0x5b, 0xa1, + 0x4b, 0x38, 0xc8, 0x9a, 0x77, 0xe8, 0xb3, 0x8c, 0x05, 0xea, 0x34, 0xdc, 0xbe, 0xe3, 0x6b, 0x28, + 0x2b, 0x1d, 0x8b, 0x4f, 0xa4, 0xb3, 0x19, 0xaf, 0x4f, 0xb4, 0xf7, 0xb8, 0xfe, 0x73, 0xb5, 0x2b, + 0x7e, 0xe1, 0x7d, 0x2b, 0x03, 0xde, 0x15, 0xc4, 0x2f, 0xbd, 0x6f, 0xfe, 0x0d, 0x00, 0x00, 0xff, + 0xff, 0xa2, 0x9b, 0xc2, 0xf2, 0xfc, 0x0d, 0x00, 0x00, } From c6ade8d9bcaed4e1f86f13ffaeac9fcebedfa590 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 18:15:14 +0800 Subject: [PATCH 24/47] rpc protocol update --- internal/api/chat/send_msg.go | 4 ++-- internal/api/manage/management_chat.go | 2 +- internal/push/logic/push_to_client.go | 6 ++---- internal/rpc/chat/send_msg.go | 8 ++------ pkg/utils/map.go | 6 +++--- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/internal/api/chat/send_msg.go b/internal/api/chat/send_msg.go index 4d53bf769..2c4eee371 100644 --- a/internal/api/chat/send_msg.go +++ b/internal/api/chat/send_msg.go @@ -27,7 +27,7 @@ type paramsUserSendMsg struct { RecvID string `json:"recvID" binding:"required"` ForceList []string `json:"forceList"` Content string `json:"content" binding:"required"` - Options map[string]interface{} `json:"options" ` + Options map[string]int32 `json:"options" ` ClientMsgID string `json:"clientMsgID" binding:"required"` OffLineInfo map[string]interface{} `json:"offlineInfo" ` Ex map[string]interface{} `json:"ext"` @@ -49,7 +49,7 @@ func newUserSendMsgReq(token string, params *paramsUserSendMsg) *pbChat.UserSend RecvID: params.Data.RecvID, ForceList: params.Data.ForceList, Content: params.Data.Content, - Options: utils.MapToJsonString(params.Data.Options), + Options: params.Data.Options, ClientMsgID: params.Data.ClientMsgID, OffLineInfo: utils.MapToJsonString(params.Data.OffLineInfo), Ex: utils.MapToJsonString(params.Data.Ex), diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index ba056eba1..4cb8f6364 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -72,7 +72,7 @@ func newUserSendMsgReq(params *paramsManagementSendMsg) *pbChat.UserSendMsgReq { ForceList: params.ForceList, Content: newContent, ClientMsgID: utils.GetMsgID(params.SendID), - Options: utils.MapIntToJsonString(options), + Options: options, } return &pbData } diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index 390ba42c5..7051360f3 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -34,11 +34,9 @@ type AtContent struct { IsAtSelf bool `json:"isAtSelf"` } -func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo, Options string) { +func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo string, Options map[string]int32) { var wsResult []*pbRelay.SingleMsgToUser - MOptions := utils.JsonStringToMap(Options) //Control whether to push message to sender's other terminal - //isSenderSync := utils.GetSwitchFromOptions(MOptions, "senderSync") - isOfflinePush := utils.GetSwitchFromOptions(MOptions, "offlinePush") + isOfflinePush := utils.GetSwitchFromOptions(Options, "offlinePush") log.InfoByKv("Get chat from msg_transfer And push chat", sendPbData.OperationID, "PushData", sendPbData) grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) //Online push message diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index 42d83e1a7..d81e9d580 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -71,8 +71,7 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (* } else { pbData.SendTime = pb.SendTime } - Options := utils.JsonStringToMap(pbData.Options) - isHistory := utils.GetSwitchFromOptions(Options, "history") + isHistory := utils.GetSwitchFromOptions(pbData.Options, "history") mReq := MsgCallBackReq{ SendID: pb.SendID, RecvID: pb.RecvID, @@ -224,10 +223,7 @@ func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType i case constant.NotReceiveMessage: return false case constant.ReceiveNotNotifyMessage: - m := utils.JsonStringToMap(msg.Options) - utils.SetSwitchFromOptions(m, "offlinePush", 0) - s := utils.MapToJsonString(m) - msg.OfflineInfo = s + utils.SetSwitchFromOptions(msg.Options, "offlinePush", 0) return true } diff --git a/pkg/utils/map.go b/pkg/utils/map.go index f2c2d07b5..fec4da23e 100644 --- a/pkg/utils/map.go +++ b/pkg/utils/map.go @@ -115,12 +115,12 @@ func JsonStringToMap(str string) (tempMap map[string]interface{}) { _ = json.Unmarshal([]byte(str), &tempMap) return tempMap } -func GetSwitchFromOptions(Options map[string]interface{}, key string) (result bool) { - if flag, ok := Options[key]; !ok || flag.(float64) == 1 { +func GetSwitchFromOptions(Options map[string]int32, key string) (result bool) { + if flag, ok := Options[key]; !ok || flag == 1 { return true } return false } -func SetSwitchFromOptions(Options map[string]interface{}, key string, value interface{}) { +func SetSwitchFromOptions(Options map[string]int32, key string, value int32) { Options[key] = value } From 822f689c482dcdb4c920006545044b9f76c5967f Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 18:17:57 +0800 Subject: [PATCH 25/47] rpc protocol update --- internal/msg_gateway/gate/logic.go | 2 +- internal/msg_transfer/logic/history_msg_handler.go | 5 ++--- internal/msg_transfer/logic/persistent_msg_handler.go | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index 9b449d4b2..58358a1e6 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -214,7 +214,7 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req, sendTime int64) { SenderNickName: data.SenderNickName, SenderFaceURL: data.SenderFaceURL, Content: data.Content, - Options: utils.MapIntToJsonString(data.Options), + Options: data.Options, ClientMsgID: data.ClientMsgID, SendTime: sendTime, } diff --git a/internal/msg_transfer/logic/history_msg_handler.go b/internal/msg_transfer/logic/history_msg_handler.go index e3b5efb05..ce6e2ade5 100644 --- a/internal/msg_transfer/logic/history_msg_handler.go +++ b/internal/msg_transfer/logic/history_msg_handler.go @@ -54,11 +54,10 @@ func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string) pbSaveData.OperationID = pbData.OperationID pbSaveData.RecvID = pbData.RecvID pbSaveData.PlatformID = pbData.PlatformID - Options := utils.JsonStringToMap(pbData.Options) //Control whether to store offline messages (mongo) - isHistory := utils.GetSwitchFromOptions(Options, "history") + isHistory := utils.GetSwitchFromOptions(pbData.Options, "history") //Control whether to store history messages (mysql) - isPersist := utils.GetSwitchFromOptions(Options, "persistent") + isPersist := utils.GetSwitchFromOptions(pbData.Options, "persistent") switch pbData.SessionType { case constant.SingleChatType: log.NewDebug(pbSaveData.OperationID, "msg_transfer chat type = SingleChatType", isHistory, isPersist) diff --git a/internal/msg_transfer/logic/persistent_msg_handler.go b/internal/msg_transfer/logic/persistent_msg_handler.go index 88039041c..aa4c0c7ba 100644 --- a/internal/msg_transfer/logic/persistent_msg_handler.go +++ b/internal/msg_transfer/logic/persistent_msg_handler.go @@ -40,9 +40,8 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey strin log.ErrorByKv("msg_transfer Unmarshal chat err", "", "chat", string(msg), "err", err.Error()) return } - Options := utils.JsonStringToMap(pbData.Options) //Control whether to store history messages (mysql) - isPersist := utils.GetSwitchFromOptions(Options, "persistent") + isPersist := utils.GetSwitchFromOptions(pbData.Options, "persistent") //Only process receiver data if isPersist { if msgKey == pbData.RecvID && pbData.SessionType == constant.SingleChatType { From d2ce4192cc38932f0ddc9d6be69e35cc47611cb7 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 8 Dec 2021 18:30:23 +0800 Subject: [PATCH 26/47] rpc protocol update --- internal/rpc/chat/send_msg.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index d81e9d580..dd4090435 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -223,6 +223,9 @@ func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType i case constant.NotReceiveMessage: return false case constant.ReceiveNotNotifyMessage: + if msg.Options == nil { + msg.Options = make(map[string]int32, 2) + } utils.SetSwitchFromOptions(msg.Options, "offlinePush", 0) return true } From fa028fdafd6883cfeca04cb00a4546c86c68df61 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 15:43:36 +0800 Subject: [PATCH 27/47] push add ios push --- internal/push/jpush/push.go | 3 +-- .../push/jpush/requestBody/notification.go | 21 ++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index 2fe39c27f..03827d9e9 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -20,8 +20,7 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin var au requestBody.Audience au.SetAlias(accounts) var no requestBody.Notification - no.SetAlert(content) - no.SetAndroidIntent() + no.SetAlert(content, platform) var me requestBody.Message me.SetMsgContent(detailContent) var po requestBody.PushObj diff --git a/internal/push/jpush/requestBody/notification.go b/internal/push/jpush/requestBody/notification.go index 838621606..3f2876612 100644 --- a/internal/push/jpush/requestBody/notification.go +++ b/internal/push/jpush/requestBody/notification.go @@ -1,6 +1,9 @@ package requestBody -import "Open_IM/pkg/common/config" +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" +) type Notification struct { Alert string `json:"alert,omitempty"` @@ -15,11 +18,23 @@ type Android struct { } `json:"intent,omitempty"` } type Ios struct { + Alert string `json:"alert,omitempty"` + Sound string `json:"sound,omitempty"` + Badge string `json:"badge,omitempty"` } -func (n *Notification) SetAlert(alert string) { +func (n *Notification) SetAlert(alert, platform string) { n.Alert = alert - n.Android.Alert = alert + switch platform { + case constant.AndroidPlatformStr: + n.Android.Alert = alert + n.SetAndroidIntent() + case constant.IOSPlatformStr: + n.IOS.Alert = alert + n.IOS.Sound = "default" + n.IOS.Badge = "+1" + default: + } } func (n *Notification) SetAndroidIntent() { n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent From 3e51e781a6aca291c70219a8237fa608180e4f53 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 16:05:20 +0800 Subject: [PATCH 28/47] push add ios push --- internal/push/logic/push_to_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index 7051360f3..1e8d3acd3 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -37,7 +37,7 @@ type AtContent struct { func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo string, Options map[string]int32) { var wsResult []*pbRelay.SingleMsgToUser isOfflinePush := utils.GetSwitchFromOptions(Options, "offlinePush") - log.InfoByKv("Get chat from msg_transfer And push chat", sendPbData.OperationID, "PushData", sendPbData) + log.InfoByKv("Get chat from msg_transfer And push chat", sendPbData.OperationID, "PushData", sendPbData, Options, isOfflinePush) grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) //Online push message log.InfoByKv("test", sendPbData.OperationID, "len grpc", len(grpcCons), "data", sendPbData) From 8085c627742e811d5ba7e817b43706172281d176 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 17:14:24 +0800 Subject: [PATCH 29/47] push add ios push --- internal/push/jpush/push.go | 2 ++ internal/push/jpush/requestBody/options.go | 9 +++++++++ internal/push/jpush/requestBody/pushObj.go | 4 ++++ internal/push/logic/push_to_client.go | 4 ++-- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 internal/push/jpush/requestBody/options.go diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index 03827d9e9..e5ce9b4ac 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -23,6 +23,8 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin no.SetAlert(content, platform) var me requestBody.Message me.SetMsgContent(detailContent) + var o requestBody.Options + o.SetApnsProduction(true) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) diff --git a/internal/push/jpush/requestBody/options.go b/internal/push/jpush/requestBody/options.go new file mode 100644 index 000000000..97a452fad --- /dev/null +++ b/internal/push/jpush/requestBody/options.go @@ -0,0 +1,9 @@ +package requestBody + +type Options struct { + ApnsProduction bool `json:"apns_production,omitempty"` +} + +func (o *Options) SetApnsProduction(c bool) { + o.ApnsProduction = c +} diff --git a/internal/push/jpush/requestBody/pushObj.go b/internal/push/jpush/requestBody/pushObj.go index 24c912b26..974161407 100644 --- a/internal/push/jpush/requestBody/pushObj.go +++ b/internal/push/jpush/requestBody/pushObj.go @@ -5,6 +5,7 @@ type PushObj struct { Audience interface{} `json:"audience"` Notification interface{} `json:"notification,omitempty"` Message interface{} `json:"message,omitempty"` + Options interface{} `json:"options,omitempty"` } func (p *PushObj) SetPlatform(pf *Platform) { @@ -22,3 +23,6 @@ func (p *PushObj) SetNotification(no *Notification) { func (p *PushObj) SetMessage(m *Message) { p.Message = m } +func (p *PushObj) SetOptions(o *Options) { + p.Options = o +} diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index 1e8d3acd3..b7c8c94af 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -98,9 +98,9 @@ func MsgToUser(sendPbData *pbRelay.MsgToUserReq, OfflineInfo string, Options map } pushResult, err := push.JGAccountListPush(UIDList, content, jsonCustomContent, constant.PlatformIDToName(t)) if err != nil { - log.NewError(sendPbData.OperationID, "offline push error", sendPbData.String(), err.Error(), t) + log.NewError(sendPbData.OperationID, "offline push error", sendPbData.String(), err.Error(), constant.PlatformIDToName(t)) } else { - log.NewDebug(sendPbData.OperationID, "offline push return result is ", string(pushResult), sendPbData, t) + log.NewDebug(sendPbData.OperationID, "offline push return result is ", string(pushResult), sendPbData, constant.PlatformIDToName(t)) } } From a69ebf42996302fad9bc174ba475577130724df3 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 17:41:06 +0800 Subject: [PATCH 30/47] push add ios push --- internal/push/jpush/push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index e5ce9b4ac..3334ef7ca 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -24,7 +24,7 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin var me requestBody.Message me.SetMsgContent(detailContent) var o requestBody.Options - o.SetApnsProduction(true) + o.SetApnsProduction(false) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) From d7cd8ba780505534ee034dbe99bc0565b9f34de3 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 17:42:02 +0800 Subject: [PATCH 31/47] push add ios push --- internal/push/jpush/push.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index 3334ef7ca..0d639c868 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -24,12 +24,13 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin var me requestBody.Message me.SetMsgContent(detailContent) var o requestBody.Options - o.SetApnsProduction(false) + o.SetApnsProduction(true) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) po.SetNotification(&no) po.SetMessage(&me) + po.SetOptions(&o) con, err := json.Marshal(po) if err != nil { From 74beec2b858cb135bb87dce91573b5616950d311 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 17:52:05 +0800 Subject: [PATCH 32/47] push add ios push --- internal/push/jpush/push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index 0d639c868..1258a80a7 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -24,7 +24,7 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin var me requestBody.Message me.SetMsgContent(detailContent) var o requestBody.Options - o.SetApnsProduction(true) + o.SetApnsProduction(false) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) From adc4fec19bf0ea96b91697d05f06cc7bc920565c Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 17:54:58 +0800 Subject: [PATCH 33/47] push add ios push --- internal/push/jpush/push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index 1258a80a7..0d639c868 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -24,7 +24,7 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin var me requestBody.Message me.SetMsgContent(detailContent) var o requestBody.Options - o.SetApnsProduction(false) + o.SetApnsProduction(true) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) From 31a558cfea2fa7cdb04976380ca36d0878999027 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 18:10:39 +0800 Subject: [PATCH 34/47] push add ios push --- internal/push/jpush/push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index 0d639c868..1258a80a7 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -24,7 +24,7 @@ func JGAccountListPush(accounts []string, content, detailContent, platform strin var me requestBody.Message me.SetMsgContent(detailContent) var o requestBody.Options - o.SetApnsProduction(true) + o.SetApnsProduction(false) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) From 170310e23c0bab12462b8fa0644e7002fa882b39 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 18:15:40 +0800 Subject: [PATCH 35/47] push add ios push --- internal/push/jpush/requestBody/options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/jpush/requestBody/options.go b/internal/push/jpush/requestBody/options.go index 97a452fad..f82ebd035 100644 --- a/internal/push/jpush/requestBody/options.go +++ b/internal/push/jpush/requestBody/options.go @@ -1,7 +1,7 @@ package requestBody type Options struct { - ApnsProduction bool `json:"apns_production,omitempty"` + ApnsProduction bool `json:"apns_production"` } func (o *Options) SetApnsProduction(c bool) { From 043f9bde592aedf740453025df7af9d83532e057 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Thu, 9 Dec 2021 21:22:54 +0800 Subject: [PATCH 36/47] msg add notification --- internal/rpc/chat/send_msg.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index dd4090435..8e6ad5db5 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -189,6 +189,20 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (* } +} + +type WSToMsgSvrChatMsg struct { + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + MsgFrom int32 `protobuf:"varint,5,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,8,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` +} + +func Notification(m *WSToMsgSvrChatMsg, onlineUserOnly bool, offlineInfo interface{}) { + } func (rpc *rpcChat) sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string) error { pid, offset, err := rpc.producer.SendMessage(m, key) From aaf834a33b601e452ec749eb0ce6b1c467dc61f8 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 10:35:21 +0800 Subject: [PATCH 37/47] pb change --- pkg/proto/chat/chat.proto | 6 +++--- pkg/proto/push/push.proto | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/proto/chat/chat.proto b/pkg/proto/chat/chat.proto index f65b1de73..3c66c99dc 100644 --- a/pkg/proto/chat/chat.proto +++ b/pkg/proto/chat/chat.proto @@ -16,7 +16,7 @@ message WSToMsgSvrChatMsg{ string MsgID = 11; string Token = 12; string OfflineInfo =13; - map Options = 14; + string Options = 14; int32 PlatformID =15; repeated string ForceList = 16; string ClientMsgID = 17; @@ -37,7 +37,7 @@ message MsgSvrToPushSvrChatMsg { string OperationID = 11; string MsgID = 12; string OfflineInfo = 13; - map Options =14; + string Options =14; int32 PlatformID =15; string ClientMsgID = 16; @@ -121,7 +121,7 @@ message UserSendMsgReq { string RecvID = 11; repeated string ForceList = 12; string Content = 13; - map Options = 14; + string Options = 14; string ClientMsgID = 15; string OffLineInfo = 16; string Ex = 17; diff --git a/pkg/proto/push/push.proto b/pkg/proto/push/push.proto index ed8dd4337..60fddfe3b 100644 --- a/pkg/proto/push/push.proto +++ b/pkg/proto/push/push.proto @@ -14,7 +14,7 @@ message PushMsgReq { string OperationID = 9; string MsgID = 10; string OfflineInfo = 11; - map Options =12; + string Options =12; int32 PlatformID =13; string SenderNickName = 14; string SenderFaceURL = 15; From d6ec8f49307732f79cb6a5b4f9ea7639f9d94a5f Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 10:49:49 +0800 Subject: [PATCH 38/47] pb change --- internal/api/chat/send_msg.go | 2 +- internal/api/manage/management_chat.go | 2 +- internal/msg_gateway/gate/logic.go | 2 +- .../msg_transfer/logic/history_msg_handler.go | 5 +- .../logic/persistent_msg_handler.go | 3 +- internal/push/logic/push_handler.go | 3 +- internal/rpc/chat/send_msg.go | 11 +- pkg/common/db/mongoModel.go | 6 +- pkg/proto/push/push.pb.go | 106 +++++++++--------- pkg/utils/map.go | 2 +- 10 files changed, 72 insertions(+), 70 deletions(-) diff --git a/internal/api/chat/send_msg.go b/internal/api/chat/send_msg.go index 2c4eee371..e48582eb1 100644 --- a/internal/api/chat/send_msg.go +++ b/internal/api/chat/send_msg.go @@ -49,7 +49,7 @@ func newUserSendMsgReq(token string, params *paramsUserSendMsg) *pbChat.UserSend RecvID: params.Data.RecvID, ForceList: params.Data.ForceList, Content: params.Data.Content, - Options: params.Data.Options, + Options: utils.MapIntToJsonString(params.Data.Options), ClientMsgID: params.Data.ClientMsgID, OffLineInfo: utils.MapToJsonString(params.Data.OffLineInfo), Ex: utils.MapToJsonString(params.Data.Ex), diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go index 4cb8f6364..ba056eba1 100644 --- a/internal/api/manage/management_chat.go +++ b/internal/api/manage/management_chat.go @@ -72,7 +72,7 @@ func newUserSendMsgReq(params *paramsManagementSendMsg) *pbChat.UserSendMsgReq { ForceList: params.ForceList, Content: newContent, ClientMsgID: utils.GetMsgID(params.SendID), - Options: options, + Options: utils.MapIntToJsonString(options), } return &pbData } diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go index 58358a1e6..9b449d4b2 100644 --- a/internal/msg_gateway/gate/logic.go +++ b/internal/msg_gateway/gate/logic.go @@ -214,7 +214,7 @@ func (ws *WServer) sendMsgReq(conn *UserConn, m *Req, sendTime int64) { SenderNickName: data.SenderNickName, SenderFaceURL: data.SenderFaceURL, Content: data.Content, - Options: data.Options, + Options: utils.MapIntToJsonString(data.Options), ClientMsgID: data.ClientMsgID, SendTime: sendTime, } diff --git a/internal/msg_transfer/logic/history_msg_handler.go b/internal/msg_transfer/logic/history_msg_handler.go index ce6e2ade5..4b25bd9bc 100644 --- a/internal/msg_transfer/logic/history_msg_handler.go +++ b/internal/msg_transfer/logic/history_msg_handler.go @@ -54,10 +54,11 @@ func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string) pbSaveData.OperationID = pbData.OperationID pbSaveData.RecvID = pbData.RecvID pbSaveData.PlatformID = pbData.PlatformID + options := utils.JsonStringToMap(pbData.Options) //Control whether to store offline messages (mongo) - isHistory := utils.GetSwitchFromOptions(pbData.Options, "history") + isHistory := utils.GetSwitchFromOptions(options, "history") //Control whether to store history messages (mysql) - isPersist := utils.GetSwitchFromOptions(pbData.Options, "persistent") + isPersist := utils.GetSwitchFromOptions(options, "persistent") switch pbData.SessionType { case constant.SingleChatType: log.NewDebug(pbSaveData.OperationID, "msg_transfer chat type = SingleChatType", isHistory, isPersist) diff --git a/internal/msg_transfer/logic/persistent_msg_handler.go b/internal/msg_transfer/logic/persistent_msg_handler.go index aa4c0c7ba..2a13bb4a2 100644 --- a/internal/msg_transfer/logic/persistent_msg_handler.go +++ b/internal/msg_transfer/logic/persistent_msg_handler.go @@ -40,8 +40,9 @@ func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey strin log.ErrorByKv("msg_transfer Unmarshal chat err", "", "chat", string(msg), "err", err.Error()) return } + options := utils.JsonStringToMap(pbData.Options) //Control whether to store history messages (mysql) - isPersist := utils.GetSwitchFromOptions(pbData.Options, "persistent") + isPersist := utils.GetSwitchFromOptions(options, "persistent") //Only process receiver data if isPersist { if msgKey == pbData.RecvID && pbData.SessionType == constant.SingleChatType { diff --git a/internal/push/logic/push_handler.go b/internal/push/logic/push_handler.go index 22382a5b9..5058ce26d 100644 --- a/internal/push/logic/push_handler.go +++ b/internal/push/logic/push_handler.go @@ -12,6 +12,7 @@ import ( "Open_IM/pkg/common/log" pbChat "Open_IM/pkg/proto/chat" pbRelay "Open_IM/pkg/proto/relay" + "Open_IM/pkg/utils" "github.com/Shopify/sarama" "github.com/golang/protobuf/proto" ) @@ -53,7 +54,7 @@ func (ms *PushConsumerHandler) handleMs2PsChat(msg []byte) { sendPbData.PlatformID = pbData.PlatformID sendPbData.RecvSeq = pbData.RecvSeq //Call push module to send message to the user - MsgToUser(&sendPbData, pbData.OfflineInfo, pbData.Options) + MsgToUser(&sendPbData, pbData.OfflineInfo, utils.JsonStringToMap(pbData.Options)) } func (PushConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } func (PushConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index 8e6ad5db5..cc9e56177 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -71,7 +71,8 @@ func (rpc *rpcChat) UserSendMsg(_ context.Context, pb *pbChat.UserSendMsgReq) (* } else { pbData.SendTime = pb.SendTime } - isHistory := utils.GetSwitchFromOptions(pbData.Options, "history") + options := utils.JsonStringToMap(pbData.Options) + isHistory := utils.GetSwitchFromOptions(options, "history") mReq := MsgCallBackReq{ SendID: pb.SendID, RecvID: pb.RecvID, @@ -237,10 +238,12 @@ func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType i case constant.NotReceiveMessage: return false case constant.ReceiveNotNotifyMessage: - if msg.Options == nil { - msg.Options = make(map[string]int32, 2) + options := utils.JsonStringToMap(msg.Options) + if options == nil { + options = make(map[string]int32, 2) } - utils.SetSwitchFromOptions(msg.Options, "offlinePush", 0) + utils.SetSwitchFromOptions(options, "offlinePush", 0) + msg.Options = utils.MapIntToJsonString(options) return true } diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 93f64ff5f..4137616ea 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -198,14 +198,14 @@ func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgSvrToPu return errors.New("session == nil") } defer session.Close() - log.NewInfo("", "get mgoSession cost time", getCurrentTimestampByMill()-newTime) + log.NewDebug("", "get mgoSession cost time", getCurrentTimestampByMill()-newTime) c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) seqUid = getSeqUid(uid, m.RecvSeq) n, err := c.Find(bson.M{"uid": seqUid}).Count() if err != nil { return err } - log.NewInfo("", "find mgo uid cost time", getCurrentTimestampByMill()-newTime) + log.NewDebug("", "find mgo uid cost time", getCurrentTimestampByMill()-newTime) sMsg := MsgInfo{} sMsg.SendTime = sendTime if sMsg.Msg, err = proto.Marshal(m); err != nil { @@ -225,7 +225,7 @@ func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgSvrToPu return err } } - log.NewInfo("", "insert mgo data cost time", getCurrentTimestampByMill()-newTime) + log.NewDebug("", "insert mgo data cost time", getCurrentTimestampByMill()-newTime) return nil } diff --git a/pkg/proto/push/push.pb.go b/pkg/proto/push/push.pb.go index ea30d3911..b53d2b8a1 100644 --- a/pkg/proto/push/push.pb.go +++ b/pkg/proto/push/push.pb.go @@ -24,32 +24,32 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type PushMsgReq struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,7,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,9,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,10,opt,name=MsgID" json:"MsgID,omitempty"` - OfflineInfo string `protobuf:"bytes,11,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options map[string]int32 `protobuf:"bytes,12,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID" json:"PlatformID,omitempty"` - SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` + SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,7,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,9,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,10,opt,name=MsgID" json:"MsgID,omitempty"` + OfflineInfo string `protobuf:"bytes,11,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options string `protobuf:"bytes,12,opt,name=Options" json:"Options,omitempty"` + PlatformID int32 `protobuf:"varint,13,opt,name=PlatformID" json:"PlatformID,omitempty"` + SenderNickName string `protobuf:"bytes,14,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,15,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PushMsgReq) Reset() { *m = PushMsgReq{} } func (m *PushMsgReq) String() string { return proto.CompactTextString(m) } func (*PushMsgReq) ProtoMessage() {} func (*PushMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_push_380e4afdaa5f6119, []int{0} + return fileDescriptor_push_e44270f7d93180b9, []int{0} } func (m *PushMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgReq.Unmarshal(m, b) @@ -146,11 +146,11 @@ func (m *PushMsgReq) GetOfflineInfo() string { return "" } -func (m *PushMsgReq) GetOptions() map[string]int32 { +func (m *PushMsgReq) GetOptions() string { if m != nil { return m.Options } - return nil + return "" } func (m *PushMsgReq) GetPlatformID() int32 { @@ -192,7 +192,7 @@ func (m *PushMsgResp) Reset() { *m = PushMsgResp{} } func (m *PushMsgResp) String() string { return proto.CompactTextString(m) } func (*PushMsgResp) ProtoMessage() {} func (*PushMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_push_380e4afdaa5f6119, []int{1} + return fileDescriptor_push_e44270f7d93180b9, []int{1} } func (m *PushMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PushMsgResp.Unmarshal(m, b) @@ -221,7 +221,6 @@ func (m *PushMsgResp) GetResultCode() int32 { func init() { proto.RegisterType((*PushMsgReq)(nil), "push.PushMsgReq") - proto.RegisterMapType((map[string]int32)(nil), "push.PushMsgReq.OptionsEntry") proto.RegisterType((*PushMsgResp)(nil), "push.PushMsgResp") } @@ -297,35 +296,32 @@ var _PushMsgService_serviceDesc = grpc.ServiceDesc{ Metadata: "push/push.proto", } -func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_380e4afdaa5f6119) } - -var fileDescriptor_push_380e4afdaa5f6119 = []byte{ - // 426 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x5f, 0x6b, 0xdb, 0x30, - 0x14, 0xc5, 0x71, 0x13, 0x27, 0xed, 0x4d, 0xf3, 0x67, 0x62, 0x0c, 0x11, 0xd8, 0x30, 0x65, 0x8c, - 0xbc, 0xcc, 0x83, 0xee, 0x61, 0xa3, 0x7b, 0x19, 0xab, 0x57, 0x30, 0x2c, 0x6d, 0x51, 0xba, 0x97, - 0xbd, 0xb9, 0xe9, 0x4d, 0x6a, 0xea, 0x48, 0xaa, 0x25, 0x07, 0xf2, 0x11, 0xf7, 0xad, 0x86, 0xae,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, 0x00, +func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_e44270f7d93180b9) } + +var fileDescriptor_push_e44270f7d93180b9 = []byte{ + // 378 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x5d, 0xeb, 0xda, 0x30, + 0x14, 0xc6, 0xe9, 0xb4, 0xbe, 0x1c, 0xe7, 0xcb, 0xc2, 0x18, 0xc1, 0x8b, 0x51, 0x64, 0x0c, 0x6f, + 0xd6, 0xc1, 0x76, 0xb9, 0x9b, 0x31, 0x8b, 0x50, 0x98, 0x2f, 0xa4, 0xee, 0x66, 0x77, 0xb5, 0x9e, + 0x6a, 0x59, 0x9b, 0xc4, 0xa6, 0x0a, 0xfb, 0xd2, 0xfb, 0x0c, 0x23, 0x49, 0xd5, 0xfe, 0xbd, 0x29, + 0x7d, 0x7e, 0xe7, 0x39, 0x87, 0x27, 0xc9, 0x81, 0xb1, 0xbc, 0xa8, 0xd3, 0x67, 0xfd, 0xf1, 0x65, + 0x29, 0x2a, 0x41, 0xda, 0xfa, 0x7f, 0xf6, 0xaf, 0x05, 0xb0, 0xbd, 0xa8, 0xd3, 0x4a, 0x1d, 0x19, + 0x9e, 0xc9, 0x3b, 0xe8, 0x44, 0xc8, 0x0f, 0x61, 0x40, 0x1d, 0xcf, 0x99, 0xf7, 0x59, 0xad, 0x34, + 0x67, 0x98, 0x5c, 0xc3, 0x80, 0xbe, 0xb2, 0xdc, 0x2a, 0x42, 0xa1, 0xbb, 0x10, 0xbc, 0x42, 0x5e, + 0xd1, 0x96, 0x29, 0xdc, 0xa4, 0xae, 0x68, 0x4f, 0x84, 0x67, 0xda, 0xf6, 0x9c, 0x79, 0x8b, 0xdd, + 0x24, 0x99, 0x42, 0x4f, 0x4f, 0xdd, 0x65, 0x05, 0x52, 0xd7, 0x94, 0xee, 0x5a, 0x77, 0xad, 0xd4, + 0x71, 0x59, 0x8a, 0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, 0x13, 0x51, 0xf2, 0xc7, 0xf8, 0xf7, + 0xd0, 0x37, 0x7b, 0xf7, 0x4d, 0xee, 0x35, 0xdf, 0x77, 0xcc, 0xfe, 0x7d, 0xfd, 0x1f, 0x00, 0x00, + 0xff, 0xff, 0x6b, 0x53, 0xf4, 0xd4, 0x92, 0x02, 0x00, 0x00, } diff --git a/pkg/utils/map.go b/pkg/utils/map.go index fec4da23e..4b8f9fa8d 100644 --- a/pkg/utils/map.go +++ b/pkg/utils/map.go @@ -111,7 +111,7 @@ func MapIntToJsonString(param map[string]int32) string { dataString := string(dataType) return dataString } -func JsonStringToMap(str string) (tempMap map[string]interface{}) { +func JsonStringToMap(str string) (tempMap map[string]int32) { _ = json.Unmarshal([]byte(str), &tempMap) return tempMap } From eabef540cfbf1f9b3497581a0f9c303ad808f37a Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 10:51:20 +0800 Subject: [PATCH 39/47] pb change --- pkg/proto/chat/chat.pb.go | 293 +++++++++++++++++++------------------- 1 file changed, 143 insertions(+), 150 deletions(-) diff --git a/pkg/proto/chat/chat.pb.go b/pkg/proto/chat/chat.pb.go index 06118c3d1..dfe51b472 100644 --- a/pkg/proto/chat/chat.pb.go +++ b/pkg/proto/chat/chat.pb.go @@ -24,33 +24,33 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type WSToMsgSvrChatMsg struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - SendTime int64 `protobuf:"varint,4,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,5,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - SenderNickName string `protobuf:"bytes,6,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,7,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ContentType int32 `protobuf:"varint,8,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,9,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,11,opt,name=MsgID" json:"MsgID,omitempty"` - Token string `protobuf:"bytes,12,opt,name=Token" json:"Token,omitempty"` - OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options map[string]int32 `protobuf:"bytes,14,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` - ForceList []string `protobuf:"bytes,16,rep,name=ForceList" json:"ForceList,omitempty"` - ClientMsgID string `protobuf:"bytes,17,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + SendTime int64 `protobuf:"varint,4,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,5,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + SenderNickName string `protobuf:"bytes,6,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,7,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ContentType int32 `protobuf:"varint,8,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,11,opt,name=MsgID" json:"MsgID,omitempty"` + Token string `protobuf:"bytes,12,opt,name=Token" json:"Token,omitempty"` + OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` + PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` + ForceList []string `protobuf:"bytes,16,rep,name=ForceList" json:"ForceList,omitempty"` + ClientMsgID string `protobuf:"bytes,17,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *WSToMsgSvrChatMsg) Reset() { *m = WSToMsgSvrChatMsg{} } func (m *WSToMsgSvrChatMsg) String() string { return proto.CompactTextString(m) } func (*WSToMsgSvrChatMsg) ProtoMessage() {} func (*WSToMsgSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{0} + return fileDescriptor_chat_163a8d226aa6edb5, []int{0} } func (m *WSToMsgSvrChatMsg) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_WSToMsgSvrChatMsg.Unmarshal(m, b) @@ -161,11 +161,11 @@ func (m *WSToMsgSvrChatMsg) GetOfflineInfo() string { return "" } -func (m *WSToMsgSvrChatMsg) GetOptions() map[string]int32 { +func (m *WSToMsgSvrChatMsg) GetOptions() string { if m != nil { return m.Options } - return nil + return "" } func (m *WSToMsgSvrChatMsg) GetPlatformID() int32 { @@ -190,32 +190,32 @@ func (m *WSToMsgSvrChatMsg) GetClientMsgID() string { } type MsgSvrToPushSvrChatMsg struct { - SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` - RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` - Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` - RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` - SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` - MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - SenderNickName string `protobuf:"bytes,7,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,8,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - ContentType int32 `protobuf:"varint,9,opt,name=ContentType" json:"ContentType,omitempty"` - SessionType int32 `protobuf:"varint,10,opt,name=SessionType" json:"SessionType,omitempty"` - OperationID string `protobuf:"bytes,11,opt,name=OperationID" json:"OperationID,omitempty"` - MsgID string `protobuf:"bytes,12,opt,name=MsgID" json:"MsgID,omitempty"` - OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` - Options map[string]int32 `protobuf:"bytes,14,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` - ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + SendID string `protobuf:"bytes,1,opt,name=SendID" json:"SendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=Content" json:"Content,omitempty"` + RecvSeq int64 `protobuf:"varint,4,opt,name=RecvSeq" json:"RecvSeq,omitempty"` + SendTime int64 `protobuf:"varint,5,opt,name=SendTime" json:"SendTime,omitempty"` + MsgFrom int32 `protobuf:"varint,6,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + SenderNickName string `protobuf:"bytes,7,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,8,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + ContentType int32 `protobuf:"varint,9,opt,name=ContentType" json:"ContentType,omitempty"` + SessionType int32 `protobuf:"varint,10,opt,name=SessionType" json:"SessionType,omitempty"` + OperationID string `protobuf:"bytes,11,opt,name=OperationID" json:"OperationID,omitempty"` + MsgID string `protobuf:"bytes,12,opt,name=MsgID" json:"MsgID,omitempty"` + OfflineInfo string `protobuf:"bytes,13,opt,name=OfflineInfo" json:"OfflineInfo,omitempty"` + Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` + PlatformID int32 `protobuf:"varint,15,opt,name=PlatformID" json:"PlatformID,omitempty"` + ClientMsgID string `protobuf:"bytes,16,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *MsgSvrToPushSvrChatMsg) Reset() { *m = MsgSvrToPushSvrChatMsg{} } func (m *MsgSvrToPushSvrChatMsg) String() string { return proto.CompactTextString(m) } func (*MsgSvrToPushSvrChatMsg) ProtoMessage() {} func (*MsgSvrToPushSvrChatMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{1} + return fileDescriptor_chat_163a8d226aa6edb5, []int{1} } func (m *MsgSvrToPushSvrChatMsg) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgSvrToPushSvrChatMsg.Unmarshal(m, b) @@ -326,11 +326,11 @@ func (m *MsgSvrToPushSvrChatMsg) GetOfflineInfo() string { return "" } -func (m *MsgSvrToPushSvrChatMsg) GetOptions() map[string]int32 { +func (m *MsgSvrToPushSvrChatMsg) GetOptions() string { if m != nil { return m.Options } - return nil + return "" } func (m *MsgSvrToPushSvrChatMsg) GetPlatformID() int32 { @@ -361,7 +361,7 @@ func (m *PullMessageReq) Reset() { *m = PullMessageReq{} } func (m *PullMessageReq) String() string { return proto.CompactTextString(m) } func (*PullMessageReq) ProtoMessage() {} func (*PullMessageReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{2} + return fileDescriptor_chat_163a8d226aa6edb5, []int{2} } func (m *PullMessageReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageReq.Unmarshal(m, b) @@ -425,7 +425,7 @@ func (m *PullMessageResp) Reset() { *m = PullMessageResp{} } func (m *PullMessageResp) String() string { return proto.CompactTextString(m) } func (*PullMessageResp) ProtoMessage() {} func (*PullMessageResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{3} + return fileDescriptor_chat_163a8d226aa6edb5, []int{3} } func (m *PullMessageResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageResp.Unmarshal(m, b) @@ -500,7 +500,7 @@ func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListReq) ProtoMessage() {} func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{4} + return fileDescriptor_chat_163a8d226aa6edb5, []int{4} } func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) @@ -553,7 +553,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{5} + return fileDescriptor_chat_163a8d226aa6edb5, []int{5} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -601,7 +601,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{6} + return fileDescriptor_chat_163a8d226aa6edb5, []int{6} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -663,7 +663,7 @@ func (m *GatherFormat) Reset() { *m = GatherFormat{} } func (m *GatherFormat) String() string { return proto.CompactTextString(m) } func (*GatherFormat) ProtoMessage() {} func (*GatherFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{7} + return fileDescriptor_chat_163a8d226aa6edb5, []int{7} } func (m *GatherFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GatherFormat.Unmarshal(m, b) @@ -731,7 +731,7 @@ func (m *MsgFormat) Reset() { *m = MsgFormat{} } func (m *MsgFormat) String() string { return proto.CompactTextString(m) } func (*MsgFormat) ProtoMessage() {} func (*MsgFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{8} + return fileDescriptor_chat_163a8d226aa6edb5, []int{8} } func (m *MsgFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgFormat.Unmarshal(m, b) @@ -836,34 +836,34 @@ func (m *MsgFormat) GetClientMsgID() string { } type UserSendMsgReq struct { - ReqIdentifier int32 `protobuf:"varint,1,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` - SendID string `protobuf:"bytes,3,opt,name=SendID" json:"SendID,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` - SenderNickName string `protobuf:"bytes,5,opt,name=SenderNickName" json:"SenderNickName,omitempty"` - SenderFaceURL string `protobuf:"bytes,6,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` - PlatformID int32 `protobuf:"varint,7,opt,name=PlatformID" json:"PlatformID,omitempty"` - SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` - MsgFrom int32 `protobuf:"varint,9,opt,name=MsgFrom" json:"MsgFrom,omitempty"` - ContentType int32 `protobuf:"varint,10,opt,name=ContentType" json:"ContentType,omitempty"` - RecvID string `protobuf:"bytes,11,opt,name=RecvID" json:"RecvID,omitempty"` - ForceList []string `protobuf:"bytes,12,rep,name=ForceList" json:"ForceList,omitempty"` - Content string `protobuf:"bytes,13,opt,name=Content" json:"Content,omitempty"` - Options map[string]int32 `protobuf:"bytes,14,rep,name=Options" json:"Options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - ClientMsgID string `protobuf:"bytes,15,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` - OffLineInfo string `protobuf:"bytes,16,opt,name=OffLineInfo" json:"OffLineInfo,omitempty"` - Ex string `protobuf:"bytes,17,opt,name=Ex" json:"Ex,omitempty"` - SendTime int64 `protobuf:"varint,18,opt,name=sendTime" json:"sendTime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + ReqIdentifier int32 `protobuf:"varint,1,opt,name=ReqIdentifier" json:"ReqIdentifier,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` + SendID string `protobuf:"bytes,3,opt,name=SendID" json:"SendID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + SenderNickName string `protobuf:"bytes,5,opt,name=SenderNickName" json:"SenderNickName,omitempty"` + SenderFaceURL string `protobuf:"bytes,6,opt,name=SenderFaceURL" json:"SenderFaceURL,omitempty"` + PlatformID int32 `protobuf:"varint,7,opt,name=PlatformID" json:"PlatformID,omitempty"` + SessionType int32 `protobuf:"varint,8,opt,name=SessionType" json:"SessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,9,opt,name=MsgFrom" json:"MsgFrom,omitempty"` + ContentType int32 `protobuf:"varint,10,opt,name=ContentType" json:"ContentType,omitempty"` + RecvID string `protobuf:"bytes,11,opt,name=RecvID" json:"RecvID,omitempty"` + ForceList []string `protobuf:"bytes,12,rep,name=ForceList" json:"ForceList,omitempty"` + Content string `protobuf:"bytes,13,opt,name=Content" json:"Content,omitempty"` + Options string `protobuf:"bytes,14,opt,name=Options" json:"Options,omitempty"` + ClientMsgID string `protobuf:"bytes,15,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"` + OffLineInfo string `protobuf:"bytes,16,opt,name=OffLineInfo" json:"OffLineInfo,omitempty"` + Ex string `protobuf:"bytes,17,opt,name=Ex" json:"Ex,omitempty"` + SendTime int64 `protobuf:"varint,18,opt,name=sendTime" json:"sendTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } func (*UserSendMsgReq) ProtoMessage() {} func (*UserSendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{9} + return fileDescriptor_chat_163a8d226aa6edb5, []int{9} } func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) @@ -974,11 +974,11 @@ func (m *UserSendMsgReq) GetContent() string { return "" } -func (m *UserSendMsgReq) GetOptions() map[string]int32 { +func (m *UserSendMsgReq) GetOptions() string { if m != nil { return m.Options } - return nil + return "" } func (m *UserSendMsgReq) GetClientMsgID() string { @@ -1025,7 +1025,7 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_chat_3707ac912effe95d, []int{10} + return fileDescriptor_chat_163a8d226aa6edb5, []int{10} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -1089,9 +1089,7 @@ func (m *UserSendMsgResp) GetSendTime() int64 { func init() { proto.RegisterType((*WSToMsgSvrChatMsg)(nil), "pbChat.WSToMsgSvrChatMsg") - proto.RegisterMapType((map[string]int32)(nil), "pbChat.WSToMsgSvrChatMsg.OptionsEntry") proto.RegisterType((*MsgSvrToPushSvrChatMsg)(nil), "pbChat.MsgSvrToPushSvrChatMsg") - proto.RegisterMapType((map[string]int32)(nil), "pbChat.MsgSvrToPushSvrChatMsg.OptionsEntry") proto.RegisterType((*PullMessageReq)(nil), "pbChat.PullMessageReq") proto.RegisterType((*PullMessageResp)(nil), "pbChat.PullMessageResp") proto.RegisterType((*PullMessageBySeqListReq)(nil), "pbChat.PullMessageBySeqListReq") @@ -1100,7 +1098,6 @@ func init() { proto.RegisterType((*GatherFormat)(nil), "pbChat.GatherFormat") proto.RegisterType((*MsgFormat)(nil), "pbChat.MsgFormat") proto.RegisterType((*UserSendMsgReq)(nil), "pbChat.UserSendMsgReq") - proto.RegisterMapType((map[string]int32)(nil), "pbChat.UserSendMsgReq.OptionsEntry") proto.RegisterType((*UserSendMsgResp)(nil), "pbChat.UserSendMsgResp") } @@ -1275,74 +1272,70 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ Metadata: "chat/chat.proto", } -func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_3707ac912effe95d) } - -var fileDescriptor_chat_3707ac912effe95d = []byte{ - // 1049 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x97, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 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 0x0a, 0x61, 0x33, 0x0b, 0xe1, 0x84, 0x02, 0xe4, 0xd3, 0x0a, 0x90, 0xa8, 0x9c, 0x95, 0xae, - 0x9c, 0x5a, 0x87, 0x82, 0x5e, 0x87, 0x97, 0xbf, 0x1b, 0x90, 0xe7, 0x5d, 0x42, 0x3f, 0x42, 0x3d, - 0x21, 0xd2, 0xa8, 0xb9, 0x19, 0x4d, 0xa9, 0x69, 0xd0, 0xfc, 0x78, 0xeb, 0x33, 0xb6, 0x42, 0xaf, - 0xa1, 0xac, 0xcc, 0x2b, 0x74, 0x18, 0xc5, 0xea, 0x17, 0x86, 0xe6, 0xb3, 0x4c, 0x3f, 0x5b, 0xa1, - 0x4b, 0x38, 0xc8, 0x9a, 0x77, 0xe8, 0xb3, 0x8c, 0x05, 0xea, 0x34, 0xdc, 0xbe, 0xe3, 0x6b, 0x28, - 0x2b, 0x1d, 0x8b, 0x4f, 0xa4, 0xb3, 0x19, 0xaf, 0x4f, 0xb4, 0xf7, 0xb8, 0xfe, 0x73, 0xb5, 0x2b, - 0x7e, 0xe1, 0x7d, 0x2b, 0x03, 0xde, 0x15, 0xc4, 0x2f, 0xbd, 0x6f, 0xfe, 0x0d, 0x00, 0x00, 0xff, - 0xff, 0xa2, 0x9b, 0xc2, 0xf2, 0xfc, 0x0d, 0x00, 0x00, +func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_163a8d226aa6edb5) } + +var fileDescriptor_chat_163a8d226aa6edb5 = []byte{ + // 981 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xdd, 0x6a, 0xe3, 0x46, + 0x14, 0xc6, 0x92, 0x2d, 0xdb, 0xc7, 0xbf, 0x99, 0x86, 0xec, 0x90, 0x96, 0xd6, 0x88, 0x6d, 0x31, + 0xbd, 0x48, 0x61, 0x7b, 0x53, 0x5a, 0x58, 0x68, 0x62, 0x27, 0xa8, 0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0x29, 0xd2, 0xf2, 0x20, 0x1a, 0x41, 0x27, 0xb9, 0xce, 0xfc, 0x5d, 0x44, 0x70, 0x4b, + 0x9c, 0xa5, 0x42, 0x3c, 0x63, 0x46, 0x18, 0xf3, 0xc3, 0x40, 0x64, 0xb4, 0x65, 0x86, 0x02, 0xf1, + 0x8c, 0x57, 0x11, 0xa1, 0x6e, 0xec, 0x87, 0x81, 0x35, 0xc1, 0x20, 0xce, 0x51, 0x21, 0x74, 0x08, + 0x0d, 0x9b, 0x79, 0xd6, 0x04, 0x77, 0xc4, 0x37, 0x19, 0x70, 0x74, 0x1e, 0xbe, 0x25, 0x01, 0xee, + 0x4a, 0x54, 0x04, 0x62, 0xb7, 0xd5, 0x6a, 0xed, 0x07, 0xc4, 0x0a, 0x56, 0x21, 0xee, 0x25, 0xbb, + 0x65, 0x10, 0xef, 0xcd, 0xab, 0x88, 0xef, 0xcc, 0x70, 0x5f, 0x76, 0x34, 0x09, 0xd1, 0xe7, 0x00, + 0xd7, 0x6b, 0x37, 0x5e, 0x85, 0x74, 0x63, 0x4d, 0xf0, 0x40, 0x5c, 0x55, 0x41, 0xd0, 0x67, 0xd0, + 0x3e, 0x0f, 0xe9, 0x82, 0x5c, 0xfa, 0x2c, 0xc6, 0xc3, 0x91, 0x3e, 0x6e, 0x3b, 0x19, 0x20, 0x7a, + 0xb1, 0xf6, 0x49, 0x10, 0xcb, 0xbb, 0x1e, 0xc8, 0x93, 0x15, 0xc8, 0xfc, 0x47, 0x87, 0x23, 0xa9, + 0x86, 0x79, 0x78, 0x7d, 0xcb, 0x6e, 0x3e, 0x88, 0x2c, 0x30, 0x34, 0x79, 0xce, 0x8c, 0x6c, 0x13, + 0x55, 0xa4, 0x61, 0x4e, 0x30, 0x8d, 0xfd, 0x82, 0x31, 0x1e, 0x13, 0x4c, 0xf3, 0x69, 0x82, 0x69, + 0x3d, 0x41, 0x30, 0xed, 0x47, 0x05, 0x03, 0x8f, 0x0a, 0xa6, 0xf3, 0x80,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99, + 0xf0, 0xc6, 0x10, 0xff, 0xbb, 0x7c, 0xfb, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x44, 0x4e, + 0x52, 0xce, 0x0c, 0x00, 0x00, } From 776fa2f4f6252523c8ddc437fedbcf1b70e473f2 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 11:04:05 +0800 Subject: [PATCH 40/47] pb change --- internal/push/logic/push_rpc_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/logic/push_rpc_server.go b/internal/push/logic/push_rpc_server.go index ca0e93880..570f5c28b 100644 --- a/internal/push/logic/push_rpc_server.go +++ b/internal/push/logic/push_rpc_server.go @@ -65,7 +65,7 @@ func (r *RPCServer) PushMsg(_ context.Context, pbData *pbPush.PushMsgReq) (*pbPu sendPbData.PlatformID = pbData.PlatformID sendPbData.RecvSeq = pbData.RecvSeq //Call push module to send message to the user - MsgToUser(&sendPbData, pbData.OfflineInfo, pbData.Options) + MsgToUser(&sendPbData, pbData.OfflineInfo, utils.JsonStringToMap(pbData.Options)) return &pbPush.PushMsgResp{ ResultCode: 0, }, nil From 2ace964573e35f7d4279cc570c679c6e4c37990e Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 10 Dec 2021 11:07:44 +0800 Subject: [PATCH 41/47] pb: open_im_sdk.OfflinePushInfo --- internal/rpc/chat/send_msg.go | 3 +- pkg/proto/sdk_ws/ws.pb.go | 181 ++++++++++++++++++++++------------ pkg/proto/sdk_ws/ws.proto | 6 ++ 3 files changed, 127 insertions(+), 63 deletions(-) diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index cc9e56177..69022b3e1 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -11,6 +11,7 @@ import ( "Open_IM/pkg/grpc-etcdv3/getcdv3" pbChat "Open_IM/pkg/proto/chat" pbGroup "Open_IM/pkg/proto/group" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" "Open_IM/pkg/utils" "context" "encoding/json" @@ -202,7 +203,7 @@ type WSToMsgSvrChatMsg struct { OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` } -func Notification(m *WSToMsgSvrChatMsg, onlineUserOnly bool, offlineInfo interface{}) { +func Notification(m *WSToMsgSvrChatMsg, onlineUserOnly bool, offlineInfo open_im_sdk.OfflinePushInfo) { } func (rpc *rpcChat) sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string) error { diff --git a/pkg/proto/sdk_ws/ws.pb.go b/pkg/proto/sdk_ws/ws.pb.go index effde5aa0..573046eb9 100644 --- a/pkg/proto/sdk_ws/ws.pb.go +++ b/pkg/proto/sdk_ws/ws.pb.go @@ -32,7 +32,7 @@ func (m *PullMessageBySeqListResp) Reset() { *m = PullMessageBySeqListRe func (m *PullMessageBySeqListResp) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListResp) ProtoMessage() {} func (*PullMessageBySeqListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{0} + return fileDescriptor_ws_ff6df30c494aaf36, []int{0} } func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) @@ -91,7 +91,7 @@ func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListReq) ProtoMessage() {} func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{1} + return fileDescriptor_ws_ff6df30c494aaf36, []int{1} } func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) @@ -128,7 +128,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{2} + return fileDescriptor_ws_ff6df30c494aaf36, []int{2} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -160,7 +160,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{3} + return fileDescriptor_ws_ff6df30c494aaf36, []int{3} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -208,7 +208,7 @@ func (m *GatherFormat) Reset() { *m = GatherFormat{} } func (m *GatherFormat) String() string { return proto.CompactTextString(m) } func (*GatherFormat) ProtoMessage() {} func (*GatherFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{4} + return fileDescriptor_ws_ff6df30c494aaf36, []int{4} } func (m *GatherFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GatherFormat.Unmarshal(m, b) @@ -276,7 +276,7 @@ func (m *MsgFormat) Reset() { *m = MsgFormat{} } func (m *MsgFormat) String() string { return proto.CompactTextString(m) } func (*MsgFormat) ProtoMessage() {} func (*MsgFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{5} + return fileDescriptor_ws_ff6df30c494aaf36, []int{5} } func (m *MsgFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgFormat.Unmarshal(m, b) @@ -401,7 +401,7 @@ func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } func (*UserSendMsgReq) ProtoMessage() {} func (*UserSendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{6} + return fileDescriptor_ws_ff6df30c494aaf36, []int{6} } func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) @@ -511,7 +511,7 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{7} + return fileDescriptor_ws_ff6df30c494aaf36, []int{7} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -575,7 +575,7 @@ func (m *MsgData) Reset() { *m = MsgData{} } func (m *MsgData) String() string { return proto.CompactTextString(m) } func (*MsgData) ProtoMessage() {} func (*MsgData) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_f143de4f947df40f, []int{8} + return fileDescriptor_ws_ff6df30c494aaf36, []int{8} } func (m *MsgData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgData.Unmarshal(m, b) @@ -686,6 +686,60 @@ func (m *MsgData) GetClientMsgID() string { return "" } +type OfflinePushInfo struct { + Title string `protobuf:"bytes,1,opt,name=Title" json:"Title,omitempty"` + Desc string `protobuf:"bytes,2,opt,name=Desc" json:"Desc,omitempty"` + Ext string `protobuf:"bytes,3,opt,name=Ext" json:"Ext,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OfflinePushInfo) Reset() { *m = OfflinePushInfo{} } +func (m *OfflinePushInfo) String() string { return proto.CompactTextString(m) } +func (*OfflinePushInfo) ProtoMessage() {} +func (*OfflinePushInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_ff6df30c494aaf36, []int{9} +} +func (m *OfflinePushInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OfflinePushInfo.Unmarshal(m, b) +} +func (m *OfflinePushInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OfflinePushInfo.Marshal(b, m, deterministic) +} +func (dst *OfflinePushInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_OfflinePushInfo.Merge(dst, src) +} +func (m *OfflinePushInfo) XXX_Size() int { + return xxx_messageInfo_OfflinePushInfo.Size(m) +} +func (m *OfflinePushInfo) XXX_DiscardUnknown() { + xxx_messageInfo_OfflinePushInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_OfflinePushInfo proto.InternalMessageInfo + +func (m *OfflinePushInfo) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *OfflinePushInfo) GetDesc() string { + if m != nil { + return m.Desc + } + return "" +} + +func (m *OfflinePushInfo) GetExt() string { + if m != nil { + return m.Ext + } + return "" +} + func init() { proto.RegisterType((*PullMessageBySeqListResp)(nil), "open_im_sdk.PullMessageBySeqListResp") proto.RegisterType((*PullMessageBySeqListReq)(nil), "open_im_sdk.PullMessageBySeqListReq") @@ -697,57 +751,60 @@ func init() { proto.RegisterMapType((map[string]int32)(nil), "open_im_sdk.UserSendMsgReq.OptionsEntry") proto.RegisterType((*UserSendMsgResp)(nil), "open_im_sdk.UserSendMsgResp") proto.RegisterType((*MsgData)(nil), "open_im_sdk.MsgData") -} - -func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_f143de4f947df40f) } - -var fileDescriptor_ws_f143de4f947df40f = []byte{ - // 739 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4b, 0x6b, 0xdb, 0x4a, - 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2d, 0xd9, 0x2e, 0x54, 0x1e, 0x82, 0xe9, 0xbd, 0xa2, 0xb5, 0xc2, 0x55, 0x71, 0x62, 0xbf, - 0xb4, 0xfc, 0x19, 0x6c, 0x1b, 0x0a, 0x61, 0xba, 0xec, 0x74, 0x6b, 0xd5, 0xe9, 0x4b, 0x4f, 0xb2, - 0x57, 0x9e, 0x44, 0xfe, 0xc6, 0xd2, 0xdf, 0x8e, 0xf2, 0x77, 0x59, 0xfb, 0x5f, 0x1d, 0xc9, 0x6e, - 0x37, 0xc8, 0x03, 0x22, 0x0b, 0x8d, 0x04, 0xe3, 0x22, 0xc1, 0x99, 0x91, 0x60, 0x55, 0xd1, 0xcd, - 0xa8, 0x49, 0xa7, 0x52, 0xac, 0x43, 0x44, 0x64, 0x54, 0x48, 0xa7, 0x94, 0x2f, 0x4b, 0xea, 0x1d, - 0x6a, 0xd2, 0x15, 0xb2, 0x0f, 0xcd, 0x8c, 0xa3, 0x36, 0xb9, 0x4a, 0xb1, 0x0e, 0xd1, 0xe9, 0x45, - 0x83, 0x94, 0xde, 0xe5, 0x65, 0x69, 0x4c, 0x5c, 0x37, 0x27, 0x26, 0x41, 0x50, 0xcc, 0x64, 0x88, - 0x1d, 0x4e, 0x4b, 0xca, 0x38, 0x2e, 0x67, 0x1c, 0x54, 0xc6, 0x71, 0x4d, 0xc6, 0xd1, 0x0c, 0x87, - 0xf2, 0xc0, 0x12, 0x4a, 0xe1, 0x40, 0x23, 0x1c, 0x2a, 0xbf, 0x26, 0x28, 0x59, 0xd0, 0xb4, 0xdb, - 0x54, 0x33, 0x6a, 0xd0, 0xe9, 0xde, 0xc7, 0xdd, 0xce, 0xa1, 0xfa, 0x61, 0xbe, 0xd2, 0x92, 0xfc, - 0xa9, 0x2a, 0x7f, 0x9d, 0xc7, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x38, 0x51, 0xff, 0xb4, 0x4d, - 0x07, 0x00, 0x00, + proto.RegisterType((*OfflinePushInfo)(nil), "open_im_sdk.OfflinePushInfo") +} + +func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_ff6df30c494aaf36) } + +var fileDescriptor_ws_ff6df30c494aaf36 = []byte{ + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x5b, 0x6b, 0x1a, 0x41, + 0x14, 0xc6, 0x5d, 0x6f, 0x7b, 0x34, 0x17, 0xa6, 0x21, 0xdd, 0x86, 0x52, 0x64, 0x29, 0x45, 0xf2, + 0x60, 0x20, 0x79, 0x29, 0x29, 0xa5, 0x34, 0x35, 0x09, 0x96, 0x98, 0x84, 0x35, 0x79, 0xe9, 0x4b, + 0xd8, 0xea, 0x68, 0x16, 0xf7, 0xa2, 0x7b, 0xd6, 0x24, 0xfe, 0x98, 0xfe, 0xa1, 0x3e, 0xf4, 0x1f, + 0x15, 0xca, 0x99, 0xd9, 0x35, 0x33, 0x2a, 0x6d, 0xdf, 0xe6, 0x7c, 0xce, 0x99, 0x99, 0xf3, 0x5d, + 0x5c, 0xd8, 0xc2, 0xc1, 0xf8, 0xee, 0x11, 0x0f, 0x1e, 0xb1, 0x35, 0x49, 0xe2, 0x34, 0x66, 0xb5, + 0x78, 0xc2, 0xa3, 0x3b, 0x3f, 0xbc, 0xc3, 0xc1, 0xd8, 0xf9, 0x59, 0x00, 0xfb, 0x7a, 0x16, 0x04, + 0x5d, 0x8e, 0xe8, 0x8d, 0xf8, 0xc9, 0xbc, 0xc7, 0xa7, 0x17, 0x3e, 0xa6, 0x2e, 0xc7, 0x09, 0xdb, + 0x85, 0x72, 0xd7, 0x7b, 0xea, 0xf1, 0xa9, 0x5d, 0x68, 0x14, 0x9a, 0xa6, 0x9b, 0x55, 0x02, 0xf7, + 0x23, 0xc2, 0x8d, 0x0c, 0x17, 0x15, 0xfb, 0x04, 0x1b, 0x3d, 0x3f, 0x1a, 0x05, 0xfc, 0x16, 0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0a, 0xe4, 0x74, 0x61, 0xeb, 0x6a, 0x38, 0x0c, 0xfc, 0x88, 0x5f, 0xcf, 0xf0, 0xbe, 0x13, + 0x0d, 0x63, 0xf2, 0xcf, 0x8d, 0x9f, 0x06, 0x3c, 0x53, 0x49, 0x16, 0x8c, 0x41, 0xb1, 0xcd, 0xb1, + 0x9f, 0x49, 0x24, 0xd6, 0x34, 0xea, 0xe9, 0x53, 0x9a, 0xe5, 0x92, 0x96, 0x27, 0xbb, 0xdf, 0x76, + 0x5a, 0x07, 0xf2, 0xfb, 0xfb, 0x41, 0xf9, 0x63, 0xf8, 0x5e, 0x16, 0x5f, 0xe2, 0xa3, 0x3f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xf1, 0x1f, 0x85, 0x3b, 0x9c, 0x07, 0x00, 0x00, } diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index 589e97a21..259d726a8 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -87,3 +87,9 @@ message MsgData { string clientMsgID =13; } +message OfflinePushInfo{ + string Title = 1; + string Desc = 2; + string Ext = 3; +} + From 0ed9aa5372c32175b75e89e0abb88db3c2539e1c Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 17:00:24 +0800 Subject: [PATCH 42/47] sender message sync --- internal/msg_gateway/gate/rpc_server.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go index 7a0632fad..972cf30f4 100644 --- a/internal/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -115,6 +115,16 @@ func (r *RPCServer) MsgToUser(_ context.Context, in *pbRelay.MsgToUserReq) (*pbR resp = append(resp, temp) } } + //Single chat sender synchronization message + if in.GetSessionType() == constant.SingleChatType { + userIDList = genUidPlatformArray(in.SendID) + for _, v := range userIDList { + UIDAndPID = strings.Split(v, " ") + if conn := ws.getUserConn(v); conn != nil { + _ = sendMsgToUser(conn, replyBytes.Bytes(), in, UIDAndPID[1], UIDAndPID[0]) + } + } + } if !tag { log.NewError(in.OperationID, "push err ,no matched ws conn not in map", in.String()) } From 59fffc6fbe2034d85315a776f86a8cae9ff23369 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 17:18:20 +0800 Subject: [PATCH 43/47] server version update --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index 02dbc6638..e67ac4fee 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,7 +1,7 @@ # The class cannot be named by Pascal or camel case. # If it is not used, the corresponding structure will not be set, # and it will not be read naturally. -serverversion: 1.0.3 +serverversion: 1.0.6 #---------------Infrastructure configuration---------------------# etcd: etcdSchema: openIM From 8b4da904973fc86e2dffc4f901695ebd984b5891 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Fri, 10 Dec 2021 17:30:11 +0800 Subject: [PATCH 44/47] pb --- internal/rpc/chat/send_msg.go | 11 + pkg/proto/sdk_ws/ws.pb.go | 398 ++++++++++++++++++++++++++++------ pkg/proto/sdk_ws/ws.proto | 33 +++ pkg/utils/utils.go | 11 +- 4 files changed, 380 insertions(+), 73 deletions(-) diff --git a/internal/rpc/chat/send_msg.go b/internal/rpc/chat/send_msg.go index 69022b3e1..d237c2507 100644 --- a/internal/rpc/chat/send_msg.go +++ b/internal/rpc/chat/send_msg.go @@ -203,9 +203,20 @@ type WSToMsgSvrChatMsg struct { OperationID string `protobuf:"bytes,10,opt,name=OperationID" json:"OperationID,omitempty"` } +func CreateGroupNotification(SendID, RecvID string, tip open_im_sdk.CreateGroupTip) { + var msg WSToMsgSvrChatMsg + msg.OperationID = utils.OperationIDGenerator() + msg.SendID = SendID + msg.RecvID = RecvID + msg.ContentType = constant.CreateGroupTip + msg.SessionType = constant.SysMsgType + +} + func Notification(m *WSToMsgSvrChatMsg, onlineUserOnly bool, offlineInfo open_im_sdk.OfflinePushInfo) { } + func (rpc *rpcChat) sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string) error { pid, offset, err := rpc.producer.SendMessage(m, key) if err != nil { diff --git a/pkg/proto/sdk_ws/ws.pb.go b/pkg/proto/sdk_ws/ws.pb.go index 573046eb9..7e1115f94 100644 --- a/pkg/proto/sdk_ws/ws.pb.go +++ b/pkg/proto/sdk_ws/ws.pb.go @@ -32,7 +32,7 @@ func (m *PullMessageBySeqListResp) Reset() { *m = PullMessageBySeqListRe func (m *PullMessageBySeqListResp) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListResp) ProtoMessage() {} func (*PullMessageBySeqListResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{0} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{0} } func (m *PullMessageBySeqListResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListResp.Unmarshal(m, b) @@ -91,7 +91,7 @@ func (m *PullMessageBySeqListReq) Reset() { *m = PullMessageBySeqListReq func (m *PullMessageBySeqListReq) String() string { return proto.CompactTextString(m) } func (*PullMessageBySeqListReq) ProtoMessage() {} func (*PullMessageBySeqListReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{1} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{1} } func (m *PullMessageBySeqListReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PullMessageBySeqListReq.Unmarshal(m, b) @@ -128,7 +128,7 @@ func (m *GetMaxAndMinSeqReq) Reset() { *m = GetMaxAndMinSeqReq{} } func (m *GetMaxAndMinSeqReq) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqReq) ProtoMessage() {} func (*GetMaxAndMinSeqReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{2} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{2} } func (m *GetMaxAndMinSeqReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqReq.Unmarshal(m, b) @@ -160,7 +160,7 @@ func (m *GetMaxAndMinSeqResp) Reset() { *m = GetMaxAndMinSeqResp{} } func (m *GetMaxAndMinSeqResp) String() string { return proto.CompactTextString(m) } func (*GetMaxAndMinSeqResp) ProtoMessage() {} func (*GetMaxAndMinSeqResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{3} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{3} } func (m *GetMaxAndMinSeqResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetMaxAndMinSeqResp.Unmarshal(m, b) @@ -208,7 +208,7 @@ func (m *GatherFormat) Reset() { *m = GatherFormat{} } func (m *GatherFormat) String() string { return proto.CompactTextString(m) } func (*GatherFormat) ProtoMessage() {} func (*GatherFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{4} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{4} } func (m *GatherFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GatherFormat.Unmarshal(m, b) @@ -276,7 +276,7 @@ func (m *MsgFormat) Reset() { *m = MsgFormat{} } func (m *MsgFormat) String() string { return proto.CompactTextString(m) } func (*MsgFormat) ProtoMessage() {} func (*MsgFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{5} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{5} } func (m *MsgFormat) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgFormat.Unmarshal(m, b) @@ -401,7 +401,7 @@ func (m *UserSendMsgReq) Reset() { *m = UserSendMsgReq{} } func (m *UserSendMsgReq) String() string { return proto.CompactTextString(m) } func (*UserSendMsgReq) ProtoMessage() {} func (*UserSendMsgReq) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{6} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{6} } func (m *UserSendMsgReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgReq.Unmarshal(m, b) @@ -511,7 +511,7 @@ func (m *UserSendMsgResp) Reset() { *m = UserSendMsgResp{} } func (m *UserSendMsgResp) String() string { return proto.CompactTextString(m) } func (*UserSendMsgResp) ProtoMessage() {} func (*UserSendMsgResp) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{7} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{7} } func (m *UserSendMsgResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserSendMsgResp.Unmarshal(m, b) @@ -575,7 +575,7 @@ func (m *MsgData) Reset() { *m = MsgData{} } func (m *MsgData) String() string { return proto.CompactTextString(m) } func (*MsgData) ProtoMessage() {} func (*MsgData) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{8} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{8} } func (m *MsgData) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MsgData.Unmarshal(m, b) @@ -699,7 +699,7 @@ func (m *OfflinePushInfo) Reset() { *m = OfflinePushInfo{} } func (m *OfflinePushInfo) String() string { return proto.CompactTextString(m) } func (*OfflinePushInfo) ProtoMessage() {} func (*OfflinePushInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ws_ff6df30c494aaf36, []int{9} + return fileDescriptor_ws_d55c44e342c7a2b5, []int{9} } func (m *OfflinePushInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OfflinePushInfo.Unmarshal(m, b) @@ -740,6 +740,256 @@ func (m *OfflinePushInfo) GetExt() string { return "" } +type GroupInfoTip struct { + GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=GroupName" json:"GroupName,omitempty"` + Notification string `protobuf:"bytes,3,opt,name=Notification" json:"Notification,omitempty"` + Introduction string `protobuf:"bytes,4,opt,name=Introduction" json:"Introduction,omitempty"` + FaceUrl string `protobuf:"bytes,5,opt,name=FaceUrl" json:"FaceUrl,omitempty"` + Ex string `protobuf:"bytes,6,opt,name=Ex" json:"Ex,omitempty"` + OwnerID string `protobuf:"bytes,7,opt,name=OwnerID" json:"OwnerID,omitempty"` + CreateTime uint64 `protobuf:"varint,8,opt,name=CreateTime" json:"CreateTime,omitempty"` + MemberCount uint32 `protobuf:"varint,9,opt,name=MemberCount" json:"MemberCount,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupInfoTip) Reset() { *m = GroupInfoTip{} } +func (m *GroupInfoTip) String() string { return proto.CompactTextString(m) } +func (*GroupInfoTip) ProtoMessage() {} +func (*GroupInfoTip) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_d55c44e342c7a2b5, []int{10} +} +func (m *GroupInfoTip) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupInfoTip.Unmarshal(m, b) +} +func (m *GroupInfoTip) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupInfoTip.Marshal(b, m, deterministic) +} +func (dst *GroupInfoTip) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupInfoTip.Merge(dst, src) +} +func (m *GroupInfoTip) XXX_Size() int { + return xxx_messageInfo_GroupInfoTip.Size(m) +} +func (m *GroupInfoTip) XXX_DiscardUnknown() { + xxx_messageInfo_GroupInfoTip.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupInfoTip proto.InternalMessageInfo + +func (m *GroupInfoTip) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GroupInfoTip) GetGroupName() string { + if m != nil { + return m.GroupName + } + return "" +} + +func (m *GroupInfoTip) GetNotification() string { + if m != nil { + return m.Notification + } + return "" +} + +func (m *GroupInfoTip) GetIntroduction() string { + if m != nil { + return m.Introduction + } + return "" +} + +func (m *GroupInfoTip) GetFaceUrl() string { + if m != nil { + return m.FaceUrl + } + return "" +} + +func (m *GroupInfoTip) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +func (m *GroupInfoTip) GetOwnerID() string { + if m != nil { + return m.OwnerID + } + return "" +} + +func (m *GroupInfoTip) GetCreateTime() uint64 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *GroupInfoTip) GetMemberCount() uint32 { + if m != nil { + return m.MemberCount + } + return 0 +} + +type UserInfoTip struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=Name" json:"Name,omitempty"` + Icon string `protobuf:"bytes,3,opt,name=Icon" json:"Icon,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=Gender" json:"Gender,omitempty"` + Mobile string `protobuf:"bytes,5,opt,name=Mobile" json:"Mobile,omitempty"` + Birth string `protobuf:"bytes,6,opt,name=Birth" json:"Birth,omitempty"` + Email string `protobuf:"bytes,7,opt,name=Email" json:"Email,omitempty"` + Ex string `protobuf:"bytes,8,opt,name=Ex" json:"Ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserInfoTip) Reset() { *m = UserInfoTip{} } +func (m *UserInfoTip) String() string { return proto.CompactTextString(m) } +func (*UserInfoTip) ProtoMessage() {} +func (*UserInfoTip) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_d55c44e342c7a2b5, []int{11} +} +func (m *UserInfoTip) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserInfoTip.Unmarshal(m, b) +} +func (m *UserInfoTip) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserInfoTip.Marshal(b, m, deterministic) +} +func (dst *UserInfoTip) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserInfoTip.Merge(dst, src) +} +func (m *UserInfoTip) XXX_Size() int { + return xxx_messageInfo_UserInfoTip.Size(m) +} +func (m *UserInfoTip) XXX_DiscardUnknown() { + xxx_messageInfo_UserInfoTip.DiscardUnknown(m) +} + +var xxx_messageInfo_UserInfoTip proto.InternalMessageInfo + +func (m *UserInfoTip) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *UserInfoTip) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *UserInfoTip) GetIcon() string { + if m != nil { + return m.Icon + } + return "" +} + +func (m *UserInfoTip) GetGender() int32 { + if m != nil { + return m.Gender + } + return 0 +} + +func (m *UserInfoTip) GetMobile() string { + if m != nil { + return m.Mobile + } + return "" +} + +func (m *UserInfoTip) GetBirth() string { + if m != nil { + return m.Birth + } + return "" +} + +func (m *UserInfoTip) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *UserInfoTip) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type CreateGroupTip struct { + Group *GroupInfoTip `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + Creator *UserInfoTip `protobuf:"bytes,2,opt,name=creator" json:"creator,omitempty"` + MemberList []*UserInfoTip `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateGroupTip) Reset() { *m = CreateGroupTip{} } +func (m *CreateGroupTip) String() string { return proto.CompactTextString(m) } +func (*CreateGroupTip) ProtoMessage() {} +func (*CreateGroupTip) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_d55c44e342c7a2b5, []int{12} +} +func (m *CreateGroupTip) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateGroupTip.Unmarshal(m, b) +} +func (m *CreateGroupTip) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateGroupTip.Marshal(b, m, deterministic) +} +func (dst *CreateGroupTip) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateGroupTip.Merge(dst, src) +} +func (m *CreateGroupTip) XXX_Size() int { + return xxx_messageInfo_CreateGroupTip.Size(m) +} +func (m *CreateGroupTip) XXX_DiscardUnknown() { + xxx_messageInfo_CreateGroupTip.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateGroupTip proto.InternalMessageInfo + +func (m *CreateGroupTip) GetGroup() *GroupInfoTip { + if m != nil { + return m.Group + } + return nil +} + +func (m *CreateGroupTip) GetCreator() *UserInfoTip { + if m != nil { + return m.Creator + } + return nil +} + +func (m *CreateGroupTip) GetMemberList() []*UserInfoTip { + if m != nil { + return m.MemberList + } + return nil +} + func init() { proto.RegisterType((*PullMessageBySeqListResp)(nil), "open_im_sdk.PullMessageBySeqListResp") proto.RegisterType((*PullMessageBySeqListReq)(nil), "open_im_sdk.PullMessageBySeqListReq") @@ -752,59 +1002,77 @@ func init() { proto.RegisterType((*UserSendMsgResp)(nil), "open_im_sdk.UserSendMsgResp") proto.RegisterType((*MsgData)(nil), "open_im_sdk.MsgData") proto.RegisterType((*OfflinePushInfo)(nil), "open_im_sdk.OfflinePushInfo") -} - -func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_ff6df30c494aaf36) } - -var fileDescriptor_ws_ff6df30c494aaf36 = []byte{ - // 780 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x5b, 0x6b, 0x1a, 0x41, - 0x14, 0xc6, 0x5d, 0x6f, 0x7b, 0x34, 0x17, 0xa6, 0x21, 0xdd, 0x86, 0x52, 0x64, 0x29, 0x45, 0xf2, - 0x60, 0x20, 0x79, 0x29, 0x29, 0xa5, 0x34, 0x35, 0x09, 0x96, 0x98, 0x84, 0x35, 0x79, 0xe9, 0x4b, - 0xd8, 0xea, 0x68, 0x16, 0xf7, 0xa2, 0x7b, 0xd6, 0x24, 0xfe, 0x98, 0x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, 0xc3, 0x14, 0xec, 0xb6, 0xbd, - 0xd4, 0x23, 0xb2, 0x50, 0x4b, 0x30, 0x2e, 0x12, 0x9c, 0x68, 0x09, 0x96, 0x15, 0xdd, 0x8c, 0x8a, - 0x74, 0x32, 0xc5, 0x2a, 0x44, 0x44, 0x86, 0x99, 0x74, 0x52, 0xf9, 0xbc, 0xa4, 0xde, 0xbe, 0x22, - 0x5d, 0x26, 0x7b, 0x5f, 0xcf, 0x38, 0x2a, 0x93, 0xcb, 0x14, 0xab, 0x10, 0x9d, 0x9e, 0x35, 0x08, - 0xe9, 0x2d, 0x37, 0x2f, 0xb5, 0x89, 0xab, 0xfa, 0xc4, 0x24, 0x08, 0xf2, 0xa9, 0x08, 0xb1, 0xe9, - 0xd2, 0x92, 0x32, 0x8e, 0xcb, 0x19, 0x07, 0x99, 0x71, 0x5c, 0x93, 0x71, 0xd4, 0xc3, 0x21, 0x3d, - 0xb0, 0x84, 0x52, 0x38, 0x50, 0x0b, 0x87, 0xcc, 0xaf, 0x0e, 0x0a, 0x16, 0x14, 0xed, 0x36, 0xe4, - 0x8c, 0x0a, 0xe4, 0x74, 0x61, 0xeb, 0x6a, 0x38, 0x0c, 0xfc, 0x88, 0x5f, 0xcf, 0xf0, 0xbe, 0x13, - 0x0d, 0x63, 0xf2, 0xcf, 0x8d, 0x9f, 0x06, 0x3c, 0x53, 0x49, 0x16, 0x8c, 0x41, 0xb1, 0xcd, 0xb1, - 0x9f, 0x49, 0x24, 0xd6, 0x34, 0xea, 0xe9, 0x53, 0x9a, 0xe5, 0x92, 0x96, 0x27, 0xbb, 0xdf, 0x76, - 0x5a, 0x07, 0xf2, 0xfb, 0xfb, 0x41, 0xf9, 0x63, 0xf8, 0x5e, 0x16, 0x5f, 0xe2, 0xa3, 0x3f, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xf1, 0x1f, 0x85, 0x3b, 0x9c, 0x07, 0x00, 0x00, + proto.RegisterType((*GroupInfoTip)(nil), "open_im_sdk.GroupInfoTip") + proto.RegisterType((*UserInfoTip)(nil), "open_im_sdk.UserInfoTip") + proto.RegisterType((*CreateGroupTip)(nil), "open_im_sdk.CreateGroupTip") +} + +func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_d55c44e342c7a2b5) } + +var fileDescriptor_ws_d55c44e342c7a2b5 = []byte{ + // 1021 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0xcb, 0x6e, 0x23, 0xb7, + 0x12, 0x85, 0xba, 0xf5, 0x2c, 0xc9, 0xf6, 0x80, 0xd7, 0xf0, 0xed, 0x0c, 0x82, 0x40, 0x68, 0x04, + 0x81, 0x30, 0x0b, 0x19, 0xf0, 0x6c, 0x06, 0x13, 0x04, 0x41, 0x6c, 0xc9, 0x86, 0x82, 0x91, 0x6d, + 0xb4, 0x3c, 0x9b, 0x6c, 0x8c, 0x76, 0x8b, 0x92, 0x1b, 0xee, 0x87, 0xd4, 0xa4, 0x6c, 0xf9, 0x3f, + 0xb2, 0xcd, 0x37, 0x64, 0x9d, 0x5f, 0xc8, 0x22, 0x7f, 0x14, 0x20, 0xa8, 0x22, 0x5b, 0x26, 0x25, + 0xe7, 0xb1, 0xe3, 0x39, 0xaa, 0x22, 0x59, 0xe7, 0x54, 0xb5, 0x08, 0x07, 0x62, 0xfa, 0x70, 0xfb, + 0x24, 0x8e, 0x9f, 0x44, 0x7f, 0x51, 0xe4, 0x32, 0x67, 0xed, 0x7c, 0xc1, 0xb3, 0xdb, 0x38, 0xbd, + 0x15, 0xd3, 0x07, 0xff, 0xf7, 0x0a, 0x78, 0xd7, 0xab, 0x24, 0x19, 0x73, 0x21, 0xc2, 0x39, 0x3f, + 0x7d, 0x9e, 0xf0, 0xe5, 0xa7, 0x58, 0xc8, 0x80, 0x8b, 0x05, 0x3b, 0x82, 0xfa, 0x38, 0x5c, 0x4f, + 0xf8, 0xd2, 0xab, 0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0x55, 0x39, 0x82, 0x3a, 0xc1, + 0xcd, 0x24, 0x28, 0x84, 0x22, 0x1b, 0x72, 0xd0, 0x1a, 0xb9, 0x51, 0xb4, 0x51, 0x80, 0xd6, 0x98, + 0x7f, 0x41, 0x46, 0xeb, 0xb6, 0xd7, 0x88, 0xde, 0x29, 0xf9, 0x5d, 0x9c, 0x70, 0x5d, 0xac, 0x46, + 0x68, 0xe9, 0x69, 0x5c, 0xc8, 0x7b, 0x5d, 0xae, 0x02, 0xc8, 0x0e, 0xd3, 0x30, 0x4e, 0x74, 0xbd, + 0x0a, 0x68, 0x5d, 0x9a, 0xa5, 0x2e, 0xfe, 0xaf, 0x15, 0xd8, 0x57, 0xc5, 0x92, 0x3b, 0x78, 0xfd, + 0x63, 0xa8, 0xcd, 0x71, 0x4d, 0xb7, 0xdf, 0x79, 0xae, 0x18, 0xf6, 0x07, 0x2a, 0x8e, 0x9d, 0x40, + 0x23, 0xc2, 0x2d, 0xf2, 0x82, 0x4a, 0x6b, 0x9f, 0x78, 0x3b, 0x7f, 0x1b, 0x65, 0x46, 0x19, 0xc8, + 0x3e, 0x00, 0xa4, 0x24, 0x21, 0x7d, 0x43, 0xd5, 0xc3, 0xea, 0xef, 0xd3, 0x8c, 0xd8, 0xd3, 0xa3, + 0x9f, 0x0e, 0xfb, 0xc7, 0xea, 0x11, 0xf8, 0xad, 0x11, 0x7f, 0x57, 0xa7, 0xe7, 0xe0, 0xfb, 0xbf, + 0x02, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x41, 0x03, 0xcb, 0x21, 0x0a, 0x00, 0x00, } diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index 259d726a8..9b9d805b4 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -93,3 +93,36 @@ message OfflinePushInfo{ string Ext = 3; } +message GroupInfoTip{ + string GroupID = 1; + string GroupName = 2; + string Notification = 3; + string Introduction = 4; + string FaceUrl = 5; + string Ex = 6; + string OwnerID = 7; + uint64 CreateTime = 8; + uint32 MemberCount = 9; +} + + + +type GroupMemberFullInfoTip struct { + string GroupId = 1 ; + string UserId = 2 ; + int Role = 3; + uint64 JoinTime = 4; + string NickName = 5; + string FaceUrl =6; +} + + + +message CreateGroupTip{ + GroupInfoTip group = 1; + UserInfoTip creator = 2; + repeated GroupMemberFullInfoTip memberList = 3; +} + + + diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 5f6e9a6ca..0ebe55d99 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -3,6 +3,7 @@ package utils import ( "fmt" "reflect" + "strconv" ) // copy a by b b->a @@ -44,12 +45,6 @@ func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error return nil } -type S1 struct { - Name string - Age int -} - -type S2 struct { - Name string - Age int32 +func OperationIDGenerator() string { + return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10) } From 2dc773ebe618b2eeee9c4c6cb836aaee8510a8a9 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 17:50:29 +0800 Subject: [PATCH 45/47] sync message --- internal/msg_gateway/gate/rpc_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go index 972cf30f4..a3ef373d6 100644 --- a/internal/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -116,7 +116,7 @@ func (r *RPCServer) MsgToUser(_ context.Context, in *pbRelay.MsgToUserReq) (*pbR } } //Single chat sender synchronization message - if in.GetSessionType() == constant.SingleChatType { + if in.GetSessionType() == constant.SingleChatType && in.ContentType <= constant.Quote && in.ContentType != constant.Typing && in.ContentType != constant.HasReadReceipt { userIDList = genUidPlatformArray(in.SendID) for _, v := range userIDList { UIDAndPID = strings.Split(v, " ") From 88d181f9feb94e52b45cd92a9bac1a27b031246a Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 17:51:19 +0800 Subject: [PATCH 46/47] sync message --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index e67ac4fee..02dbc6638 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,7 +1,7 @@ # The class cannot be named by Pascal or camel case. # If it is not used, the corresponding structure will not be set, # and it will not be read naturally. -serverversion: 1.0.6 +serverversion: 1.0.3 #---------------Infrastructure configuration---------------------# etcd: etcdSchema: openIM From a328080ba4a643dd7c80ca8fe51a0fa21a16de9c Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 10 Dec 2021 18:07:09 +0800 Subject: [PATCH 47/47] sync message --- pkg/utils/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 0ebe55d99..074712bc8 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -2,8 +2,10 @@ package utils import ( "fmt" + "math/rand" "reflect" "strconv" + "time" ) // copy a by b b->a