mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 11:36:44 +08:00
Error code standardization
This commit is contained in:
parent
007daaa014
commit
2a76dc3ac8
@ -25,13 +25,13 @@ func getFromToUserNickname(fromUserID, toUserID string) (string, string, error)
|
|||||||
return from.Nickname, to.Nickname, nil
|
return from.Nickname, to.Nickname, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func friendNotification(commID *pbFriend.CommID, contentType int32, m proto.Message) {
|
func friendNotification(operationID, fromUserID, toUserID string, contentType int32, m proto.Message) {
|
||||||
log.Info(commID.OperationID, utils.GetSelfFuncName(), "args: ", commID, contentType)
|
log.Info(operationID, utils.GetSelfFuncName(), "args: ", commID, contentType)
|
||||||
var err error
|
var err error
|
||||||
var tips open_im_sdk.TipsComm
|
var tips open_im_sdk.TipsComm
|
||||||
tips.Detail, err = proto.Marshal(m)
|
tips.Detail, err = proto.Marshal(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(commID.OperationID, "Marshal failed ", err.Error(), m.String())
|
log.Error(operationID, "Marshal failed ", err.Error(), m.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,9 +43,9 @@ func friendNotification(commID *pbFriend.CommID, contentType int32, m proto.Mess
|
|||||||
|
|
||||||
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||||
|
|
||||||
fromUserNickname, toUserNickname, err := getFromToUserNickname(commID.FromUserID, commID.ToUserID)
|
fromUserNickname, toUserNickname, err := getFromToUserNickname(fromUserID, toUserID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(commID.OperationID, "getFromToUserNickname failed ", err.Error(), commID.FromUserID, commID.ToUserID)
|
log.Error(operationID, "getFromToUserNickname failed ", err.Error(), fromUserID, toUserID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cn := config.Config.Notification
|
cn := config.Config.Notification
|
||||||
@ -71,20 +71,20 @@ func friendNotification(commID *pbFriend.CommID, contentType int32, m proto.Mess
|
|||||||
case constant.FriendInfoUpdatedNotification:
|
case constant.FriendInfoUpdatedNotification:
|
||||||
tips.DefaultTips = cn.FriendInfoUpdated.DefaultTips.Tips + toUserNickname
|
tips.DefaultTips = cn.FriendInfoUpdated.DefaultTips.Tips + toUserNickname
|
||||||
default:
|
default:
|
||||||
log.Error(commID.OperationID, "contentType failed ", contentType)
|
log.Error(operationID, "contentType failed ", contentType)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var n NotificationMsg
|
var n NotificationMsg
|
||||||
n.SendID = commID.FromUserID
|
n.SendID = fromUserID
|
||||||
n.RecvID = commID.ToUserID
|
n.RecvID = toUserID
|
||||||
n.ContentType = contentType
|
n.ContentType = contentType
|
||||||
n.SessionType = constant.SingleChatType
|
n.SessionType = constant.SingleChatType
|
||||||
n.MsgFrom = constant.SysMsgType
|
n.MsgFrom = constant.SysMsgType
|
||||||
n.OperationID = commID.OperationID
|
n.OperationID = operationID
|
||||||
n.Content, err = proto.Marshal(&tips)
|
n.Content, err = proto.Marshal(&tips)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(commID.OperationID, "Marshal failed ", err.Error(), tips.String())
|
log.Error(operationID, "Marshal failed ", err.Error(), tips.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Notification(&n)
|
Notification(&n)
|
||||||
@ -160,7 +160,7 @@ func BlackDeletedNotification(req *pbFriend.RemoveBlacklistReq) {
|
|||||||
friendNotification(req.CommID, constant.BlackDeletedNotification, &blackDeletedTips)
|
friendNotification(req.CommID, constant.BlackDeletedNotification, &blackDeletedTips)
|
||||||
}
|
}
|
||||||
|
|
||||||
//send to myself
|
// send to myself
|
||||||
func UserInfoUpdatedNotification(operationID, opUserID string, changedUserID string) {
|
func UserInfoUpdatedNotification(operationID, opUserID string, changedUserID string) {
|
||||||
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID}
|
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID}
|
||||||
commID := pbFriend.CommID{FromUserID: opUserID, ToUserID: changedUserID, OpUserID: opUserID, OperationID: operationID}
|
commID := pbFriend.CommID{FromUserID: opUserID, ToUserID: changedUserID, OpUserID: opUserID, OperationID: operationID}
|
||||||
@ -169,6 +169,5 @@ func UserInfoUpdatedNotification(operationID, opUserID string, changedUserID str
|
|||||||
|
|
||||||
func FriendInfoUpdatedNotification(operationID, changedUserID string, needNotifiedUserID string, opUserID string) {
|
func FriendInfoUpdatedNotification(operationID, changedUserID string, needNotifiedUserID string, opUserID string) {
|
||||||
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID}
|
selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: changedUserID}
|
||||||
commID := pbFriend.CommID{FromUserID: opUserID, ToUserID: needNotifiedUserID, OpUserID: opUserID, OperationID: operationID}
|
friendNotification(operationID, opUserID, needNotifiedUserID, constant.FriendInfoUpdatedNotification, &selfInfoUpdatedTips)
|
||||||
friendNotification(&commID, constant.FriendInfoUpdatedNotification, &selfInfoUpdatedTips)
|
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,12 @@ import (
|
|||||||
"Open_IM/pkg/common/token_verify"
|
"Open_IM/pkg/common/token_verify"
|
||||||
"Open_IM/pkg/common/tools"
|
"Open_IM/pkg/common/tools"
|
||||||
"Open_IM/pkg/getcdv3"
|
"Open_IM/pkg/getcdv3"
|
||||||
pbConversation "Open_IM/pkg/proto/conversation"
|
|
||||||
pbFriend "Open_IM/pkg/proto/friend"
|
pbFriend "Open_IM/pkg/proto/friend"
|
||||||
|
pbGroup "Open_IM/pkg/proto/group"
|
||||||
pbUser "Open_IM/pkg/proto/user"
|
pbUser "Open_IM/pkg/proto/user"
|
||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
|
"github.com/golang/protobuf/ptypes/wrappers"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -59,7 +60,7 @@ func NewUserServer(port int) *userServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *userServer) Run() {
|
func (s *userServer) Run() {
|
||||||
log.NewInfo("0", "rpc user start...")
|
log.NewInfo("", "rpc user start...")
|
||||||
|
|
||||||
listenIP := ""
|
listenIP := ""
|
||||||
if config.Config.ListenIP == "" {
|
if config.Config.ListenIP == "" {
|
||||||
@ -74,7 +75,7 @@ func (s *userServer) Run() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic("listening err:" + err.Error() + s.rpcRegisterName)
|
panic("listening err:" + err.Error() + s.rpcRegisterName)
|
||||||
}
|
}
|
||||||
log.NewInfo("0", "listen network success, address ", address, listener)
|
log.NewInfo("", "listen network success, address ", address, listener)
|
||||||
defer listener.Close()
|
defer listener.Close()
|
||||||
//grpc server
|
//grpc server
|
||||||
var grpcOpts []grpc.ServerOption
|
var grpcOpts []grpc.ServerOption
|
||||||
@ -99,327 +100,70 @@ func (s *userServer) Run() {
|
|||||||
log.Error("", "GetLocalIP failed ", err.Error())
|
log.Error("", "GetLocalIP failed ", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10)
|
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName, 10, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName)
|
log.NewError("", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), rpcRegisterIP, s.rpcPort, s.rpcRegisterName)
|
||||||
panic(utils.Wrap(err, "register user module rpc to etcd err"))
|
panic(utils.Wrap(err, "register user module rpc to etcd err"))
|
||||||
}
|
}
|
||||||
err = srv.Serve(listener)
|
err = srv.Serve(listener)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError("0", "Serve failed ", err.Error())
|
log.NewError("", "Serve failed ", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.NewInfo("0", "rpc user success")
|
log.NewInfo("", "rpc user success")
|
||||||
}
|
}
|
||||||
|
|
||||||
func syncPeerUserConversation(conversation *pbConversation.Conversation, operationID string) error {
|
func (s *userServer) SyncJoinedGroupMemberFaceURL(ctx context.Context, userID string, faceURL string, operationID string, opUserID string) {
|
||||||
peerUserConversation := imdb.Conversation{
|
etcdConn, err := getcdv3.GetConn(ctx, config.Config.RpcRegisterName.OpenImFriendName)
|
||||||
OwnerUserID: conversation.UserID,
|
|
||||||
ConversationID: utils.GetConversationIDBySessionType(conversation.OwnerUserID, constant.SingleChatType),
|
|
||||||
ConversationType: constant.SingleChatType,
|
|
||||||
UserID: conversation.OwnerUserID,
|
|
||||||
GroupID: "",
|
|
||||||
RecvMsgOpt: 0,
|
|
||||||
UnreadCount: 0,
|
|
||||||
DraftTextTime: 0,
|
|
||||||
IsPinned: false,
|
|
||||||
IsPrivateChat: conversation.IsPrivateChat,
|
|
||||||
AttachedInfo: "",
|
|
||||||
Ex: "",
|
|
||||||
}
|
|
||||||
err := imdb.PeerUserSetConversation(peerUserConversation)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
chat.ConversationSetPrivateNotification(operationID, conversation.OwnerUserID, conversation.UserID, conversation.IsPrivateChat)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.BatchSetConversationsReq) (*pbUser.BatchSetConversationsResp, error) {
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
|
||||||
if req.NotificationType == 0 {
|
|
||||||
req.NotificationType = constant.ConversationOptChangeNotification
|
|
||||||
}
|
|
||||||
resp := &pbUser.BatchSetConversationsResp{}
|
|
||||||
for _, v := range req.Conversations {
|
|
||||||
conversation := imdb.Conversation{}
|
|
||||||
if err := utils.CopyStructFields(&conversation, v); err != nil {
|
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), v.String(), "CopyStructFields failed", err.Error())
|
|
||||||
}
|
|
||||||
//redis op
|
|
||||||
if err := db.DB.SetSingleConversationRecvMsgOpt(req.OwnerUserID, v.ConversationID, v.RecvMsgOpt); err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
isUpdate, err := imdb.SetConversation(conversation)
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
|
|
||||||
resp.Failed = append(resp.Failed, v.ConversationID)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if isUpdate {
|
|
||||||
err = rocksCache.DelConversationFromCache(v.OwnerUserID, v.ConversationID)
|
|
||||||
} else {
|
|
||||||
err = rocksCache.DelUserConversationIDListFromCache(v.OwnerUserID)
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), v.ConversationID, v.OwnerUserID)
|
|
||||||
}
|
|
||||||
resp.Success = append(resp.Success, v.ConversationID)
|
|
||||||
// if is set private msg operation,then peer user need to sync and set tips\
|
|
||||||
if v.ConversationType == constant.SingleChatType && req.NotificationType == constant.ConversationPrivateChatNotification {
|
|
||||||
if err := syncPeerUserConversation(v, req.OperationID); err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
chat.ConversationChangeNotification(req.OperationID, req.OwnerUserID)
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
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: []*pbConversation.Conversation{}}
|
|
||||||
conversations, err := rocksCache.GetUserAllConversationList(req.OwnerUserID)
|
|
||||||
log.NewDebug(req.OperationID, "conversations: ", conversations)
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversations error", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
if err = utils.CopyStructFields(&resp.Conversations, conversations); err != nil {
|
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields error", err.Error())
|
|
||||||
}
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
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: &pbConversation.Conversation{}}
|
|
||||||
conversation, err := rocksCache.GetConversationFromCache(req.OwnerUserID, req.ConversationID)
|
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "conversation", conversation)
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversation error", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
if err := utils.CopyStructFields(resp.Conversation, &conversation); err != nil {
|
|
||||||
log.Debug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields error", conversation, err.Error())
|
|
||||||
}
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
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: []*pbConversation.Conversation{}}
|
|
||||||
conversations, err := rocksCache.GetConversationsFromCache(req.OwnerUserID, req.ConversationIDs)
|
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "conversations", conversations)
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversations error", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
if err := utils.CopyStructFields(&resp.Conversations, conversations); err != nil {
|
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", conversations, err.Error())
|
|
||||||
}
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *userServer) SetConversation(ctx context.Context, req *pbUser.SetConversationReq) (*pbUser.SetConversationResp, error) {
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
|
||||||
resp := &pbUser.SetConversationResp{}
|
|
||||||
if req.NotificationType == 0 {
|
|
||||||
req.NotificationType = constant.ConversationOptChangeNotification
|
|
||||||
}
|
|
||||||
if req.Conversation.ConversationType == constant.GroupChatType {
|
|
||||||
groupInfo, err := imdb.GetGroupInfoByGroupID(req.Conversation.GroupID)
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.Conversation.GroupID, err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
if groupInfo.Status == constant.GroupStatusDismissed && !req.Conversation.IsNotInGroup {
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "group status is dismissed", groupInfo)
|
|
||||||
errMsg := "group status is dismissed"
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var conversation imdb.Conversation
|
|
||||||
if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil {
|
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req.Conversation, err.Error())
|
|
||||||
}
|
|
||||||
if err := db.DB.SetSingleConversationRecvMsgOpt(req.Conversation.OwnerUserID, req.Conversation.ConversationID, req.Conversation.RecvMsgOpt); err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
isUpdate, err := imdb.SetConversation(conversation)
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
if isUpdate {
|
|
||||||
err = rocksCache.DelConversationFromCache(req.Conversation.OwnerUserID, req.Conversation.ConversationID)
|
|
||||||
} else {
|
|
||||||
err = rocksCache.DelUserConversationIDListFromCache(req.Conversation.OwnerUserID)
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.Conversation.ConversationID, req.Conversation.OwnerUserID)
|
|
||||||
}
|
|
||||||
|
|
||||||
// notification
|
|
||||||
if req.Conversation.ConversationType == constant.SingleChatType && req.NotificationType == constant.ConversationPrivateChatNotification {
|
|
||||||
//sync peer user conversation if conversation is singleChatType
|
|
||||||
if err := syncPeerUserConversation(req.Conversation, req.OperationID); err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
chat.ConversationChangeNotification(req.OperationID, req.Conversation.OwnerUserID)
|
|
||||||
}
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *userServer) SetRecvMsgOpt(ctx context.Context, req *pbUser.SetRecvMsgOptReq) (*pbUser.SetRecvMsgOptResp, error) {
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
|
||||||
resp := &pbUser.SetRecvMsgOptResp{}
|
|
||||||
var conversation imdb.Conversation
|
|
||||||
if err := utils.CopyStructFields(&conversation, req); err != nil {
|
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req, err.Error())
|
|
||||||
}
|
|
||||||
if err := db.DB.SetSingleConversationRecvMsgOpt(req.OwnerUserID, req.ConversationID, req.RecvMsgOpt); err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
stringList := strings.Split(req.ConversationID, "_")
|
|
||||||
if len(stringList) > 1 {
|
|
||||||
switch stringList[0] {
|
|
||||||
case "single":
|
|
||||||
conversation.UserID = stringList[1]
|
|
||||||
conversation.ConversationType = constant.SingleChatType
|
|
||||||
case "group":
|
|
||||||
conversation.GroupID = stringList[1]
|
|
||||||
conversation.ConversationType = constant.GroupChatType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
isUpdate, err := imdb.SetRecvMsgOpt(conversation)
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
if isUpdate {
|
|
||||||
err = rocksCache.DelConversationFromCache(conversation.OwnerUserID, conversation.ConversationID)
|
|
||||||
} else {
|
|
||||||
err = rocksCache.DelUserConversationIDListFromCache(conversation.OwnerUserID)
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), conversation.ConversationID, err.Error())
|
|
||||||
}
|
|
||||||
chat.ConversationChangeNotification(req.OperationID, req.OwnerUserID)
|
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *userServer) GetAllUserID(_ context.Context, req *pbUser.GetAllUserIDReq) (*pbUser.GetAllUserIDResp, error) {
|
|
||||||
log.NewInfo(req.OperationID, "GetAllUserID args ", req.String())
|
|
||||||
if !token_verify.IsManagerUserID(req.OpUserID) {
|
|
||||||
log.NewError(req.OperationID, "IsManagerUserID false ", req.OpUserID)
|
|
||||||
return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
|
|
||||||
}
|
|
||||||
uidList, err := imdb.SelectAllUserID()
|
|
||||||
if err != nil {
|
|
||||||
log.NewError(req.OperationID, "SelectAllUserID false ", err.Error())
|
|
||||||
return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
|
||||||
} else {
|
|
||||||
log.NewInfo(req.OperationID, "GetAllUserID rpc return ", pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{}, UserIDList: uidList})
|
|
||||||
return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{}, UserIDList: uidList}, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *userServer) SyncJoinedGroupMemberFaceURL(userID string, faceURL string, operationID string, opUserID string) {
|
|
||||||
joinedGroupIDList, err := rocksCache.GetJoinedGroupIDListFromCache(userID)
|
|
||||||
if err != nil {
|
|
||||||
log.NewWarn(operationID, "GetJoinedGroupIDListByUserID failed ", userID, err.Error())
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, groupID := range joinedGroupIDList {
|
client := pbGroup.NewGroupClient(etcdConn)
|
||||||
groupMemberInfo := imdb.GroupMember{UserID: userID, GroupID: groupID, FaceURL: faceURL}
|
newReq := &pbGroup.GetJoinedGroupListReq{FromUserID: userID}
|
||||||
if err := imdb.UpdateGroupMemberInfo(groupMemberInfo); err != nil {
|
rpcResp, err := client.GetJoinedGroupList(ctx, newReq)
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), groupMemberInfo)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
//if err := rocksCache.DelAllGroupMembersInfoFromCache(groupID); err != nil {
|
|
||||||
// log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), groupID)
|
|
||||||
// continue
|
|
||||||
//}
|
|
||||||
if err := rocksCache.DelGroupMemberInfoFromCache(groupID, userID); err != nil {
|
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), groupID, userID)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
chat.GroupMemberInfoSetNotification(operationID, opUserID, groupID, userID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *userServer) SyncJoinedGroupMemberNickname(userID string, newNickname, oldNickname string, operationID string, opUserID string) {
|
|
||||||
joinedGroupIDList, err := imdb.GetJoinedGroupIDListByUserID(userID)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewWarn(operationID, "GetJoinedGroupIDListByUserID failed ", userID, err.Error())
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, v := range joinedGroupIDList {
|
|
||||||
member, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(v, userID)
|
for _, group := range rpcResp.Groups {
|
||||||
|
req := &pbGroup.SetGroupMemberInfoReq{GroupID: group.GroupID, UserID: userID, FaceURL: &wrappers.StringValue{Value: faceURL}}
|
||||||
|
_, err := client.SetGroupMemberInfo(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewWarn(operationID, "GetGroupMemberInfoByGroupIDAndUserID failed ", err.Error(), v, userID)
|
return
|
||||||
continue
|
|
||||||
}
|
|
||||||
if member.Nickname == oldNickname {
|
|
||||||
groupMemberInfo := imdb.GroupMember{UserID: userID, GroupID: v, Nickname: newNickname}
|
|
||||||
if err := imdb.UpdateGroupMemberInfo(groupMemberInfo); err != nil {
|
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), groupMemberInfo)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
//if err := rocksCache.DelAllGroupMembersInfoFromCache(v); err != nil {
|
|
||||||
// log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), v)
|
|
||||||
// continue
|
|
||||||
//}
|
|
||||||
if err := rocksCache.DelGroupMemberInfoFromCache(v, userID); err != nil {
|
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), err.Error(), v)
|
|
||||||
}
|
|
||||||
chat.GroupMemberInfoSetNotification(operationID, opUserID, v, userID)
|
|
||||||
}
|
}
|
||||||
|
chat.GroupMemberInfoSetNotification(operationID, opUserID, group.GroupID, userID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *userServer) AddUser(ctx context.Context, req *pbUser.AddUserReq) (*pbUser.AddUserResp, error) {
|
func (s *userServer) SyncJoinedGroupMemberNickname(ctx context.Context, userID string, newNickname, oldNickname string, operationID string, opUserID string) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
etcdConn, err := getcdv3.GetConn(ctx, config.Config.RpcRegisterName.OpenImFriendName)
|
||||||
resp := &pbUser.AddUserResp{CommonResp: &pbUser.CommonResp{}}
|
|
||||||
err := imdb.AddUser(req.UserInfo.UserID, req.UserInfo.PhoneNumber, req.UserInfo.Nickname, req.UserInfo.Email, req.UserInfo.Gender, req.UserInfo.FaceURL, req.UserInfo.BirthStr)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "AddUser", err.Error(), req.String())
|
return
|
||||||
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
|
}
|
||||||
resp.CommonResp.ErrMsg = err.Error()
|
client := pbGroup.NewGroupClient(etcdConn)
|
||||||
return resp, nil
|
newReq := &pbGroup.GetJoinedGroupListReq{FromUserID: userID}
|
||||||
|
rpcResp, err := client.GetJoinedGroupList(ctx, newReq)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req := pbGroup.GetUserInGroupMembersReq{UserID: userID}
|
||||||
|
for _, group := range rpcResp.Groups {
|
||||||
|
req.GroupIDs = append(req.GroupIDs, group.GroupID)
|
||||||
|
}
|
||||||
|
resp, err := client.GetUserInGroupMembers(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for _, v := range resp.Members {
|
||||||
|
if v.Nickname == oldNickname {
|
||||||
|
req := pbGroup.SetGroupMemberNicknameReq{Nickname: newNickname, GroupID: v.GroupID, UserID: v.UserID}
|
||||||
|
_, err := client.SetGroupMemberNickname(ctx, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
chat.GroupMemberInfoSetNotification(operationID, opUserID, v.GroupID, userID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *userServer) GetUsersInfo(ctx context.Context, req *pbUser.GetUsersInfoReq) (*pbUser.GetUsersInfoResp, error) {
|
func (s *userServer) GetUsersInfo(ctx context.Context, req *pbUser.GetUsersInfoReq) (*pbUser.GetUsersInfoResp, error) {
|
||||||
@ -444,7 +188,6 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
oldNickname := ""
|
oldNickname := ""
|
||||||
if req.UserInfo.Nickname != "" {
|
if req.UserInfo.Nickname != "" {
|
||||||
u, err := s.Take(ctx, req.UserInfo.UserID)
|
u, err := s.Take(ctx, req.UserInfo.UserID)
|
||||||
@ -453,7 +196,6 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI
|
|||||||
}
|
}
|
||||||
oldNickname = u.Nickname
|
oldNickname = u.Nickname
|
||||||
}
|
}
|
||||||
|
|
||||||
user, err := utils2.NewPBUser(req.UserInfo).Convert()
|
user, err := utils2.NewPBUser(req.UserInfo).Convert()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -466,36 +208,26 @@ func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserI
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
client := pbFriend.NewFriendClient(etcdConn)
|
client := pbFriend.NewFriendClient(etcdConn)
|
||||||
newReq := &pbFriend.GetFriendListReq{
|
newReq := &pbFriend.GetFriendListReq{UserID: req.UserInfo.UserID}
|
||||||
CommID: &pbFriend.CommID{OperationID: req.OperationID, FromUserID: req.UserInfo.UserID, OpUserID: req.OpUserID},
|
|
||||||
}
|
|
||||||
|
|
||||||
rpcResp, err := client.GetFriendList(context.Background(), newReq)
|
rpcResp, err := client.GetFriendList(context.Background(), newReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, "GetFriendList failed ", err.Error(), newReq)
|
return nil, err
|
||||||
return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: 500, ErrMsg: err.Error()}}, nil
|
|
||||||
}
|
}
|
||||||
for _, v := range rpcResp.FriendInfoList {
|
go func() {
|
||||||
log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, v.FriendUser.UserID)
|
for _, v := range rpcResp.FriendInfoList {
|
||||||
// chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID)
|
chat.FriendInfoUpdatedNotification(tools.OperationID(ctx), req.UserInfo.UserID, v.FriendUser.UserID, tools.OpUserID(ctx))
|
||||||
chat.FriendInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID, req.OpUserID)
|
}
|
||||||
}
|
}()
|
||||||
if err := rocksCache.DelUserInfoFromCache(user.UserID); err != nil {
|
|
||||||
log.NewError(req.OperationID, "GetFriendList failed ", err.Error(), newReq)
|
chat.UserInfoUpdatedNotification(tools.OperationID(ctx), tools.OpUserID(ctx), req.UserInfo.UserID)
|
||||||
return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: err.Error()}}, nil
|
|
||||||
}
|
|
||||||
//chat.UserInfoUpdatedNotification(req.OperationID, req.OpUserID, req.UserInfo.UserID)
|
|
||||||
chat.UserInfoUpdatedNotification(req.OperationID, req.OpUserID, req.UserInfo.UserID)
|
|
||||||
log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, req.OpUserID)
|
|
||||||
if req.UserInfo.FaceURL != "" {
|
if req.UserInfo.FaceURL != "" {
|
||||||
s.SyncJoinedGroupMemberFaceURL(req.UserInfo.UserID, req.UserInfo.FaceURL, req.OperationID, req.OpUserID)
|
s.SyncJoinedGroupMemberFaceURL(ctx, req.UserInfo.UserID, req.UserInfo.FaceURL, tools.OperationID(ctx), tools.OpUserID(ctx))
|
||||||
}
|
}
|
||||||
if req.UserInfo.Nickname != "" {
|
if req.UserInfo.Nickname != "" {
|
||||||
s.SyncJoinedGroupMemberNickname(req.UserInfo.UserID, req.UserInfo.Nickname, oldNickname, req.OperationID, req.OpUserID)
|
s.SyncJoinedGroupMemberNickname(ctx, req.UserInfo.UserID, req.UserInfo.Nickname, oldNickname, tools.OperationID(ctx), tools.OpUserID(ctx))
|
||||||
}
|
}
|
||||||
return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{}}, nil
|
return &resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *userServer) SetGlobalRecvMessageOpt(ctx context.Context, req *pbUser.SetGlobalRecvMessageOptReq) (*pbUser.SetGlobalRecvMessageOptResp, error) {
|
func (s *userServer) SetGlobalRecvMessageOpt(ctx context.Context, req *pbUser.SetGlobalRecvMessageOptReq) (*pbUser.SetGlobalRecvMessageOptResp, error) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -18,10 +18,10 @@ message CreateGroupResp{
|
|||||||
|
|
||||||
|
|
||||||
message GetGroupsInfoReq{
|
message GetGroupsInfoReq{
|
||||||
repeated string groupIDList = 1;
|
repeated string groupIDs = 1;
|
||||||
}
|
}
|
||||||
message GetGroupsInfoResp{
|
message GetGroupsInfoResp{
|
||||||
repeated server_api_params.GroupInfo groupInfoList = 1;
|
repeated server_api_params.GroupInfo groupInfos = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ message GetGroupApplicationListReq {
|
|||||||
}
|
}
|
||||||
message GetGroupApplicationListResp {
|
message GetGroupApplicationListResp {
|
||||||
int32 total = 1;
|
int32 total = 1;
|
||||||
repeated server_api_params.GroupRequest groupRequestList = 2;
|
repeated server_api_params.GroupRequest groupRequests = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetUserReqApplicationListReq{
|
message GetUserReqApplicationListReq{
|
||||||
@ -48,7 +48,7 @@ message GetUserReqApplicationListReq{
|
|||||||
|
|
||||||
message GetUserReqApplicationListResp{
|
message GetUserReqApplicationListResp{
|
||||||
int32 total = 1;
|
int32 total = 1;
|
||||||
repeated server_api_params.GroupRequest groupRequestList = 2;
|
repeated server_api_params.GroupRequest groupRequests = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -94,14 +94,12 @@ message QuitGroupResp{
|
|||||||
message GetGroupMemberListReq {
|
message GetGroupMemberListReq {
|
||||||
string groupID = 1;
|
string groupID = 1;
|
||||||
int32 filter = 2;
|
int32 filter = 2;
|
||||||
int32 nextSeq = 3;
|
|
||||||
server_api_params.RequestPagination pagination = 4;
|
server_api_params.RequestPagination pagination = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupMemberListResp {
|
message GetGroupMemberListResp {
|
||||||
int32 total = 1;
|
int32 total = 1;
|
||||||
repeated server_api_params.GroupMemberFullInfo memberList = 2;
|
repeated server_api_params.GroupMemberFullInfo members = 2;
|
||||||
int32 nextSeq = 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +109,7 @@ message GetGroupMembersInfoReq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupMembersInfoResp {
|
message GetGroupMembersInfoResp {
|
||||||
repeated server_api_params.GroupMemberFullInfo memberList = 1;
|
repeated server_api_params.GroupMemberFullInfo members = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message KickGroupMemberReq {
|
message KickGroupMemberReq {
|
||||||
@ -131,14 +129,14 @@ message GetJoinedGroupListReq {
|
|||||||
}
|
}
|
||||||
message GetJoinedGroupListResp{
|
message GetJoinedGroupListResp{
|
||||||
int32 total = 1;
|
int32 total = 1;
|
||||||
repeated server_api_params.GroupInfo groupList = 2;
|
repeated server_api_params.GroupInfo groups = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message InviteUserToGroupReq {
|
message InviteUserToGroupReq {
|
||||||
string groupID = 1;
|
string groupID = 1;
|
||||||
string reason = 2;
|
string reason = 2;
|
||||||
repeated string invitedUserIDList = 3;
|
repeated string invitedUserIDs = 3;
|
||||||
}
|
}
|
||||||
message InviteUserToGroupResp {
|
message InviteUserToGroupResp {
|
||||||
|
|
||||||
@ -147,11 +145,10 @@ message InviteUserToGroupResp {
|
|||||||
|
|
||||||
message GetGroupAllMemberReq {
|
message GetGroupAllMemberReq {
|
||||||
string groupID = 1;
|
string groupID = 1;
|
||||||
int32 offset = 2;
|
server_api_params.RequestPagination pagination = 2;
|
||||||
int32 count = 3;
|
|
||||||
}
|
}
|
||||||
message GetGroupAllMemberResp {
|
message GetGroupAllMemberResp {
|
||||||
repeated server_api_params.GroupMemberFullInfo memberList = 1;
|
repeated server_api_params.GroupMemberFullInfo members = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CMSGroup {
|
message CMSGroup {
|
||||||
@ -250,15 +247,15 @@ message GetJoinedSuperGroupListReq {
|
|||||||
|
|
||||||
message GetJoinedSuperGroupListResp {
|
message GetJoinedSuperGroupListResp {
|
||||||
int32 total = 1;
|
int32 total = 1;
|
||||||
repeated server_api_params.GroupInfo groupList = 2;
|
repeated server_api_params.GroupInfo groups = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetSuperGroupsInfoReq {
|
message GetSuperGroupsInfoReq {
|
||||||
repeated string groupIDList = 1;
|
repeated string groupIDs = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetSuperGroupsInfoResp {
|
message GetSuperGroupsInfoResp {
|
||||||
repeated server_api_params.GroupInfo groupInfoList = 1;
|
repeated server_api_params.GroupInfo groupInfos = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetGroupMemberInfoReq{
|
message SetGroupMemberInfoReq{
|
||||||
@ -288,6 +285,13 @@ message GetGroupAbstractInfoResp{
|
|||||||
repeated GroupAbstractInfo groupAbstractInfos = 1;
|
repeated GroupAbstractInfo groupAbstractInfos = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message getUserInGroupMembersReq {
|
||||||
|
string userID = 1;
|
||||||
|
repeated string groupIDs = 2;
|
||||||
|
}
|
||||||
|
message getUserInGroupMembersResp{
|
||||||
|
repeated server_api_params.GroupMemberFullInfo members = 1;
|
||||||
|
}
|
||||||
|
|
||||||
service group{
|
service group{
|
||||||
//创建群
|
//创建群
|
||||||
@ -319,30 +323,32 @@ service group{
|
|||||||
//邀请某些人进群
|
//邀请某些人进群
|
||||||
rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp);
|
rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp);
|
||||||
|
|
||||||
rpc GetGroups(GetGroupsReq) returns(GetGroupsResp);
|
rpc getGroups(GetGroupsReq) returns(GetGroupsResp);
|
||||||
rpc GetGroupMembersCMS(GetGroupMembersCMSReq) returns(GetGroupMembersCMSResp);
|
rpc getGroupMembersCMS(GetGroupMembersCMSReq) returns(GetGroupMembersCMSResp);
|
||||||
|
|
||||||
//解散群
|
//解散群
|
||||||
rpc DismissGroup(DismissGroupReq) returns(DismissGroupResp);
|
rpc dismissGroup(DismissGroupReq) returns(DismissGroupResp);
|
||||||
//对某个群成员禁言
|
//对某个群成员禁言
|
||||||
rpc MuteGroupMember(MuteGroupMemberReq) returns(MuteGroupMemberResp);
|
rpc muteGroupMember(MuteGroupMemberReq) returns(MuteGroupMemberResp);
|
||||||
//对某个群成员取消禁言
|
//对某个群成员取消禁言
|
||||||
rpc CancelMuteGroupMember(CancelMuteGroupMemberReq) returns(CancelMuteGroupMemberResp);
|
rpc cancelMuteGroupMember(CancelMuteGroupMemberReq) returns(CancelMuteGroupMemberResp);
|
||||||
//对某个群禁言
|
//对某个群禁言
|
||||||
rpc MuteGroup(MuteGroupReq) returns(MuteGroupResp);
|
rpc muteGroup(MuteGroupReq) returns(MuteGroupResp);
|
||||||
//对某个群取消禁言
|
//对某个群取消禁言
|
||||||
rpc CancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp);
|
rpc cancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp);
|
||||||
|
|
||||||
//获取某个用户加入的超级群
|
//获取某个用户加入的超级群
|
||||||
rpc GetJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp);
|
rpc getJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp);
|
||||||
//获取指定的超级群信息
|
//获取指定的超级群信息
|
||||||
rpc GetSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
|
rpc getSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
|
||||||
//设置群成员昵称
|
//设置群成员昵称
|
||||||
rpc SetGroupMemberNickname(SetGroupMemberNicknameReq) returns (SetGroupMemberNicknameResp);
|
rpc setGroupMemberNickname(SetGroupMemberNicknameReq) returns (SetGroupMemberNicknameResp);
|
||||||
//设置群成员信息
|
//设置群成员信息
|
||||||
rpc SetGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);
|
rpc setGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);
|
||||||
//获取群信息hash值
|
//获取群信息hash值
|
||||||
rpc GetGroupAbstractInfo(GetGroupAbstractInfoReq) returns (GetGroupAbstractInfoResp);
|
rpc getGroupAbstractInfo(GetGroupAbstractInfoReq) returns (GetGroupAbstractInfoResp);
|
||||||
|
//获取某个用户在指定群中的信息
|
||||||
|
rpc getUserInGroupMembers(getUserInGroupMembersReq) returns (getUserInGroupMembersResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user