mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
Merge branch 'shichuang' of github.com:OpenIMSDK/Open-IM-Server into shichuang
This commit is contained in:
commit
56fb579da2
@ -26,7 +26,7 @@ func SetConversation(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req)
|
||||
reqPb.Conversation = &pbUser.Conversation{}
|
||||
reqPb.Conversation = &pbConversation.Conversation{}
|
||||
err := utils.CopyStructFields(&reqPb, req)
|
||||
err = utils.CopyStructFields(reqPb.Conversation, req.Conversation)
|
||||
if err != nil {
|
||||
|
@ -367,7 +367,7 @@ func GetSelfUserInfo(c *gin.Context) {
|
||||
log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
|
||||
c.JSON(http.StatusOK, resp)
|
||||
} else {
|
||||
resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}}
|
||||
resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}
|
||||
log.NewInfo(req.OperationID, "GetUserInfo api return ", resp)
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
@ -134,6 +134,7 @@ func (ws *WServer) MultiTerminalLoginRemoteChecker(userID string, platformID int
|
||||
resp, err := client.MultiTerminalLoginCheck(context.Background(), req)
|
||||
if err != nil {
|
||||
log.Error(operationID, "MultiTerminalLoginCheck failed ", err.Error())
|
||||
continue
|
||||
}
|
||||
if resp.ErrCode != 0 {
|
||||
log.Error(operationID, "MultiTerminalLoginCheck errCode, errMsg: ", resp.ErrCode, resp.ErrMsg)
|
||||
|
@ -102,7 +102,10 @@ type Options struct {
|
||||
} `json:"HW"`
|
||||
XM struct {
|
||||
ChannelID string `json:"/extra.channel_id"`
|
||||
} `json:""`
|
||||
} `json:"XM"`
|
||||
VV struct {
|
||||
Classification int `json:"/classification"`
|
||||
} `json:"VV"`
|
||||
}
|
||||
|
||||
type PushResp struct {
|
||||
@ -156,6 +159,11 @@ func (g *Getui) Push(userIDList []string, alert, detailContent, operationID stri
|
||||
XM: struct {
|
||||
ChannelID string `json:"/extra.channel_id"`
|
||||
}{ChannelID: "high_system"},
|
||||
VV: struct {
|
||||
Classification int "json:\"/classification\""
|
||||
}{
|
||||
Classification: 1,
|
||||
},
|
||||
}
|
||||
pushResp := PushResp{}
|
||||
err = g.request(PushURL, pushReq, token, &pushResp, operationID)
|
||||
|
@ -13,6 +13,7 @@ import (
|
||||
"Open_IM/pkg/common/log"
|
||||
pbChat "Open_IM/pkg/proto/msg"
|
||||
pbPush "Open_IM/pkg/proto/push"
|
||||
"Open_IM/pkg/utils"
|
||||
"github.com/Shopify/sarama"
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
@ -43,6 +44,11 @@ func (ms *PushConsumerHandler) handleMs2PsChat(msg []byte) {
|
||||
MsgData: msgFromMQ.MsgData,
|
||||
PushToUserID: msgFromMQ.PushToUserID,
|
||||
}
|
||||
sec := msgFromMQ.MsgData.SendTime / 1000
|
||||
nowSec := utils.GetCurrentTimestampBySecond()
|
||||
if nowSec-sec > 10 {
|
||||
return
|
||||
}
|
||||
switch msgFromMQ.MsgData.SessionType {
|
||||
case constant.SuperGroupChatType:
|
||||
MsgToSuperGroupUser(pbData)
|
||||
@ -59,6 +65,7 @@ func (ms *PushConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession,
|
||||
for msg := range claim.Messages() {
|
||||
log.NewDebug("", "kafka get info to mysql", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value))
|
||||
ms.msgHandle[msg.Topic](msg.Value)
|
||||
sess.MarkMessage(msg, "")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo
|
||||
err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"attached_info": conversation.AttachedInfo})
|
||||
case constant.FieldUnread:
|
||||
isSyncConversation = false
|
||||
err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"update_unread_count_time": utils.GetCurrentTimestampByMill()})
|
||||
}
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateColumnsConversations error", err.Error())
|
||||
@ -82,6 +83,11 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo
|
||||
}
|
||||
for _, v := range utils.DifferenceString(haveUserID, req.UserIDList) {
|
||||
conversation.OwnerUserID = v
|
||||
conversation.UpdateUnreadCountTime = utils.GetCurrentTimestampByMill()
|
||||
err = rocksCache.DelUserConversationIDListFromCache(v)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), v, req.Conversation.ConversationID, err.Error())
|
||||
}
|
||||
err := imdb.SetOneConversation(conversation)
|
||||
if err != nil {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
"Open_IM/pkg/common/db/rocks_cache"
|
||||
rocksCache "Open_IM/pkg/common/db/rocks_cache"
|
||||
"Open_IM/pkg/common/http"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
@ -19,12 +19,13 @@ import (
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"google.golang.org/grpc"
|
||||
"math/big"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type groupServer struct {
|
||||
@ -381,7 +382,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
haveConUserID = append(haveConUserID, v.OwnerUserID)
|
||||
}
|
||||
var reqPb pbUser.SetConversationReq
|
||||
var c pbUser.Conversation
|
||||
var c pbConversation.Conversation
|
||||
for _, v := range conversations {
|
||||
reqPb.OperationID = req.OperationID
|
||||
c.OwnerUserID = v.OwnerUserID
|
||||
@ -634,7 +635,7 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
|
||||
}
|
||||
}
|
||||
var reqPb pbUser.SetConversationReq
|
||||
var c pbUser.Conversation
|
||||
var c pbConversation.Conversation
|
||||
for _, v := range okUserIDList {
|
||||
reqPb.OperationID = req.OperationID
|
||||
c.OwnerUserID = v
|
||||
@ -867,7 +868,7 @@ func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.G
|
||||
}
|
||||
var reqPb pbUser.SetConversationReq
|
||||
reqPb.OperationID = req.OperationID
|
||||
var c pbUser.Conversation
|
||||
var c pbConversation.Conversation
|
||||
conversation, err := imdb.GetConversation(req.FromUserID, utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType))
|
||||
if err != nil {
|
||||
c.OwnerUserID = req.FromUserID
|
||||
@ -1061,7 +1062,7 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq)
|
||||
}
|
||||
//modify quitter conversation info
|
||||
var reqPb pbUser.SetConversationReq
|
||||
var c pbUser.Conversation
|
||||
var c pbConversation.Conversation
|
||||
reqPb.OperationID = req.OperationID
|
||||
c.OwnerUserID = req.OpUserID
|
||||
c.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.GroupChatType)
|
||||
@ -1515,7 +1516,7 @@ func (s *groupServer) RemoveGroupMembersCMS(_ context.Context, req *pbGroup.Remo
|
||||
OpUserID: req.OpUserID,
|
||||
}
|
||||
var reqPb pbUser.SetConversationReq
|
||||
var c pbUser.Conversation
|
||||
var c pbConversation.Conversation
|
||||
for _, v := range resp.Success {
|
||||
reqPb.OperationID = req.OperationID
|
||||
c.OwnerUserID = v
|
||||
@ -1700,7 +1701,7 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou
|
||||
}
|
||||
//modify quitter conversation info
|
||||
var reqPb pbUser.SetConversationReq
|
||||
var c pbUser.Conversation
|
||||
var c pbConversation.Conversation
|
||||
for _, v := range memberList {
|
||||
reqPb.OperationID = req.OperationID
|
||||
c.OwnerUserID = v.UserID
|
||||
|
@ -11,6 +11,7 @@ import (
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
||||
pbConversation "Open_IM/pkg/proto/conversation"
|
||||
pbFriend "Open_IM/pkg/proto/friend"
|
||||
sdkws "Open_IM/pkg/proto/sdk_ws"
|
||||
pbUser "Open_IM/pkg/proto/user"
|
||||
@ -83,7 +84,7 @@ func (s *userServer) Run() {
|
||||
log.NewInfo("0", "rpc user success")
|
||||
}
|
||||
|
||||
func syncPeerUserConversation(conversation *pbUser.Conversation, operationID string) error {
|
||||
func syncPeerUserConversation(conversation *pbConversation.Conversation, operationID string) error {
|
||||
peerUserConversation := db.Conversation{
|
||||
OwnerUserID: conversation.UserID,
|
||||
ConversationID: utils.GetConversationIDBySessionType(conversation.OwnerUserID, constant.SingleChatType),
|
||||
@ -178,7 +179,7 @@ func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.Batc
|
||||
|
||||
func (s *userServer) GetAllConversations(ctx context.Context, req *pbUser.GetAllConversationsReq) (*pbUser.GetAllConversationsResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||
resp := &pbUser.GetAllConversationsResp{Conversations: []*pbUser.Conversation{}}
|
||||
resp := &pbUser.GetAllConversationsResp{Conversations: []*pbConversation.Conversation{}}
|
||||
conversations, err := rocksCache.GetUserAllConversationList(req.OwnerUserID)
|
||||
log.NewDebug(req.OperationID, "conversations: ", conversations)
|
||||
if err != nil {
|
||||
@ -196,7 +197,7 @@ func (s *userServer) GetAllConversations(ctx context.Context, req *pbUser.GetAll
|
||||
|
||||
func (s *userServer) GetConversation(ctx context.Context, req *pbUser.GetConversationReq) (*pbUser.GetConversationResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||
resp := &pbUser.GetConversationResp{Conversation: &pbUser.Conversation{}}
|
||||
resp := &pbUser.GetConversationResp{Conversation: &pbConversation.Conversation{}}
|
||||
conversation, err := rocksCache.GetConversationFromCache(req.OwnerUserID, req.ConversationID)
|
||||
log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation)
|
||||
if err != nil {
|
||||
@ -214,7 +215,7 @@ func (s *userServer) GetConversation(ctx context.Context, req *pbUser.GetConvers
|
||||
|
||||
func (s *userServer) GetConversations(ctx context.Context, req *pbUser.GetConversationsReq) (*pbUser.GetConversationsResp, error) {
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||
resp := &pbUser.GetConversationsResp{Conversations: []*pbUser.Conversation{}}
|
||||
resp := &pbUser.GetConversationsResp{Conversations: []*pbConversation.Conversation{}}
|
||||
conversations, err := rocksCache.GetConversationsFromCache(req.OwnerUserID, req.ConversationIDs)
|
||||
log.NewDebug("", utils.GetSelfFuncName(), "conversations", conversations)
|
||||
if err != nil {
|
||||
@ -683,7 +684,7 @@ func (s *userServer) AlterUser(ctx context.Context, req *pbUser.AlterUserReq) (*
|
||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||
resp := &pbUser.AlterUserResp{}
|
||||
user := db.User{
|
||||
PhoneNumber: strconv.FormatInt(req.PhoneNumber, 10),
|
||||
PhoneNumber: req.PhoneNumber,
|
||||
Nickname: req.Nickname,
|
||||
Email: req.Email,
|
||||
UserID: req.UserId,
|
||||
|
@ -33,20 +33,21 @@ type SetReceiveMessageOptResp struct {
|
||||
}
|
||||
|
||||
type Conversation struct {
|
||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||
ConversationID string `json:"conversationID" binding:"required"`
|
||||
ConversationType int32 `json:"conversationType" binding:"required"`
|
||||
UserID string `json:"userID"`
|
||||
GroupID string `json:"groupID"`
|
||||
RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
||||
UnreadCount int32 `json:"unreadCount" binding:"omitempty"`
|
||||
DraftTextTime int64 `json:"draftTextTime"`
|
||||
IsPinned bool `json:"isPinned" binding:"omitempty"`
|
||||
IsPrivateChat bool `json:"isPrivateChat"`
|
||||
GroupAtType int32 `json:"groupAtType"`
|
||||
IsNotInGroup bool `json:"isNotInGroup"`
|
||||
AttachedInfo string `json:"attachedInfo"`
|
||||
Ex string `json:"ex"`
|
||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||
ConversationID string `json:"conversationID" binding:"required"`
|
||||
ConversationType int32 `json:"conversationType" binding:"required"`
|
||||
UserID string `json:"userID"`
|
||||
GroupID string `json:"groupID"`
|
||||
RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
||||
UnreadCount int32 `json:"unreadCount" binding:"omitempty"`
|
||||
DraftTextTime int64 `json:"draftTextTime"`
|
||||
IsPinned bool `json:"isPinned" binding:"omitempty"`
|
||||
IsPrivateChat bool `json:"isPrivateChat"`
|
||||
GroupAtType int32 `json:"groupAtType"`
|
||||
UpdateUnreadCountTime int64 `json:"updateUnreadCountTime"`
|
||||
IsNotInGroup bool `json:"isNotInGroup"`
|
||||
AttachedInfo string `json:"attachedInfo"`
|
||||
Ex string `json:"ex"`
|
||||
}
|
||||
|
||||
type SetConversationReq struct {
|
||||
|
@ -243,20 +243,21 @@ type BlackList struct {
|
||||
EndDisableTime time.Time `gorm:"column:end_disable_time"`
|
||||
}
|
||||
type Conversation struct {
|
||||
OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"`
|
||||
ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"`
|
||||
ConversationType int32 `gorm:"column:conversation_type" json:"conversationType"`
|
||||
UserID string `gorm:"column:user_id;type:char(64)" json:"userID"`
|
||||
GroupID string `gorm:"column:group_id;type:char(128)" json:"groupID"`
|
||||
RecvMsgOpt int32 `gorm:"column:recv_msg_opt" json:"recvMsgOpt"`
|
||||
UnreadCount int32 `gorm:"column:unread_count" json:"unreadCount"`
|
||||
DraftTextTime int64 `gorm:"column:draft_text_time" json:"draftTextTime"`
|
||||
IsPinned bool `gorm:"column:is_pinned" json:"isPinned"`
|
||||
IsPrivateChat bool `gorm:"column:is_private_chat" json:"isPrivateChat"`
|
||||
GroupAtType int32 `gorm:"column:group_at_type" json:"groupAtType"`
|
||||
IsNotInGroup bool `gorm:"column:is_not_in_group" json:"isNotInGroup"`
|
||||
AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"`
|
||||
Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"`
|
||||
OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"`
|
||||
ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"`
|
||||
ConversationType int32 `gorm:"column:conversation_type" json:"conversationType"`
|
||||
UserID string `gorm:"column:user_id;type:char(64)" json:"userID"`
|
||||
GroupID string `gorm:"column:group_id;type:char(128)" json:"groupID"`
|
||||
RecvMsgOpt int32 `gorm:"column:recv_msg_opt" json:"recvMsgOpt"`
|
||||
UnreadCount int32 `gorm:"column:unread_count" json:"unreadCount"`
|
||||
DraftTextTime int64 `gorm:"column:draft_text_time" json:"draftTextTime"`
|
||||
IsPinned bool `gorm:"column:is_pinned" json:"isPinned"`
|
||||
IsPrivateChat bool `gorm:"column:is_private_chat" json:"isPrivateChat"`
|
||||
GroupAtType int32 `gorm:"column:group_at_type" json:"groupAtType"`
|
||||
IsNotInGroup bool `gorm:"column:is_not_in_group" json:"isNotInGroup"`
|
||||
UpdateUnreadCountTime int64 `gorm:"column:update_unread_count_time" json:"updateUnreadCountTime"`
|
||||
AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"`
|
||||
Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"`
|
||||
}
|
||||
|
||||
func (Conversation) TableName() string {
|
||||
|
@ -282,7 +282,7 @@ func GetDefaultGatewayConn4Unique(schema, etcdaddr, operationID string) []*grpc.
|
||||
if len(grpcConns) > 0 {
|
||||
return grpcConns
|
||||
}
|
||||
log.NewWarn(operationID, utils.GetSelfFuncName(), " len(grpcConns) < 0 ", schema, etcdaddr, config.Config.RpcRegisterName.OpenImRelayName)
|
||||
log.NewWarn(operationID, utils.GetSelfFuncName(), " len(grpcConns) == 0 ", schema, etcdaddr, config.Config.RpcRegisterName.OpenImRelayName)
|
||||
grpcConns = GetDefaultGatewayConn4UniqueFromcfg(operationID)
|
||||
log.NewDebug(operationID, utils.GetSelfFuncName(), config.Config.RpcRegisterName.OpenImRelayName, grpcConns)
|
||||
return grpcConns
|
||||
|
@ -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_conversation_e6bf38f800b9bed2, []int{0}
|
||||
return fileDescriptor_conversation_ac55165355a1b6e6, []int{0}
|
||||
}
|
||||
func (m *CommonResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_CommonResp.Unmarshal(m, b)
|
||||
@ -70,30 +70,31 @@ func (m *CommonResp) GetErrMsg() string {
|
||||
}
|
||||
|
||||
type Conversation struct {
|
||||
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID" json:"ownerUserID,omitempty"`
|
||||
ConversationID string `protobuf:"bytes,2,opt,name=conversationID" json:"conversationID,omitempty"`
|
||||
RecvMsgOpt int32 `protobuf:"varint,3,opt,name=recvMsgOpt" json:"recvMsgOpt,omitempty"`
|
||||
ConversationType int32 `protobuf:"varint,4,opt,name=conversationType" json:"conversationType,omitempty"`
|
||||
UserID string `protobuf:"bytes,5,opt,name=userID" json:"userID,omitempty"`
|
||||
GroupID string `protobuf:"bytes,6,opt,name=groupID" json:"groupID,omitempty"`
|
||||
UnreadCount int32 `protobuf:"varint,7,opt,name=unreadCount" json:"unreadCount,omitempty"`
|
||||
DraftTextTime int64 `protobuf:"varint,8,opt,name=draftTextTime" json:"draftTextTime,omitempty"`
|
||||
IsPinned bool `protobuf:"varint,9,opt,name=isPinned" json:"isPinned,omitempty"`
|
||||
AttachedInfo string `protobuf:"bytes,10,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
|
||||
IsPrivateChat bool `protobuf:"varint,11,opt,name=isPrivateChat" json:"isPrivateChat,omitempty"`
|
||||
GroupAtType int32 `protobuf:"varint,12,opt,name=groupAtType" json:"groupAtType,omitempty"`
|
||||
IsNotInGroup bool `protobuf:"varint,13,opt,name=isNotInGroup" json:"isNotInGroup,omitempty"`
|
||||
Ex string `protobuf:"bytes,14,opt,name=ex" json:"ex,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID" json:"ownerUserID,omitempty"`
|
||||
ConversationID string `protobuf:"bytes,2,opt,name=conversationID" json:"conversationID,omitempty"`
|
||||
RecvMsgOpt int32 `protobuf:"varint,3,opt,name=recvMsgOpt" json:"recvMsgOpt,omitempty"`
|
||||
ConversationType int32 `protobuf:"varint,4,opt,name=conversationType" json:"conversationType,omitempty"`
|
||||
UserID string `protobuf:"bytes,5,opt,name=userID" json:"userID,omitempty"`
|
||||
GroupID string `protobuf:"bytes,6,opt,name=groupID" json:"groupID,omitempty"`
|
||||
UnreadCount int32 `protobuf:"varint,7,opt,name=unreadCount" json:"unreadCount,omitempty"`
|
||||
DraftTextTime int64 `protobuf:"varint,8,opt,name=draftTextTime" json:"draftTextTime,omitempty"`
|
||||
IsPinned bool `protobuf:"varint,9,opt,name=isPinned" json:"isPinned,omitempty"`
|
||||
AttachedInfo string `protobuf:"bytes,10,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
|
||||
IsPrivateChat bool `protobuf:"varint,11,opt,name=isPrivateChat" json:"isPrivateChat,omitempty"`
|
||||
GroupAtType int32 `protobuf:"varint,12,opt,name=groupAtType" json:"groupAtType,omitempty"`
|
||||
IsNotInGroup bool `protobuf:"varint,13,opt,name=isNotInGroup" json:"isNotInGroup,omitempty"`
|
||||
Ex string `protobuf:"bytes,14,opt,name=ex" json:"ex,omitempty"`
|
||||
UpdateUnreadCountTime int64 `protobuf:"varint,15,opt,name=updateUnreadCountTime" json:"updateUnreadCountTime,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Conversation) Reset() { *m = Conversation{} }
|
||||
func (m *Conversation) String() string { return proto.CompactTextString(m) }
|
||||
func (*Conversation) ProtoMessage() {}
|
||||
func (*Conversation) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_conversation_e6bf38f800b9bed2, []int{1}
|
||||
return fileDescriptor_conversation_ac55165355a1b6e6, []int{1}
|
||||
}
|
||||
func (m *Conversation) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Conversation.Unmarshal(m, b)
|
||||
@ -211,6 +212,13 @@ func (m *Conversation) GetEx() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Conversation) GetUpdateUnreadCountTime() int64 {
|
||||
if m != nil {
|
||||
return m.UpdateUnreadCountTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ModifyConversationFieldReq struct {
|
||||
Conversation *Conversation `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"`
|
||||
FieldType int32 `protobuf:"varint,2,opt,name=fieldType" json:"fieldType,omitempty"`
|
||||
@ -225,7 +233,7 @@ func (m *ModifyConversationFieldReq) Reset() { *m = ModifyConversationFi
|
||||
func (m *ModifyConversationFieldReq) String() string { return proto.CompactTextString(m) }
|
||||
func (*ModifyConversationFieldReq) ProtoMessage() {}
|
||||
func (*ModifyConversationFieldReq) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_conversation_e6bf38f800b9bed2, []int{2}
|
||||
return fileDescriptor_conversation_ac55165355a1b6e6, []int{2}
|
||||
}
|
||||
func (m *ModifyConversationFieldReq) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ModifyConversationFieldReq.Unmarshal(m, b)
|
||||
@ -284,7 +292,7 @@ func (m *ModifyConversationFieldResp) Reset() { *m = ModifyConversationF
|
||||
func (m *ModifyConversationFieldResp) String() string { return proto.CompactTextString(m) }
|
||||
func (*ModifyConversationFieldResp) ProtoMessage() {}
|
||||
func (*ModifyConversationFieldResp) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_conversation_e6bf38f800b9bed2, []int{3}
|
||||
return fileDescriptor_conversation_ac55165355a1b6e6, []int{3}
|
||||
}
|
||||
func (m *ModifyConversationFieldResp) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ModifyConversationFieldResp.Unmarshal(m, b)
|
||||
@ -391,39 +399,40 @@ var _Conversation_serviceDesc = grpc.ServiceDesc{
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("conversation/conversation.proto", fileDescriptor_conversation_e6bf38f800b9bed2)
|
||||
proto.RegisterFile("conversation/conversation.proto", fileDescriptor_conversation_ac55165355a1b6e6)
|
||||
}
|
||||
|
||||
var fileDescriptor_conversation_e6bf38f800b9bed2 = []byte{
|
||||
// 475 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xdf, 0x8a, 0xd3, 0x40,
|
||||
0x14, 0x87, 0x49, 0xbb, 0xdb, 0x6d, 0x4e, 0xbb, 0x45, 0xe6, 0x42, 0x87, 0xae, 0x7f, 0x42, 0x10,
|
||||
0x89, 0x5e, 0x54, 0x58, 0x6f, 0x04, 0x61, 0x41, 0x53, 0x94, 0x80, 0xd5, 0x65, 0xa8, 0x08, 0xde,
|
||||
0xc5, 0xe6, 0xb4, 0x3b, 0x60, 0x67, 0xe2, 0xcc, 0xb4, 0x76, 0x6f, 0x7c, 0x32, 0x9f, 0xc4, 0xa7,
|
||||
0x91, 0x99, 0xb4, 0xbb, 0x33, 0x95, 0xc2, 0x5e, 0x9e, 0x2f, 0x27, 0xbf, 0xf9, 0x26, 0xe7, 0x04,
|
||||
0x9e, 0xcc, 0xa4, 0x58, 0xa3, 0xd2, 0xa5, 0xe1, 0x52, 0xbc, 0xf4, 0x8b, 0x51, 0xad, 0xa4, 0x91,
|
||||
0xa4, 0xef, 0xb3, 0xf4, 0x02, 0x20, 0x97, 0xcb, 0xa5, 0x14, 0x0c, 0x75, 0x4d, 0x28, 0x9c, 0xa0,
|
||||
0x52, 0xb9, 0xac, 0x90, 0x46, 0x49, 0x94, 0x1d, 0xb3, 0x5d, 0x49, 0xee, 0x43, 0x07, 0x95, 0x9a,
|
||||
0xe8, 0x05, 0x6d, 0x25, 0x51, 0x16, 0xb3, 0x6d, 0x95, 0xfe, 0x6d, 0x43, 0x3f, 0xf7, 0x02, 0x49,
|
||||
0x02, 0x3d, 0xf9, 0x4b, 0xa0, 0xfa, 0xa2, 0x51, 0x15, 0x63, 0x17, 0x13, 0x33, 0x1f, 0x91, 0x67,
|
||||
0x30, 0xf0, 0x15, 0x8a, 0xf1, 0x36, 0x72, 0x8f, 0x92, 0xc7, 0x00, 0x0a, 0x67, 0xeb, 0x89, 0x5e,
|
||||
0x7c, 0xae, 0x0d, 0x6d, 0x3b, 0x1f, 0x8f, 0x90, 0x17, 0x70, 0xcf, 0x7f, 0x63, 0x7a, 0x5d, 0x23,
|
||||
0x3d, 0x72, 0x5d, 0xff, 0x71, 0xab, 0xbf, 0x6a, 0x84, 0x8e, 0x1b, 0xfd, 0xa6, 0xb2, 0x17, 0x5e,
|
||||
0x28, 0xb9, 0xaa, 0x8b, 0x31, 0xed, 0xb8, 0x07, 0xbb, 0xd2, 0xde, 0x63, 0x25, 0x14, 0x96, 0x55,
|
||||
0x2e, 0x57, 0xc2, 0xd0, 0x13, 0x17, 0xec, 0x23, 0xf2, 0x14, 0x4e, 0x2b, 0x55, 0xce, 0xcd, 0x14,
|
||||
0x37, 0x66, 0xca, 0x97, 0x48, 0xbb, 0x49, 0x94, 0xb5, 0x59, 0x08, 0xc9, 0x10, 0xba, 0x5c, 0x5f,
|
||||
0x72, 0x21, 0xb0, 0xa2, 0x71, 0x12, 0x65, 0x5d, 0x76, 0x53, 0x93, 0x14, 0xfa, 0xa5, 0x31, 0xe5,
|
||||
0xec, 0x0a, 0xab, 0x42, 0xcc, 0x25, 0x05, 0xa7, 0x10, 0x30, 0x7b, 0x0a, 0xd7, 0x97, 0x8a, 0xaf,
|
||||
0x4b, 0x83, 0xf9, 0x55, 0x69, 0x68, 0xcf, 0x85, 0x84, 0xd0, 0xda, 0x3a, 0xf1, 0xb7, 0xc6, 0x7d,
|
||||
0x86, 0x7e, 0x63, 0xeb, 0x21, 0x7b, 0x16, 0xd7, 0x9f, 0xa4, 0x29, 0xc4, 0x07, 0x4b, 0xe9, 0xa9,
|
||||
0x8b, 0x09, 0x18, 0x19, 0x40, 0x0b, 0x37, 0x74, 0xe0, 0x2c, 0x5a, 0xb8, 0x49, 0xff, 0x44, 0x30,
|
||||
0x9c, 0xc8, 0x8a, 0xcf, 0xaf, 0xfd, 0x11, 0xbf, 0xe7, 0xf8, 0xa3, 0x62, 0xf8, 0x93, 0x5c, 0x40,
|
||||
0xb0, 0x4b, 0x6e, 0xd6, 0xbd, 0xf3, 0xe1, 0x28, 0x58, 0x3a, 0xff, 0x4d, 0x16, 0xf4, 0x93, 0x87,
|
||||
0x10, 0xcf, 0x6d, 0x96, 0x53, 0x6e, 0x39, 0xe5, 0x5b, 0x60, 0xc7, 0xdf, 0x0c, 0xe9, 0x23, 0xd7,
|
||||
0x76, 0xfc, 0xed, 0x2c, 0x66, 0x1e, 0x71, 0x8b, 0x56, 0xa3, 0xda, 0xed, 0xd0, 0xd1, 0x76, 0xd1,
|
||||
0x6e, 0x51, 0xfa, 0x15, 0xce, 0x0e, 0xda, 0xeb, 0x9a, 0xbc, 0x06, 0x98, 0xdd, 0xac, 0xfe, 0x56,
|
||||
0x9e, 0xee, 0xcb, 0xef, 0x9e, 0x33, 0xaf, 0xf7, 0xfc, 0x77, 0x78, 0x71, 0x22, 0xe0, 0xc1, 0x81,
|
||||
0x83, 0x48, 0x16, 0x06, 0x1e, 0xfe, 0x9a, 0xc3, 0xe7, 0x77, 0xec, 0xd4, 0xf5, 0xbb, 0x47, 0xdf,
|
||||
0xce, 0x46, 0xc1, 0xaf, 0xfd, 0xc6, 0x2f, 0xbe, 0x77, 0xdc, 0x8f, 0xfe, 0xea, 0x5f, 0x00, 0x00,
|
||||
0x00, 0xff, 0xff, 0x8d, 0x8a, 0xf6, 0x60, 0x0b, 0x04, 0x00, 0x00,
|
||||
var fileDescriptor_conversation_ac55165355a1b6e6 = []byte{
|
||||
// 494 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x5f, 0x8b, 0x13, 0x31,
|
||||
0x14, 0xc5, 0x99, 0x6e, 0xb7, 0xdb, 0xde, 0x76, 0xab, 0x04, 0xd4, 0xd0, 0xf5, 0x4f, 0x19, 0x44,
|
||||
0x46, 0x1f, 0x2a, 0xac, 0x3e, 0x08, 0xc2, 0x82, 0x4e, 0x51, 0x06, 0xac, 0x2e, 0xa1, 0x8b, 0xe0,
|
||||
0xdb, 0xd8, 0xb9, 0xed, 0x06, 0x6c, 0x32, 0x26, 0x99, 0xda, 0x7d, 0xf1, 0x33, 0xf8, 0x81, 0xfc,
|
||||
0x70, 0x92, 0x4c, 0xbb, 0x4d, 0x56, 0x0b, 0x3e, 0xde, 0x5f, 0xee, 0x9c, 0x9c, 0x33, 0x3d, 0x1d,
|
||||
0x78, 0x34, 0x93, 0x62, 0x85, 0x4a, 0xe7, 0x86, 0x4b, 0xf1, 0xdc, 0x1f, 0x46, 0xa5, 0x92, 0x46,
|
||||
0x92, 0x9e, 0xcf, 0xe2, 0x33, 0x80, 0x54, 0x2e, 0x97, 0x52, 0x30, 0xd4, 0x25, 0xa1, 0x70, 0x84,
|
||||
0x4a, 0xa5, 0xb2, 0x40, 0x1a, 0x0d, 0xa3, 0xe4, 0x90, 0x6d, 0x47, 0x72, 0x17, 0x5a, 0xa8, 0xd4,
|
||||
0x44, 0x2f, 0x68, 0x63, 0x18, 0x25, 0x1d, 0xb6, 0x99, 0xe2, 0x5f, 0x4d, 0xe8, 0xa5, 0x9e, 0x20,
|
||||
0x19, 0x42, 0x57, 0xfe, 0x10, 0xa8, 0x2e, 0x34, 0xaa, 0x6c, 0xec, 0x64, 0x3a, 0xcc, 0x47, 0xe4,
|
||||
0x09, 0xf4, 0x7d, 0x0b, 0xd9, 0x78, 0x23, 0x79, 0x83, 0x92, 0x87, 0x00, 0x0a, 0x67, 0xab, 0x89,
|
||||
0x5e, 0x7c, 0x2a, 0x0d, 0x3d, 0x70, 0x7e, 0x3c, 0x42, 0x9e, 0xc1, 0x6d, 0xff, 0x89, 0xe9, 0x55,
|
||||
0x89, 0xb4, 0xe9, 0xb6, 0xfe, 0xe2, 0xd6, 0x7e, 0x55, 0x1b, 0x3a, 0xac, 0xed, 0xd7, 0x93, 0x0d,
|
||||
0xbc, 0x50, 0xb2, 0x2a, 0xb3, 0x31, 0x6d, 0xb9, 0x83, 0xed, 0x68, 0x73, 0x54, 0x42, 0x61, 0x5e,
|
||||
0xa4, 0xb2, 0x12, 0x86, 0x1e, 0x39, 0x61, 0x1f, 0x91, 0xc7, 0x70, 0x5c, 0xa8, 0x7c, 0x6e, 0xa6,
|
||||
0xb8, 0x36, 0x53, 0xbe, 0x44, 0xda, 0x1e, 0x46, 0xc9, 0x01, 0x0b, 0x21, 0x19, 0x40, 0x9b, 0xeb,
|
||||
0x73, 0x2e, 0x04, 0x16, 0xb4, 0x33, 0x8c, 0x92, 0x36, 0xbb, 0x9e, 0x49, 0x0c, 0xbd, 0xdc, 0x98,
|
||||
0x7c, 0x76, 0x89, 0x45, 0x26, 0xe6, 0x92, 0x82, 0xb3, 0x10, 0x30, 0x7b, 0x0b, 0xd7, 0xe7, 0x8a,
|
||||
0xaf, 0x72, 0x83, 0xe9, 0x65, 0x6e, 0x68, 0xd7, 0x89, 0x84, 0xd0, 0xba, 0x75, 0xc6, 0xdf, 0x18,
|
||||
0xf7, 0x1a, 0x7a, 0xb5, 0x5b, 0x0f, 0xd9, 0xbb, 0xb8, 0xfe, 0x28, 0x4d, 0x26, 0xde, 0x5b, 0x4a,
|
||||
0x8f, 0x9d, 0x4c, 0xc0, 0x48, 0x1f, 0x1a, 0xb8, 0xa6, 0x7d, 0xe7, 0xa2, 0x81, 0x6b, 0xf2, 0x12,
|
||||
0xee, 0x54, 0x65, 0x91, 0x1b, 0xbc, 0xd8, 0xc5, 0x76, 0x49, 0x6f, 0xb9, 0xa4, 0xff, 0x3e, 0x8c,
|
||||
0x7f, 0x47, 0x30, 0x98, 0xc8, 0x82, 0xcf, 0xaf, 0xfc, 0x62, 0xbc, 0xe3, 0xf8, 0xad, 0x60, 0xf8,
|
||||
0x9d, 0x9c, 0x41, 0xd0, 0x40, 0xd7, 0x90, 0xee, 0xe9, 0x60, 0x14, 0x54, 0xd5, 0x7f, 0x92, 0x05,
|
||||
0xfb, 0xe4, 0x3e, 0x74, 0xe6, 0x56, 0xcb, 0x05, 0x6d, 0xb8, 0xa0, 0x3b, 0x60, 0x4b, 0x53, 0xff,
|
||||
0xb4, 0x1f, 0xb8, 0xb6, 0xa5, 0x39, 0x48, 0x3a, 0xcc, 0x23, 0xae, 0x9e, 0x25, 0xaa, 0x6d, 0xf3,
|
||||
0x9a, 0x9b, 0x7a, 0xee, 0x50, 0xfc, 0x19, 0x4e, 0xf6, 0xba, 0xd7, 0x25, 0x79, 0x05, 0x30, 0xbb,
|
||||
0xfe, 0xc3, 0x6c, 0xcc, 0xd3, 0x9b, 0xe6, 0xb7, 0xe7, 0xcc, 0xdb, 0x3d, 0xfd, 0x19, 0x06, 0x27,
|
||||
0x02, 0xee, 0xed, 0xb9, 0x88, 0x24, 0xa1, 0xe0, 0xfe, 0xb7, 0x39, 0x78, 0xfa, 0x9f, 0x9b, 0xba,
|
||||
0x7c, 0xfb, 0xe0, 0xcb, 0xc9, 0x28, 0xf8, 0x20, 0xbc, 0xf6, 0x87, 0xaf, 0x2d, 0xf7, 0x79, 0x78,
|
||||
0xf1, 0x27, 0x00, 0x00, 0xff, 0xff, 0x12, 0x56, 0xaa, 0x7b, 0x41, 0x04, 0x00, 0x00,
|
||||
}
|
||||
|
@ -21,6 +21,8 @@ message Conversation{
|
||||
int32 groupAtType = 12;
|
||||
bool isNotInGroup = 13;
|
||||
string ex = 14;
|
||||
int64 updateUnreadCountTime = 15;
|
||||
|
||||
}
|
||||
message ModifyConversationFieldReq{
|
||||
Conversation conversation = 1;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
||||
syntax = "proto3";
|
||||
import "Open_IM/pkg/proto/sdk_ws/ws.proto";
|
||||
import "Open_IM/pkg/proto/conversation/conversation.proto";
|
||||
option go_package = "./user;user";
|
||||
package user;
|
||||
|
||||
@ -75,25 +76,8 @@ message SetGlobalRecvMessageOptResp{
|
||||
CommonResp commonResp = 1;
|
||||
}
|
||||
|
||||
message Conversation{
|
||||
string OwnerUserID = 1;
|
||||
string ConversationID = 2;
|
||||
int32 RecvMsgOpt = 3;
|
||||
int32 ConversationType = 4;
|
||||
string UserID = 5;
|
||||
string GroupID = 6;
|
||||
int32 UnreadCount = 7;
|
||||
int64 DraftTextTime = 8;
|
||||
bool IsPinned = 9;
|
||||
string AttachedInfo = 10;
|
||||
bool IsPrivateChat = 11;
|
||||
int32 GroupAtType = 12;
|
||||
bool IsNotInGroup = 13;
|
||||
string Ex = 14;
|
||||
}
|
||||
|
||||
message SetConversationReq{
|
||||
Conversation Conversation = 1;
|
||||
conversation.Conversation Conversation = 1;
|
||||
int32 notificationType = 2;
|
||||
string OperationID = 3;
|
||||
}
|
||||
@ -122,7 +106,7 @@ message GetConversationReq{
|
||||
|
||||
message GetConversationResp{
|
||||
CommonResp commonResp = 1;
|
||||
Conversation Conversation = 2;
|
||||
conversation.Conversation Conversation = 2;
|
||||
}
|
||||
|
||||
message GetConversationsReq{
|
||||
@ -133,7 +117,7 @@ message GetConversationsReq{
|
||||
|
||||
message GetConversationsResp{
|
||||
CommonResp commonResp = 1;
|
||||
repeated Conversation Conversations = 2;
|
||||
repeated conversation.Conversation Conversations = 2;
|
||||
}
|
||||
|
||||
message GetAllConversationsReq{
|
||||
@ -143,11 +127,11 @@ message GetAllConversationsReq{
|
||||
|
||||
message GetAllConversationsResp{
|
||||
CommonResp commonResp = 1;
|
||||
repeated Conversation Conversations = 2;
|
||||
repeated conversation.Conversation Conversations = 2;
|
||||
}
|
||||
|
||||
message BatchSetConversationsReq{
|
||||
repeated Conversation Conversations = 1;
|
||||
repeated conversation.Conversation Conversations = 1;
|
||||
string OwnerUserID = 2;
|
||||
int32 notificationType = 3;
|
||||
string OperationID = 4;
|
||||
@ -188,6 +172,7 @@ message User{
|
||||
int32 Gender = 12;
|
||||
int32 LoginLimit = 13;
|
||||
bool IsBlock = 14;
|
||||
string RegisterIp = 15;
|
||||
}
|
||||
|
||||
message GetUserByIdResp{
|
||||
@ -210,10 +195,13 @@ message GetUsersByNameResp {
|
||||
message AlterUserReq{
|
||||
string UserId = 1;
|
||||
string OperationID = 2;
|
||||
int64 PhoneNumber = 3;
|
||||
string PhoneNumber = 3;
|
||||
string Nickname = 4;
|
||||
string Email = 5;
|
||||
string OpUserId = 6;
|
||||
string Gender = 6;
|
||||
string Birth =7;
|
||||
string Photo = 8;
|
||||
string OpUserId = 9;
|
||||
}
|
||||
|
||||
message AlterUserResp{
|
||||
@ -238,7 +226,11 @@ message AddUserReq{
|
||||
string PhoneNumber = 2;
|
||||
string UserId = 3;
|
||||
string name = 4;
|
||||
string OpUserId = 5;
|
||||
string Email = 5;
|
||||
string Gender = 6;
|
||||
string Birth =7;
|
||||
string Photo = 8;
|
||||
string OpUserId = 9;
|
||||
}
|
||||
|
||||
message AddUserResp{
|
||||
|
Loading…
x
Reference in New Issue
Block a user