mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 02:16:16 +08:00
proto modify
This commit is contained in:
parent
9ecd43af73
commit
8d0148c4ba
@ -12,10 +12,18 @@ func main() {
|
|||||||
if err := config.InitConfig(); err != nil {
|
if err := config.InitConfig(); err != nil {
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
}
|
}
|
||||||
var userID = flag.String("user_id", "", "userID to clear msg and reset seq")
|
// clear msg by id
|
||||||
var superGroupID = flag.String("super_group_id", "", "superGroupID to clear msg and reset seq")
|
var userIDClearMsg = flag.String("user_id_fix_seq", "", "userID to clear msg and reset seq")
|
||||||
|
var superGroupIDClearMsg = flag.String("super_group_id_fix_seq", "", "superGroupID to clear msg and reset seq")
|
||||||
|
// show seq by id
|
||||||
|
var userIDShowSeq = flag.String("user_id_show_seq", "", "show userID")
|
||||||
|
var superGroupIDShowSeq = flag.String("super_group_id_show_seq", "", "userID to clear msg and reset seq")
|
||||||
|
// fix seq by id
|
||||||
|
var userIDFixSeq = flag.String("user_id_fix_seq", "", "userID to Fix Seq")
|
||||||
|
var superGroupIDFixSeq = flag.String("super_group_id_fix_seq", "", "super groupID to fix Seq")
|
||||||
var fixAllSeq = flag.Bool("fix_all_seq", false, "fix seq")
|
var fixAllSeq = flag.Bool("fix_all_seq", false, "fix seq")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
fmt.Println(time.Now(), "start cronTask", *userID, *superGroupID)
|
fmt.Println(time.Now(), "start cronTask", *userIDFixSeq, *superGroupIDFixSeq)
|
||||||
task.FixSeq(*userID, *superGroupID, *fixAllSeq)
|
task.FixSeq(*userID, *superGroupID, *fixAllSeq)
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ type NotificationMsg struct {
|
|||||||
SenderFaceURL string
|
SenderFaceURL string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Check) Notification(ctx context.Context, notificationMsg *NotificationMsg) {
|
func (c *Check) Notification(ctx context.Context, notificationMsg *NotificationMsg) error {
|
||||||
var err error
|
var err error
|
||||||
defer func() {
|
defer func() {
|
||||||
tracelog.SetCtxDebug(ctx, utils2.GetFuncName(1), err, "notificationMsg", notificationMsg)
|
tracelog.SetCtxDebug(ctx, utils2.GetFuncName(1), err, "notificationMsg", notificationMsg)
|
||||||
@ -301,4 +301,5 @@ func (c *Check) Notification(ctx context.Context, notificationMsg *NotificationM
|
|||||||
msg.OfflinePushInfo = &offlineInfo
|
msg.OfflinePushInfo = &offlineInfo
|
||||||
req.MsgData = &msg
|
req.MsgData = &msg
|
||||||
_, err = c.Msg.SendMsg(ctx, &req)
|
_, err = c.Msg.SendMsg(ctx, &req)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
type ModifyMsgConsumerHandler struct {
|
type ModifyMsgConsumerHandler struct {
|
||||||
modifyMsgConsumerGroup *kfk.MConsumerGroup
|
modifyMsgConsumerGroup *kfk.MConsumerGroup
|
||||||
|
|
||||||
extendMsgInterface controller.ExtendMsgInterface
|
extendMsgDatabase controller.ExtendMsgDatabase
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mmc *ModifyMsgConsumerHandler) Init() {
|
func (mmc *ModifyMsgConsumerHandler) Init() {
|
||||||
@ -88,7 +88,7 @@ func (mmc *ModifyMsgConsumerHandler) ModifyMsg(cMsg *sarama.ConsumerMessage, msg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := mmc.extendMsgInterface.InsertExtendMsg(ctx, notification.SourceID, notification.SessionType, &extendMsg); err != nil {
|
if err := mmc.extendMsgDatabase.InsertExtendMsg(ctx, notification.SourceID, notification.SessionType, &extendMsg); err != nil {
|
||||||
log.NewError(msgDataToMQ.OperationID, "MsgFirstModify InsertExtendMsg failed", notification.SourceID, notification.SessionType, extendMsg, err.Error())
|
log.NewError(msgDataToMQ.OperationID, "MsgFirstModify InsertExtendMsg failed", notification.SourceID, notification.SessionType, extendMsg, err.Error())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ func (mmc *ModifyMsgConsumerHandler) ModifyMsg(cMsg *sarama.ConsumerMessage, msg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// is already modify
|
// is already modify
|
||||||
if err := mmc.extendMsgInterface.InsertOrUpdateReactionExtendMsgSet(ctx, notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, reactionExtensionList); err != nil {
|
if err := mmc.extendMsgDatabase.InsertOrUpdateReactionExtendMsgSet(ctx, notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, reactionExtensionList); err != nil {
|
||||||
log.NewError(msgDataToMQ.OperationID, "InsertOrUpdateReactionExtendMsgSet failed")
|
log.NewError(msgDataToMQ.OperationID, "InsertOrUpdateReactionExtendMsgSet failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ func (mmc *ModifyMsgConsumerHandler) ModifyMsg(cMsg *sarama.ConsumerMessage, msg
|
|||||||
if err := json.Unmarshal(msgDataToMQ.MsgData.Content, notification); err != nil {
|
if err := json.Unmarshal(msgDataToMQ.MsgData.Content, notification); err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err := mmc.extendMsgInterface.DeleteReactionExtendMsgSet(ctx, notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, notification.SuccessReactionExtensionList); err != nil {
|
if err := mmc.extendMsgDatabase.DeleteReactionExtendMsgSet(ctx, notification.SourceID, notification.SessionType, notification.ClientMsgID, notification.MsgFirstModifyTime, notification.SuccessReactionExtensionList); err != nil {
|
||||||
log.NewError(msgDataToMQ.OperationID, "InsertOrUpdateReactionExtendMsgSet failed")
|
log.NewError(msgDataToMQ.OperationID, "InsertOrUpdateReactionExtendMsgSet failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
type RPCServer struct {
|
type RPCServer struct {
|
||||||
rpcPort int
|
rpcPort int
|
||||||
rpcRegisterName string
|
rpcRegisterName string
|
||||||
pushInterface controller.PushInterface
|
PushDatabase controller.PushDatabase
|
||||||
pusher Pusher
|
pusher Pusher
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,5 +89,5 @@ func (r *RPCServer) PushMsg(ctx context.Context, pbData *pbPush.PushMsgReq) (res
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *RPCServer) DelUserPushToken(ctx context.Context, req *pbPush.DelUserPushTokenReq) (resp *pbPush.DelUserPushTokenResp, err error) {
|
func (r *RPCServer) DelUserPushToken(ctx context.Context, req *pbPush.DelUserPushTokenReq) (resp *pbPush.DelUserPushTokenResp, err error) {
|
||||||
return &pbPush.DelUserPushTokenResp{}, r.pushInterface.DelFcmToken(ctx, req.UserID, int(req.PlatformID))
|
return &pbPush.DelUserPushTokenResp{}, r.PushDatabase.DelFcmToken(ctx, req.UserID, int(req.PlatformID))
|
||||||
}
|
}
|
||||||
|
@ -13,13 +13,19 @@ import (
|
|||||||
"OpenIM/pkg/common/tracelog"
|
"OpenIM/pkg/common/tracelog"
|
||||||
discoveryRegistry "OpenIM/pkg/discoveryregistry"
|
discoveryRegistry "OpenIM/pkg/discoveryregistry"
|
||||||
pbAuth "OpenIM/pkg/proto/auth"
|
pbAuth "OpenIM/pkg/proto/auth"
|
||||||
msggateway "OpenIM/pkg/proto/relay"
|
"OpenIM/pkg/proto/msggateway"
|
||||||
"OpenIM/pkg/utils"
|
"OpenIM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
"github.com/OpenIMSDK/openKeeper"
|
"github.com/OpenIMSDK/openKeeper"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type authServer struct {
|
||||||
|
controller.AuthDatabase
|
||||||
|
userCheck *check.UserCheck
|
||||||
|
RegisterCenter discoveryRegistry.SvcDiscoveryRegistry
|
||||||
|
}
|
||||||
|
|
||||||
func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
||||||
mysql, err := relation.NewGormDB()
|
mysql, err := relation.NewGormDB()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -28,14 +34,14 @@ func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
|||||||
if err := mysql.AutoMigrate(&relationTb.FriendModel{}, &relationTb.FriendRequestModel{}, &relationTb.BlackModel{}); err != nil {
|
if err := mysql.AutoMigrate(&relationTb.FriendModel{}, &relationTb.FriendRequestModel{}, &relationTb.BlackModel{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redis, err := cache.NewRedis()
|
rdb, err := cache.NewRedis()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
pbAuth.RegisterAuthServer(server, &authServer{
|
pbAuth.RegisterAuthServer(server, &authServer{
|
||||||
userCheck: check.NewUserCheck(client),
|
userCheck: check.NewUserCheck(client),
|
||||||
RegisterCenter: client,
|
RegisterCenter: client,
|
||||||
AuthInterface: controller.NewAuthController(redis.GetClient(), config.Config.TokenPolicy.AccessSecret, config.Config.TokenPolicy.AccessExpire),
|
AuthDatabase: controller.NewAuthDatabase(cache.NewCache(rdb), config.Config.TokenPolicy.AccessSecret, config.Config.TokenPolicy.AccessExpire),
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -103,12 +109,12 @@ func (s *authServer) ForceLogout(ctx context.Context, req *pbAuth.ForceLogoutReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *authServer) forceKickOff(ctx context.Context, userID string, platformID int32, operationID string) error {
|
func (s *authServer) forceKickOff(ctx context.Context, userID string, platformID int32, operationID string) error {
|
||||||
grpcCons, err := s.RegisterCenter.GetConns(config.Config.RpcRegisterName.OpenImRelayName)
|
grpcCons, err := s.RegisterCenter.GetConns(config.Config.RpcRegisterName.OpenImMessageGatewayName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, v := range grpcCons {
|
for _, v := range grpcCons {
|
||||||
client := msggateway.NewRelayClient(v)
|
client := msggateway.NewMsgGatewayClient(v)
|
||||||
kickReq := &msggateway.KickUserOfflineReq{OperationID: operationID, KickUserIDList: []string{userID}, PlatformID: platformID}
|
kickReq := &msggateway.KickUserOfflineReq{OperationID: operationID, KickUserIDList: []string{userID}, PlatformID: platformID}
|
||||||
log.NewInfo(operationID, "KickUserOffline ", client, kickReq.String())
|
log.NewInfo(operationID, "KickUserOffline ", client, kickReq.String())
|
||||||
_, err := client.KickUserOffline(ctx, kickReq)
|
_, err := client.KickUserOffline(ctx, kickReq)
|
||||||
@ -116,9 +122,3 @@ func (s *authServer) forceKickOff(ctx context.Context, userID string, platformID
|
|||||||
}
|
}
|
||||||
return constant.ErrInternalServer.Wrap()
|
return constant.ErrInternalServer.Wrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
type authServer struct {
|
|
||||||
controller.AuthInterface
|
|
||||||
userCheck *check.UserCheck
|
|
||||||
RegisterCenter discoveryRegistry.SvcDiscoveryRegistry
|
|
||||||
}
|
|
||||||
|
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
type conversationServer struct {
|
type conversationServer struct {
|
||||||
groupChecker *check.GroupChecker
|
groupChecker *check.GroupChecker
|
||||||
controller.ConversationDataBaseInterface
|
controller.ConversationDatabase
|
||||||
notify *notification.Check
|
notify *notification.Check
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
|||||||
}
|
}
|
||||||
pbConversation.RegisterConversationServer(server, &conversationServer{
|
pbConversation.RegisterConversationServer(server, &conversationServer{
|
||||||
groupChecker: check.NewGroupChecker(client),
|
groupChecker: check.NewGroupChecker(client),
|
||||||
ConversationDataBaseInterface: controller.NewConversationDatabase(relation.NewConversationGorm(db), cache.NewConversationRedis(redis.GetClient(), rockscache.Options{
|
ConversationDatabase: controller.NewConversationDatabase(relation.NewConversationGorm(db), cache.NewConversationRedis(redis.GetClient(), rockscache.Options{
|
||||||
RandomExpireAdjustment: 0.2,
|
RandomExpireAdjustment: 0.2,
|
||||||
DisableCacheRead: false,
|
DisableCacheRead: false,
|
||||||
DisableCacheDelete: false,
|
DisableCacheDelete: false,
|
||||||
@ -49,7 +49,7 @@ func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
|||||||
|
|
||||||
func (c *conversationServer) GetConversation(ctx context.Context, req *pbConversation.GetConversationReq) (*pbConversation.GetConversationResp, error) {
|
func (c *conversationServer) GetConversation(ctx context.Context, req *pbConversation.GetConversationReq) (*pbConversation.GetConversationResp, error) {
|
||||||
resp := &pbConversation.GetConversationResp{Conversation: &pbConversation.Conversation{}}
|
resp := &pbConversation.GetConversationResp{Conversation: &pbConversation.Conversation{}}
|
||||||
conversations, err := c.ConversationDataBaseInterface.FindConversations(ctx, req.OwnerUserID, []string{req.ConversationID})
|
conversations, err := c.ConversationDatabase.FindConversations(ctx, req.OwnerUserID, []string{req.ConversationID})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ func (c *conversationServer) GetConversation(ctx context.Context, req *pbConvers
|
|||||||
|
|
||||||
func (c *conversationServer) GetAllConversations(ctx context.Context, req *pbConversation.GetAllConversationsReq) (*pbConversation.GetAllConversationsResp, error) {
|
func (c *conversationServer) GetAllConversations(ctx context.Context, req *pbConversation.GetAllConversationsReq) (*pbConversation.GetAllConversationsResp, error) {
|
||||||
resp := &pbConversation.GetAllConversationsResp{Conversations: []*pbConversation.Conversation{}}
|
resp := &pbConversation.GetAllConversationsResp{Conversations: []*pbConversation.Conversation{}}
|
||||||
conversations, err := c.ConversationDataBaseInterface.GetUserAllConversation(ctx, req.OwnerUserID)
|
conversations, err := c.ConversationDatabase.GetUserAllConversation(ctx, req.OwnerUserID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ func (c *conversationServer) GetAllConversations(ctx context.Context, req *pbCon
|
|||||||
|
|
||||||
func (c *conversationServer) GetConversations(ctx context.Context, req *pbConversation.GetConversationsReq) (*pbConversation.GetConversationsResp, error) {
|
func (c *conversationServer) GetConversations(ctx context.Context, req *pbConversation.GetConversationsReq) (*pbConversation.GetConversationsResp, error) {
|
||||||
resp := &pbConversation.GetConversationsResp{Conversations: []*pbConversation.Conversation{}}
|
resp := &pbConversation.GetConversationsResp{Conversations: []*pbConversation.Conversation{}}
|
||||||
conversations, err := c.ConversationDataBaseInterface.FindConversations(ctx, req.OwnerUserID, req.ConversationIDs)
|
conversations, err := c.ConversationDatabase.FindConversations(ctx, req.OwnerUserID, req.ConversationIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ func (c *conversationServer) BatchSetConversations(ctx context.Context, req *pbC
|
|||||||
if err := utils.CopyStructFields(&conversations, req.Conversations); err != nil {
|
if err := utils.CopyStructFields(&conversations, req.Conversations); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
err := c.ConversationDataBaseInterface.SetUserConversations(ctx, req.OwnerUserID, conversations)
|
err := c.ConversationDatabase.SetUserConversations(ctx, req.OwnerUserID, conversations)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -126,14 +126,14 @@ func (c *conversationServer) ModifyConversationField(ctx context.Context, req *p
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if req.FieldType == constant.FieldIsPrivateChat {
|
if req.FieldType == constant.FieldIsPrivateChat {
|
||||||
err := c.ConversationDataBaseInterface.SyncPeerUserPrivateConversationTx(ctx, &conversation)
|
err := c.ConversationDatabase.SyncPeerUserPrivateConversationTx(ctx, &conversation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
c.notify.ConversationSetPrivateNotification(ctx, req.Conversation.OwnerUserID, req.Conversation.UserID, req.Conversation.IsPrivateChat)
|
c.notify.ConversationSetPrivateNotification(ctx, req.Conversation.OwnerUserID, req.Conversation.UserID, req.Conversation.IsPrivateChat)
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
//haveUserID, err := c.ConversationDataBaseInterface.GetUserIDExistConversation(ctx, req.UserIDList, req.Conversation.ConversationID)
|
//haveUserID, err := c.ConversationDatabase.GetUserIDExistConversation(ctx, req.UserIDList, req.Conversation.ConversationID)
|
||||||
//if err != nil {
|
//if err != nil {
|
||||||
// return nil, err
|
// return nil, err
|
||||||
//}
|
//}
|
||||||
@ -157,7 +157,7 @@ func (c *conversationServer) ModifyConversationField(ctx context.Context, req *p
|
|||||||
case constant.FieldBurnDuration:
|
case constant.FieldBurnDuration:
|
||||||
filedMap["burn_duration"] = req.Conversation.BurnDuration
|
filedMap["burn_duration"] = req.Conversation.BurnDuration
|
||||||
}
|
}
|
||||||
err = c.ConversationDataBaseInterface.SetUsersConversationFiledTx(ctx, req.UserIDList, &conversation, filedMap)
|
err = c.ConversationDatabase.SetUsersConversationFiledTx(ctx, req.UserIDList, &conversation, filedMap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -177,7 +177,7 @@ func (c *conversationServer) ModifyConversationField(ctx context.Context, req *p
|
|||||||
// 获取超级大群开启免打扰的用户ID
|
// 获取超级大群开启免打扰的用户ID
|
||||||
func (c *conversationServer) GetRecvMsgNotNotifyUserIDs(ctx context.Context, req *pbConversation.GetRecvMsgNotNotifyUserIDsReq) (*pbConversation.GetRecvMsgNotNotifyUserIDsResp, error) {
|
func (c *conversationServer) GetRecvMsgNotNotifyUserIDs(ctx context.Context, req *pbConversation.GetRecvMsgNotNotifyUserIDsReq) (*pbConversation.GetRecvMsgNotNotifyUserIDsResp, error) {
|
||||||
resp := &pbConversation.GetRecvMsgNotNotifyUserIDsResp{}
|
resp := &pbConversation.GetRecvMsgNotNotifyUserIDsResp{}
|
||||||
userIDs, err := c.ConversationDataBaseInterface.FindRecvMsgNotNotifyUserIDs(ctx, req.GroupID)
|
userIDs, err := c.ConversationDatabase.FindRecvMsgNotNotifyUserIDs(ctx, req.GroupID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/OpenIMSDK/openKeeper"
|
"github.com/OpenIMSDK/openKeeper"
|
||||||
|
"github.com/dtm-labs/rockscache"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"math/big"
|
"math/big"
|
||||||
@ -36,11 +37,11 @@ func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
|||||||
if err := db.AutoMigrate(&relationTb.GroupModel{}, &relationTb.GroupMemberModel{}, &relationTb.GroupRequestModel{}); err != nil {
|
if err := db.AutoMigrate(&relationTb.GroupModel{}, &relationTb.GroupMemberModel{}, &relationTb.GroupRequestModel{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
redis, err := cache.NewRedis()
|
mongo, err := unrelation.NewMongo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
mongo, err := unrelation.NewMongo()
|
rdb, err := cache.NewRedis()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -52,7 +53,9 @@ func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
|||||||
tx.NewGorm(db),
|
tx.NewGorm(db),
|
||||||
tx.NewMongo(mongo.GetClient()),
|
tx.NewMongo(mongo.GetClient()),
|
||||||
unrelation.NewSuperGroupMongoDriver(mongo.GetClient()),
|
unrelation.NewSuperGroupMongoDriver(mongo.GetClient()),
|
||||||
redis.GetClient(),
|
cache.NewGroupCacheRedis(rdb, relation.NewGroupDB(db), relation.NewGroupMemberDB(db), relation.NewGroupRequest(db), unrelation.NewSuperGroupMongoDriver(mongo.GetClient()), rockscache.Options{
|
||||||
|
StrongConsistency: true,
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
UserCheck: check.NewUserCheck(client),
|
UserCheck: check.NewUserCheck(client),
|
||||||
ConversationChecker: check.NewConversationChecker(client),
|
ConversationChecker: check.NewConversationChecker(client),
|
||||||
|
@ -30,7 +30,7 @@ func (m *msgServer) sendMsgSuperGroupChat(ctx context.Context, req *msg.SendMsgR
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// callback
|
// callback
|
||||||
if err = CallbackAfterSendGroupMsg(ctx, req); err != nil {
|
if err = CallbackAfterSendGroupMsg(ctx, req); err != nil && err != constant.ErrCallbackContinue {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ func (m *msgServer) sendMsgGroupChat(ctx context.Context, req *msg.SendMsgReq) (
|
|||||||
|
|
||||||
// callback
|
// callback
|
||||||
err = CallbackAfterSendGroupMsg(ctx, req)
|
err = CallbackAfterSendGroupMsg(ctx, req)
|
||||||
if err != nil {
|
if err != nil && err != constant.ErrCallbackContinue {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@ import (
|
|||||||
"OpenIM/pkg/common/db/controller"
|
"OpenIM/pkg/common/db/controller"
|
||||||
"OpenIM/pkg/common/db/localcache"
|
"OpenIM/pkg/common/db/localcache"
|
||||||
"OpenIM/pkg/common/db/relation"
|
"OpenIM/pkg/common/db/relation"
|
||||||
tablerelation "OpenIM/pkg/common/db/table/relation"
|
relationTb "OpenIM/pkg/common/db/table/relation"
|
||||||
discoveryRegistry "OpenIM/pkg/discoveryregistry"
|
discoveryRegistry "OpenIM/pkg/discoveryregistry"
|
||||||
"github.com/OpenIMSDK/openKeeper"
|
"github.com/OpenIMSDK/openKeeper"
|
||||||
|
|
||||||
promePkg "OpenIM/pkg/common/prome"
|
"OpenIM/pkg/common/prome"
|
||||||
"OpenIM/pkg/proto/msg"
|
"OpenIM/pkg/proto/msg"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
@ -26,19 +26,12 @@ type msgServer struct {
|
|||||||
MessageLocker MessageLocker
|
MessageLocker MessageLocker
|
||||||
}
|
}
|
||||||
|
|
||||||
type deleteMsg struct {
|
|
||||||
UserID string
|
|
||||||
OpUserID string
|
|
||||||
SeqList []uint32
|
|
||||||
OperationID string
|
|
||||||
}
|
|
||||||
|
|
||||||
func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
||||||
mysql, err := relation.NewGormDB()
|
mysql, err := relation.NewGormDB()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := mysql.AutoMigrate(&tablerelation.UserModel{}); err != nil {
|
if err := mysql.AutoMigrate(&relationTb.UserModel{}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
s := &msgServer{
|
s := &msgServer{
|
||||||
@ -57,17 +50,17 @@ func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgServer) initPrometheus() {
|
func (m *msgServer) initPrometheus() {
|
||||||
promePkg.NewMsgPullFromRedisSuccessCounter()
|
prome.NewMsgPullFromRedisSuccessCounter()
|
||||||
promePkg.NewMsgPullFromRedisFailedCounter()
|
prome.NewMsgPullFromRedisFailedCounter()
|
||||||
promePkg.NewMsgPullFromMongoSuccessCounter()
|
prome.NewMsgPullFromMongoSuccessCounter()
|
||||||
promePkg.NewMsgPullFromMongoFailedCounter()
|
prome.NewMsgPullFromMongoFailedCounter()
|
||||||
promePkg.NewSingleChatMsgRecvSuccessCounter()
|
prome.NewSingleChatMsgRecvSuccessCounter()
|
||||||
promePkg.NewGroupChatMsgRecvSuccessCounter()
|
prome.NewGroupChatMsgRecvSuccessCounter()
|
||||||
promePkg.NewWorkSuperGroupChatMsgRecvSuccessCounter()
|
prome.NewWorkSuperGroupChatMsgRecvSuccessCounter()
|
||||||
promePkg.NewSingleChatMsgProcessSuccessCounter()
|
prome.NewSingleChatMsgProcessSuccessCounter()
|
||||||
promePkg.NewSingleChatMsgProcessFailedCounter()
|
prome.NewSingleChatMsgProcessFailedCounter()
|
||||||
promePkg.NewGroupChatMsgProcessSuccessCounter()
|
prome.NewGroupChatMsgProcessSuccessCounter()
|
||||||
promePkg.NewGroupChatMsgProcessFailedCounter()
|
prome.NewGroupChatMsgProcessFailedCounter()
|
||||||
promePkg.NewWorkSuperGroupChatMsgProcessSuccessCounter()
|
prome.NewWorkSuperGroupChatMsgProcessSuccessCounter()
|
||||||
promePkg.NewWorkSuperGroupChatMsgProcessFailedCounter()
|
prome.NewWorkSuperGroupChatMsgProcessFailedCounter()
|
||||||
}
|
}
|
||||||
|
1
internal/rpc/third/rtc.go
Normal file
1
internal/rpc/third/rtc.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package third
|
1
internal/rpc/third/s3.go
Normal file
1
internal/rpc/third/s3.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package third
|
73
internal/rpc/third/third.go
Normal file
73
internal/rpc/third/third.go
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
package third
|
||||||
|
|
||||||
|
import (
|
||||||
|
"OpenIM/internal/common/check"
|
||||||
|
"OpenIM/pkg/common/db/cache"
|
||||||
|
"OpenIM/pkg/common/db/controller"
|
||||||
|
"OpenIM/pkg/common/db/relation"
|
||||||
|
"OpenIM/pkg/common/db/tx"
|
||||||
|
"OpenIM/pkg/common/db/unrelation"
|
||||||
|
"OpenIM/pkg/proto/third"
|
||||||
|
"context"
|
||||||
|
"github.com/OpenIMSDK/openKeeper"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Start(client *openKeeper.ZkClient, server *grpc.Server) error {
|
||||||
|
rdb, err := cache.NewRedis()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
third.RegisterThirdServer(server, &thirdServer{
|
||||||
|
thirdDatabase: controller.NewThirdDatabase(cache.NewCache(rdb)),
|
||||||
|
userCheck: check.NewUserCheck(client),
|
||||||
|
})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type thirdServer struct {
|
||||||
|
thirdDatabase controller.ThirdDatabase
|
||||||
|
userCheck *check.UserCheck
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdServer) ApplySpace(ctx context.Context, req *third.ApplySpaceReq) (resp *third.ApplySpaceResp, err error) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdServer) GetSignalInvitationInfo(ctx context.Context, req *third.GetSignalInvitationInfoReq) (resp *third.GetSignalInvitationInfoResp, err error) {
|
||||||
|
signalReq, err := t.thirdDatabase.GetSignalInvitationInfoByClientMsgID(ctx, req.ClientMsgID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
resp = &third.GetSignalInvitationInfoResp{}
|
||||||
|
resp.InvitationInfo = signalReq.Invitation
|
||||||
|
resp.OfflinePushInfo = signalReq.OfflinePushInfo
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdServer) GetSignalInvitationInfoStartApp(ctx context.Context, req *third.GetSignalInvitationInfoStartAppReq) (resp *third.GetSignalInvitationInfoStartAppResp, err error) {
|
||||||
|
signalReq, err := t.thirdDatabase.GetAvailableSignalInvitationInfo(ctx, req.UserID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
resp = &third.GetSignalInvitationInfoStartAppResp{}
|
||||||
|
resp.InvitationInfo = signalReq.Invitation
|
||||||
|
resp.OfflinePushInfo = signalReq.OfflinePushInfo
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdServer) FcmUpdateToken(ctx context.Context, req *third.FcmUpdateTokenReq) (resp *third.FcmUpdateTokenResp, err error) {
|
||||||
|
err = t.thirdDatabase.FcmUpdateToken(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &third.FcmUpdateTokenResp{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdServer) SetAppBadge(ctx context.Context, req *third.SetAppBadgeReq) (resp *third.SetAppBadgeResp, err error) {
|
||||||
|
err = t.thirdDatabase.SetAppBadge(ctx, req.UserID, req.AppUnreadCount)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &third.SetAppBadgeResp{}, nil
|
||||||
|
}
|
@ -16,14 +16,14 @@ import (
|
|||||||
type msgTool struct {
|
type msgTool struct {
|
||||||
msgInterface controller.MsgDatabase
|
msgInterface controller.MsgDatabase
|
||||||
userInterface controller.UserDatabase
|
userInterface controller.UserDatabase
|
||||||
groupInterface controller.GroupDatabase
|
groupDatabase controller.GroupDatabase
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *msgTool) getCronTaskOperationID() string {
|
func (c *msgTool) getCronTaskOperationID() string {
|
||||||
return cronTaskOperationID + utils.OperationIDGenerator()
|
return cronTaskOperationID + utils.OperationIDGenerator()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *msgTool) ClearAll() {
|
func (c *msgTool) ClearMsgAndFixSeq() {
|
||||||
operationID := c.getCronTaskOperationID()
|
operationID := c.getCronTaskOperationID()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
tracelog.SetOperationID(ctx, operationID)
|
tracelog.SetOperationID(ctx, operationID)
|
||||||
@ -36,7 +36,7 @@ func (c *msgTool) ClearAll() {
|
|||||||
log.NewError(operationID, utils.GetSelfFuncName(), err.Error())
|
log.NewError(operationID, utils.GetSelfFuncName(), err.Error())
|
||||||
}
|
}
|
||||||
// working group msg clear
|
// working group msg clear
|
||||||
superGroupIDList, err := c.groupInterface.GetGroupIDsByGroupType(ctx, constant.WorkingGroup)
|
superGroupIDList, err := c.groupDatabase.GetGroupIDsByGroupType(ctx, constant.WorkingGroup)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
c.ClearSuperGroupMsg(ctx, superGroupIDList)
|
c.ClearSuperGroupMsg(ctx, superGroupIDList)
|
||||||
} else {
|
} else {
|
||||||
@ -45,8 +45,8 @@ func (c *msgTool) ClearAll() {
|
|||||||
log.NewInfo(operationID, "============================ start del cron finished ============================")
|
log.NewInfo(operationID, "============================ start del cron finished ============================")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *msgTool) ClearUsersMsg(ctx context.Context, userIDList []string) {
|
func (c *msgTool) ClearUsersMsg(ctx context.Context, userIDs []string) {
|
||||||
for _, userID := range userIDList {
|
for _, userID := range userIDs {
|
||||||
if err := c.msgInterface.DeleteUserMsgsAndSetMinSeq(ctx, userID, int64(config.Config.Mongo.DBRetainChatRecords*24*60*60)); err != nil {
|
if err := c.msgInterface.DeleteUserMsgsAndSetMinSeq(ctx, userID, int64(config.Config.Mongo.DBRetainChatRecords*24*60*60)); err != nil {
|
||||||
log.NewError(tracelog.GetOperationID(ctx), utils.GetSelfFuncName(), err.Error(), userID)
|
log.NewError(tracelog.GetOperationID(ctx), utils.GetSelfFuncName(), err.Error(), userID)
|
||||||
}
|
}
|
||||||
@ -60,9 +60,9 @@ func (c *msgTool) ClearUsersMsg(ctx context.Context, userIDList []string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *msgTool) ClearSuperGroupMsg(ctx context.Context, superGroupIDList []string) {
|
func (c *msgTool) ClearSuperGroupMsg(ctx context.Context, superGroupIDs []string) {
|
||||||
for _, groupID := range superGroupIDList {
|
for _, groupID := range superGroupIDs {
|
||||||
userIDs, err := c.groupInterface.FindGroupMemberUserID(ctx, groupID)
|
userIDs, err := c.groupDatabase.FindGroupMemberUserID(ctx, groupID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(tracelog.GetOperationID(ctx), utils.GetSelfFuncName(), "FindGroupMemberUserID", err.Error(), groupID)
|
log.NewError(tracelog.GetOperationID(ctx), utils.GetSelfFuncName(), "FindGroupMemberUserID", err.Error(), groupID)
|
||||||
continue
|
continue
|
||||||
@ -114,6 +114,14 @@ func (c *msgTool) CheckMaxSeqWithMongo(ctx context.Context, sourceID string, max
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *msgTool) ShowUserSeqs(ctx context.Context, userID string) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *msgTool) ShowSuperGroupSeqs(ctx context.Context, groupID string) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func (c *msgTool) FixAllSeq(ctx context.Context) {
|
func (c *msgTool) FixAllSeq(ctx context.Context) {
|
||||||
userIDs, err := c.userInterface.GetAllUserID(ctx)
|
userIDs, err := c.userInterface.GetAllUserID(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -137,7 +145,7 @@ func (c *msgTool) FixAllSeq(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
fmt.Println("fix users seq success")
|
fmt.Println("fix users seq success")
|
||||||
|
|
||||||
groupIDs, err := c.groupInterface.GetGroupIDsByGroupType(ctx, constant.WorkingGroup)
|
groupIDs, err := c.groupDatabase.GetGroupIDsByGroupType(ctx, constant.WorkingGroup)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err.Error())
|
panic(err.Error())
|
||||||
}
|
}
|
||||||
@ -147,7 +155,7 @@ func (c *msgTool) FixAllSeq(ctx context.Context) {
|
|||||||
fmt.Println("GetGroupMaxSeq failed", groupID)
|
fmt.Println("GetGroupMaxSeq failed", groupID)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
userIDs, err := c.groupInterface.FindGroupMemberUserID(ctx, groupID)
|
userIDs, err := c.groupDatabase.FindGroupMemberUserID(ctx, groupID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("get groupID", groupID, "failed, try again later")
|
fmt.Println("get groupID", groupID, "failed, try again later")
|
||||||
continue
|
continue
|
||||||
|
@ -24,7 +24,7 @@ func StartCronTask() error {
|
|||||||
operationID := clearCronTask.getCronTaskOperationID()
|
operationID := clearCronTask.getCronTaskOperationID()
|
||||||
tracelog.SetOperationID(ctx, operationID)
|
tracelog.SetOperationID(ctx, operationID)
|
||||||
c := cron.New()
|
c := cron.New()
|
||||||
_, err := c.AddFunc(config.Config.Mongo.ChatRecordsClearTime, clearCronTask.ClearAll)
|
_, err := c.AddFunc(config.Config.Mongo.ChatRecordsClearTime, clearCronTask.ClearMsgAndFixSeq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("start cron failed", err.Error(), config.Config.Mongo.ChatRecordsClearTime)
|
fmt.Println("start cron failed", err.Error(), config.Config.Mongo.ChatRecordsClearTime)
|
||||||
return err
|
return err
|
||||||
|
34
pkg/common/db/cache/group.go
vendored
34
pkg/common/db/cache/group.go
vendored
@ -25,33 +25,6 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type GroupCache interface {
|
type GroupCache interface {
|
||||||
GetGroupsInfo(ctx context.Context, groupIDs []string, fn func(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error)) (groups []*relationTb.GroupModel, err error)
|
|
||||||
DelGroupsInfo(ctx context.Context, groupID string) (err error)
|
|
||||||
GetGroupInfo(ctx context.Context, groupID string, fn func(ctx context.Context, groupID string) (group *relationTb.GroupModel, err error)) (group *relationTb.GroupModel, err error)
|
|
||||||
DelGroupInfo(ctx context.Context, groupID string) (err error)
|
|
||||||
|
|
||||||
BatchDelJoinedSuperGroupIDs(ctx context.Context, userIDs []string, fn func(ctx context.Context, userIDs []string) error) (err error)
|
|
||||||
|
|
||||||
GetJoinedSuperGroupIDs(ctx context.Context, userID string, fn func(ctx context.Context, userID string) (joinedSuperGroupIDs []string, err error)) (joinedSuperGroupIDs []string, err error)
|
|
||||||
DelJoinedSuperGroupIDs(ctx context.Context, userID string) (err error)
|
|
||||||
|
|
||||||
GetGroupMembersHash(ctx context.Context, groupID string, fn func(ctx context.Context, groupID string) (hashCodeUint64 uint64, err error)) (hashCodeUint64 uint64, err error)
|
|
||||||
DelGroupMembersHash(ctx context.Context, groupID string) (err error)
|
|
||||||
|
|
||||||
GetGroupMemberIDs(ctx context.Context, groupID string, fn func(ctx context.Context, groupID string) (groupMemberIDs []string, err error)) (groupMemberIDs []string, err error)
|
|
||||||
DelGroupMemberIDs(ctx context.Context, groupID string) error
|
|
||||||
|
|
||||||
GetJoinedGroupIDs(ctx context.Context, userID string, fn func(ctx context.Context, userID string) (joinedGroupIDs []string, err error)) (joinedGroupIDs []string, err error)
|
|
||||||
DelJoinedGroupIDs(ctx context.Context, userID string) (err error)
|
|
||||||
|
|
||||||
GetGroupMemberInfo(ctx context.Context, groupID, userID string, fn func(ctx context.Context, groupID, userID string) (groupMember *relationTb.GroupMemberModel, err error)) (groupMember *relationTb.GroupMemberModel, err error)
|
|
||||||
DelGroupMemberInfo(ctx context.Context, groupID, userID string) (err error)
|
|
||||||
|
|
||||||
GetGroupMemberNum(ctx context.Context, groupID string, fn func(ctx context.Context, groupID string) (num int, err error)) (num int, err error)
|
|
||||||
DelGroupMemberNum(ctx context.Context, groupID string) (err error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type GroupCacheRedisInterface interface {
|
|
||||||
GetGroupsInfo(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error)
|
GetGroupsInfo(ctx context.Context, groupIDs []string) (groups []*relationTb.GroupModel, err error)
|
||||||
GetGroupInfo(ctx context.Context, groupID string) (group *relationTb.GroupModel, err error)
|
GetGroupInfo(ctx context.Context, groupID string) (group *relationTb.GroupModel, err error)
|
||||||
BatchDelJoinedSuperGroupIDs(ctx context.Context, userIDs []string) (err error)
|
BatchDelJoinedSuperGroupIDs(ctx context.Context, userIDs []string) (err error)
|
||||||
@ -76,21 +49,16 @@ type GroupCacheRedis struct {
|
|||||||
groupRequest relationTb.GroupRequestModelInterface
|
groupRequest relationTb.GroupRequestModelInterface
|
||||||
mongoDB unrelation2.SuperGroupModelInterface
|
mongoDB unrelation2.SuperGroupModelInterface
|
||||||
expireTime time.Duration
|
expireTime time.Duration
|
||||||
redisClient *RedisClient
|
|
||||||
rcClient *rockscache.Client
|
rcClient *rockscache.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGroupCacheRedis(rdb redis.UniversalClient, groupDB relationTb.GroupModelInterface, groupMemberDB relationTb.GroupMemberModelInterface, groupRequestDB relationTb.GroupRequestModelInterface, mongoClient unrelation2.SuperGroupModelInterface, opts rockscache.Options) GroupCacheRedisInterface {
|
func NewGroupCacheRedis(rdb redis.UniversalClient, groupDB relationTb.GroupModelInterface, groupMemberDB relationTb.GroupMemberModelInterface, groupRequestDB relationTb.GroupRequestModelInterface, mongoClient unrelation2.SuperGroupModelInterface, opts rockscache.Options) GroupCacheRedisInterface {
|
||||||
return &GroupCacheRedis{rcClient: rockscache.NewClient(rdb, opts), expireTime: groupExpireTime,
|
return &GroupCacheRedis{rcClient: rockscache.NewClient(rdb, opts), expireTime: groupExpireTime,
|
||||||
group: groupDB, groupMember: groupMemberDB, groupRequest: groupRequestDB, redisClient: NewRedisClient(rdb),
|
group: groupDB, groupMember: groupMemberDB, groupRequest: groupRequestDB,
|
||||||
mongoDB: mongoClient,
|
mongoDB: mongoClient,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *GroupCacheRedis) getRedisClient() *RedisClient {
|
|
||||||
return g.redisClient
|
|
||||||
}
|
|
||||||
|
|
||||||
func (g *GroupCacheRedis) getGroupInfoKey(groupID string) string {
|
func (g *GroupCacheRedis) getGroupInfoKey(groupID string) string {
|
||||||
return groupInfoKey + groupID
|
return groupInfoKey + groupID
|
||||||
}
|
}
|
||||||
|
36
pkg/common/db/cache/init_redis.go
vendored
Normal file
36
pkg/common/db/cache/init_redis.go
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package cache
|
||||||
|
|
||||||
|
import (
|
||||||
|
"OpenIM/pkg/common/config"
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"github.com/go-redis/redis/v8"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewRedis() (redis.UniversalClient, error) {
|
||||||
|
var rdb redis.UniversalClient
|
||||||
|
if config.Config.Redis.EnableCluster {
|
||||||
|
rdb = redis.NewClusterClient(&redis.ClusterOptions{
|
||||||
|
Addrs: config.Config.Redis.DBAddress,
|
||||||
|
Username: config.Config.Redis.DBUserName,
|
||||||
|
Password: config.Config.Redis.DBPassWord, // no password set
|
||||||
|
PoolSize: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
rdb = redis.NewClient(&redis.Options{
|
||||||
|
Addr: config.Config.Redis.DBAddress[0],
|
||||||
|
Username: config.Config.Redis.DBUserName,
|
||||||
|
Password: config.Config.Redis.DBPassWord, // no password set
|
||||||
|
DB: 0, // use default DB
|
||||||
|
PoolSize: 100, // 连接池大小
|
||||||
|
})
|
||||||
|
}
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
||||||
|
defer cancel()
|
||||||
|
err := rdb.Ping(ctx).Err()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("redis ping %w", err)
|
||||||
|
}
|
||||||
|
return rdb, nil
|
||||||
|
}
|
223
pkg/common/db/cache/redis.go
vendored
223
pkg/common/db/cache/redis.go
vendored
@ -50,7 +50,6 @@ type Cache interface {
|
|||||||
SetUserMaxSeq(ctx context.Context, userID string, maxSeq int64) error
|
SetUserMaxSeq(ctx context.Context, userID string, maxSeq int64) error
|
||||||
SetUserMinSeq(ctx context.Context, userID string, minSeq int64) (err error)
|
SetUserMinSeq(ctx context.Context, userID string, minSeq int64) (err error)
|
||||||
GetUserMinSeq(ctx context.Context, userID string) (int64, error)
|
GetUserMinSeq(ctx context.Context, userID string) (int64, error)
|
||||||
|
|
||||||
SetGroupUserMinSeq(ctx context.Context, groupID, userID string, minSeq int64) (err error)
|
SetGroupUserMinSeq(ctx context.Context, groupID, userID string, minSeq int64) (err error)
|
||||||
GetGroupUserMinSeq(ctx context.Context, groupID, userID string) (int64, error)
|
GetGroupUserMinSeq(ctx context.Context, groupID, userID string) (int64, error)
|
||||||
GetGroupMaxSeq(ctx context.Context, groupID string) (int64, error)
|
GetGroupMaxSeq(ctx context.Context, groupID string) (int64, error)
|
||||||
@ -58,28 +57,23 @@ type Cache interface {
|
|||||||
IncrGroupMaxSeq(ctx context.Context, groupID string) (int64, error)
|
IncrGroupMaxSeq(ctx context.Context, groupID string) (int64, error)
|
||||||
SetGroupMaxSeq(ctx context.Context, groupID string, maxSeq int64) error
|
SetGroupMaxSeq(ctx context.Context, groupID string, maxSeq int64) error
|
||||||
SetGroupMinSeq(ctx context.Context, groupID string, minSeq int64) error
|
SetGroupMinSeq(ctx context.Context, groupID string, minSeq int64) error
|
||||||
|
|
||||||
AddTokenFlag(ctx context.Context, userID string, platformID int, token string, flag int) error
|
AddTokenFlag(ctx context.Context, userID string, platformID int, token string, flag int) error
|
||||||
|
|
||||||
GetTokensWithoutError(ctx context.Context, userID, platformID string) (map[string]int, error)
|
GetTokensWithoutError(ctx context.Context, userID, platformID string) (map[string]int, error)
|
||||||
|
SetTokenMapByUidPid(ctx context.Context, userID string, platform string, m map[string]int) error
|
||||||
SetTokenMapByUidPid(ctx context.Context, userID string, platformID int, m map[string]int) error
|
DeleteTokenByUidPid(ctx context.Context, userID string, platform string, fields []string) error
|
||||||
DeleteTokenByUidPid(ctx context.Context, userID string, platformID int, fields []string) error
|
|
||||||
GetMessagesBySeq(ctx context.Context, userID string, seqList []int64) (seqMsg []*sdkws.MsgData, failedSeqList []int64, err error)
|
GetMessagesBySeq(ctx context.Context, userID string, seqList []int64) (seqMsg []*sdkws.MsgData, failedSeqList []int64, err error)
|
||||||
SetMessageToCache(ctx context.Context, userID string, msgList []*pbChat.MsgDataToMQ) (int, error)
|
SetMessageToCache(ctx context.Context, userID string, msgList []*pbChat.MsgDataToMQ) (int, error)
|
||||||
DeleteMessageFromCache(ctx context.Context, userID string, msgList []*pbChat.MsgDataToMQ) error
|
DeleteMessageFromCache(ctx context.Context, userID string, msgList []*pbChat.MsgDataToMQ) error
|
||||||
CleanUpOneUserAllMsg(ctx context.Context, userID string) error
|
CleanUpOneUserAllMsg(ctx context.Context, userID string) error
|
||||||
HandleSignalInfo(ctx context.Context, msg *sdkws.MsgData, pushToUserID string) (isSend bool, err error)
|
HandleSignalInfo(ctx context.Context, msg *sdkws.MsgData, pushToUserID string) (isSend bool, err error)
|
||||||
GetSignalInfoFromCacheByClientMsgID(ctx context.Context, clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error)
|
GetSignalInvitationInfoByClientMsgID(ctx context.Context, clientMsgID string) (invitationInfo *sdkws.SignalInviteReq, err error)
|
||||||
GetAvailableSignalInvitationInfo(ctx context.Context, userID string) (invitationInfo *pbRtc.SignalInviteReq, err error)
|
GetAvailableSignalInvitationInfo(ctx context.Context, userID string) (invitationInfo *sdkws.SignalInviteReq, err error)
|
||||||
DelUserSignalList(ctx context.Context, userID string) error
|
DelUserSignalList(ctx context.Context, userID string) error
|
||||||
DelMsgFromCache(ctx context.Context, userID string, seqList []int64) error
|
DelMsgFromCache(ctx context.Context, userID string, seqList []int64) error
|
||||||
|
|
||||||
SetGetuiToken(ctx context.Context, token string, expireTime int64) error
|
SetGetuiToken(ctx context.Context, token string, expireTime int64) error
|
||||||
GetGetuiToken(ctx context.Context) (string, error)
|
GetGetuiToken(ctx context.Context) (string, error)
|
||||||
SetGetuiTaskID(ctx context.Context, taskID string, expireTime int64) error
|
SetGetuiTaskID(ctx context.Context, taskID string, expireTime int64) error
|
||||||
GetGetuiTaskID(ctx context.Context) (string, error)
|
GetGetuiTaskID(ctx context.Context) (string, error)
|
||||||
|
|
||||||
SetSendMsgStatus(ctx context.Context, id string, status int32) error
|
SetSendMsgStatus(ctx context.Context, id string, status int32) error
|
||||||
GetSendMsgStatus(ctx context.Context, id string) (int32, error)
|
GetSendMsgStatus(ctx context.Context, id string) (int32, error)
|
||||||
SetFcmToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) (err error)
|
SetFcmToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) (err error)
|
||||||
@ -98,75 +92,76 @@ type Cache interface {
|
|||||||
UnLockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error
|
UnLockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMsgCache(client redis.UniversalClient) Cache {
|
func NewCache(client redis.UniversalClient) Cache {
|
||||||
return &msgCache{rdb: client}
|
return &cache{rdb: client}
|
||||||
}
|
}
|
||||||
|
|
||||||
type msgCache struct {
|
type cache struct {
|
||||||
rdb redis.UniversalClient
|
rdb redis.UniversalClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) IncrUserSeq(ctx context.Context, userID string) (int64, error) {
|
func (c *cache) IncrUserSeq(ctx context.Context, userID string) (int64, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, userIncrSeq+userID).Int64())
|
return utils.Wrap2(c.rdb.Get(ctx, userIncrSeq+userID).Int64())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetUserMaxSeq(ctx context.Context, userID string) (int64, error) {
|
func (c *cache) GetUserMaxSeq(ctx context.Context, userID string) (int64, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, userIncrSeq+userID).Int64())
|
return utils.Wrap2(c.rdb.Get(ctx, userIncrSeq+userID).Int64())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetUserMaxSeq(ctx context.Context, userID string, maxSeq int64) error {
|
func (c *cache) SetUserMaxSeq(ctx context.Context, userID string, maxSeq int64) error {
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, userIncrSeq+userID, maxSeq, 0).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, userIncrSeq+userID, maxSeq, 0).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetUserMinSeq(ctx context.Context, userID string, minSeq int64) (err error) {
|
func (c *cache) SetUserMinSeq(ctx context.Context, userID string, minSeq int64) (err error) {
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, userMinSeq+userID, minSeq, 0).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, userMinSeq+userID, minSeq, 0).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetUserMinSeq(ctx context.Context, userID string) (int64, error) {
|
func (c *cache) GetUserMinSeq(ctx context.Context, userID string) (int64, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, userMinSeq+userID).Int64())
|
return utils.Wrap2(c.rdb.Get(ctx, userMinSeq+userID).Int64())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetGroupUserMinSeq(ctx context.Context, groupID, userID string, minSeq int64) (err error) {
|
func (c *cache) SetGroupUserMinSeq(ctx context.Context, groupID, userID string, minSeq int64) (err error) {
|
||||||
key := groupUserMinSeq + "g:" + groupID + "u:" + userID
|
key := groupUserMinSeq + "g:" + groupID + "u:" + userID
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, key, minSeq, 0).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, key, minSeq, 0).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetGroupUserMinSeq(ctx context.Context, groupID, userID string) (int64, error) {
|
func (c *cache) GetGroupUserMinSeq(ctx context.Context, groupID, userID string) (int64, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, groupMinSeq+groupID).Int64())
|
key := groupUserMinSeq + "g:" + groupID + "u:" + userID
|
||||||
|
return utils.Wrap2(c.rdb.Get(ctx, key).Int64())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetGroupMaxSeq(ctx context.Context, groupID string) (int64, error) {
|
func (c *cache) GetGroupMaxSeq(ctx context.Context, groupID string) (int64, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, groupMaxSeq+groupID).Int64())
|
return utils.Wrap2(c.rdb.Get(ctx, groupMaxSeq+groupID).Int64())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetGroupMinSeq(ctx context.Context, groupID string) (int64, error) {
|
func (c *cache) GetGroupMinSeq(ctx context.Context, groupID string) (int64, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, groupMinSeq+groupID).Int64())
|
return utils.Wrap2(c.rdb.Get(ctx, groupMinSeq+groupID).Int64())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) IncrGroupMaxSeq(ctx context.Context, groupID string) (int64, error) {
|
func (c *cache) IncrGroupMaxSeq(ctx context.Context, groupID string) (int64, error) {
|
||||||
key := groupMaxSeq + groupID
|
key := groupMaxSeq + groupID
|
||||||
seq, err := m.rdb.Incr(ctx, key).Uint64()
|
seq, err := c.rdb.Incr(ctx, key).Uint64()
|
||||||
return int64(seq), utils.Wrap1(err)
|
return int64(seq), utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetGroupMaxSeq(ctx context.Context, groupID string, maxSeq int64) error {
|
func (c *cache) SetGroupMaxSeq(ctx context.Context, groupID string, maxSeq int64) error {
|
||||||
key := groupMaxSeq + groupID
|
key := groupMaxSeq + groupID
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, key, maxSeq, 0).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, key, maxSeq, 0).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetGroupMinSeq(ctx context.Context, groupID string, minSeq int64) error {
|
func (c *cache) SetGroupMinSeq(ctx context.Context, groupID string, minSeq int64) error {
|
||||||
key := groupMinSeq + groupID
|
key := groupMinSeq + groupID
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, key, minSeq, 0).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, key, minSeq, 0).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) AddTokenFlag(ctx context.Context, userID string, platformID int, token string, flag int) error {
|
func (c *cache) AddTokenFlag(ctx context.Context, userID string, platformID int, token string, flag int) error {
|
||||||
key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID)
|
key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID)
|
||||||
return utils.Wrap1(m.rdb.HSet(ctx, key, token, flag).Err())
|
return utils.Wrap1(c.rdb.HSet(ctx, key, token, flag).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetTokensWithoutError(ctx context.Context, userID, platformID string) (map[string]int, error) {
|
func (c *cache) GetTokensWithoutError(ctx context.Context, userID, platformID string) (map[string]int, error) {
|
||||||
key := uidPidToken + userID + ":" + platformID
|
key := uidPidToken + userID + ":" + platformID
|
||||||
m, err := m.rdb.HGetAll(ctx, key).Result()
|
m, err := c.rdb.HGetAll(ctx, key).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, utils.Wrap1(err)
|
return nil, utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
@ -177,26 +172,26 @@ func (m *msgCache) GetTokensWithoutError(ctx context.Context, userID, platformID
|
|||||||
return mm, nil
|
return mm, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetTokenMapByUidPid(ctx context.Context, userID string, platformID int, m map[string]int) error {
|
func (c *cache) SetTokenMapByUidPid(ctx context.Context, userID string, platform string, m map[string]int) error {
|
||||||
key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID)
|
key := uidPidToken + userID + ":" + platform
|
||||||
mm := make(map[string]interface{})
|
mm := make(map[string]interface{})
|
||||||
for k, v := range m {
|
for k, v := range m {
|
||||||
mm[k] = v
|
mm[k] = v
|
||||||
}
|
}
|
||||||
return utils.Wrap1(m.rdb.HSet(ctx, key, mm).Err())
|
return utils.Wrap1(c.rdb.HSet(ctx, key, mm).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) DeleteTokenByUidPid(ctx context.Context, userID string, platformID int, fields []string) error {
|
func (c *cache) DeleteTokenByUidPid(ctx context.Context, userID string, platform string, fields []string) error {
|
||||||
key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID)
|
key := uidPidToken + userID + ":" + platform
|
||||||
return utils.Wrap1(m.rdb.HDel(ctx, key, fields...).Err())
|
return utils.Wrap1(c.rdb.HDel(ctx, key, fields...).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetMessagesBySeq(ctx context.Context, userID string, seqList []int64) (seqMsg []*sdkws.MsgData, failedSeqList []int64, err error) {
|
func (c *cache) GetMessagesBySeq(ctx context.Context, userID string, seqList []int64) (seqMsg []*sdkws.MsgData, failedSeqList []int64, err error) {
|
||||||
var errResult error
|
var errResult error
|
||||||
for _, v := range seqList {
|
for _, v := range seqList {
|
||||||
//MESSAGE_CACHE:169.254.225.224_reliability1653387820_0_1
|
//MESSAGE_CACHE:169.254.225.224_reliability1653387820_0_1
|
||||||
key := messageCache + userID + "_" + strconv.Itoa(int(v))
|
key := messageCache + userID + "_" + strconv.Itoa(int(v))
|
||||||
result, err := m.rdb.Get(ctx, key).Result()
|
result, err := c.rdb.Get(ctx, key).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errResult = err
|
errResult = err
|
||||||
failedSeqList = append(failedSeqList, v)
|
failedSeqList = append(failedSeqList, v)
|
||||||
@ -215,8 +210,8 @@ func (m *msgCache) GetMessagesBySeq(ctx context.Context, userID string, seqList
|
|||||||
return seqMsg, failedSeqList, errResult
|
return seqMsg, failedSeqList, errResult
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetMessageToCache(ctx context.Context, userID string, msgList []*pbChat.MsgDataToMQ) (int, error) {
|
func (c *cache) SetMessageToCache(ctx context.Context, userID string, msgList []*pbChat.MsgDataToMQ) (int, error) {
|
||||||
pipe := m.rdb.Pipeline()
|
pipe := c.rdb.Pipeline()
|
||||||
var failedList []pbChat.MsgDataToMQ
|
var failedList []pbChat.MsgDataToMQ
|
||||||
for _, msg := range msgList {
|
for _, msg := range msgList {
|
||||||
key := messageCache + userID + "_" + strconv.Itoa(int(msg.MsgData.Seq))
|
key := messageCache + userID + "_" + strconv.Itoa(int(msg.MsgData.Seq))
|
||||||
@ -236,18 +231,18 @@ func (m *msgCache) SetMessageToCache(ctx context.Context, userID string, msgList
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) DeleteMessageFromCache(ctx context.Context, userID string, msgList []*pbChat.MsgDataToMQ) error {
|
func (c *cache) DeleteMessageFromCache(ctx context.Context, userID string, msgList []*pbChat.MsgDataToMQ) error {
|
||||||
for _, msg := range msgList {
|
for _, msg := range msgList {
|
||||||
if err := m.rdb.Del(ctx, messageCache+userID+"_"+strconv.Itoa(int(msg.MsgData.Seq))).Err(); err != nil {
|
if err := c.rdb.Del(ctx, messageCache+userID+"_"+strconv.Itoa(int(msg.MsgData.Seq))).Err(); err != nil {
|
||||||
return utils.Wrap1(err)
|
return utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) CleanUpOneUserAllMsg(ctx context.Context, userID string) error {
|
func (c *cache) CleanUpOneUserAllMsg(ctx context.Context, userID string) error {
|
||||||
key := messageCache + userID + "_" + "*"
|
key := messageCache + userID + "_" + "*"
|
||||||
vals, err := m.rdb.Keys(ctx, key).Result()
|
vals, err := c.rdb.Keys(ctx, key).Result()
|
||||||
if err == redis.Nil {
|
if err == redis.Nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -255,14 +250,14 @@ func (m *msgCache) CleanUpOneUserAllMsg(ctx context.Context, userID string) erro
|
|||||||
return utils.Wrap1(err)
|
return utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
for _, v := range vals {
|
for _, v := range vals {
|
||||||
if err := m.rdb.Del(ctx, v).Err(); err != nil {
|
if err := c.rdb.Del(ctx, v).Err(); err != nil {
|
||||||
return utils.Wrap1(err)
|
return utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) HandleSignalInfo(ctx context.Context, msg *sdkws.MsgData, pushToUserID string) (isSend bool, err error) {
|
func (c *cache) HandleSignalInfo(ctx context.Context, msg *sdkws.MsgData, pushToUserID string) (isSend bool, err error) {
|
||||||
req := &pbRtc.SignalReq{}
|
req := &pbRtc.SignalReq{}
|
||||||
if err := proto.Unmarshal(msg.Content, req); err != nil {
|
if err := proto.Unmarshal(msg.Content, req); err != nil {
|
||||||
return false, utils.Wrap1(err)
|
return false, utils.Wrap1(err)
|
||||||
@ -291,16 +286,16 @@ func (m *msgCache) HandleSignalInfo(ctx context.Context, msg *sdkws.MsgData, pus
|
|||||||
return false, utils.Wrap1(err)
|
return false, utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
keyList := SignalListCache + userID
|
keyList := SignalListCache + userID
|
||||||
err = m.rdb.LPush(ctx, keyList, msg.ClientMsgID).Err()
|
err = c.rdb.LPush(ctx, keyList, msg.ClientMsgID).Err()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, utils.Wrap1(err)
|
return false, utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
err = m.rdb.Expire(ctx, keyList, time.Duration(timeout)*time.Second).Err()
|
err = c.rdb.Expire(ctx, keyList, time.Duration(timeout)*time.Second).Err()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, utils.Wrap1(err)
|
return false, utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
key := SignalCache + msg.ClientMsgID
|
key := SignalCache + msg.ClientMsgID
|
||||||
err = m.rdb.Set(ctx, key, msg.Content, time.Duration(timeout)*time.Second).Err()
|
err = c.rdb.Set(ctx, key, msg.Content, time.Duration(timeout)*time.Second).Err()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, utils.Wrap1(err)
|
return false, utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
@ -309,16 +304,16 @@ func (m *msgCache) HandleSignalInfo(ctx context.Context, msg *sdkws.MsgData, pus
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetSignalInfoFromCacheByClientMsgID(ctx context.Context, clientMsgID string) (invitationInfo *pbRtc.SignalInviteReq, err error) {
|
func (c *cache) GetSignalInvitationInfoByClientMsgID(ctx context.Context, clientMsgID string) (invitationInfo *sdkws.SignalInviteReq, err error) {
|
||||||
bytes, err := m.rdb.Get(ctx, SignalCache+clientMsgID).Bytes()
|
bytes, err := c.rdb.Get(ctx, SignalCache+clientMsgID).Bytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, utils.Wrap1(err)
|
return nil, utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
req := &pbRtc.SignalReq{}
|
req := &sdkws.SignalReq{}
|
||||||
if err = proto.Unmarshal(bytes, req); err != nil {
|
if err = proto.Unmarshal(bytes, req); err != nil {
|
||||||
return nil, utils.Wrap1(err)
|
return nil, utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
invitationInfo = &pbRtc.SignalInviteReq{}
|
invitationInfo = &sdkws.SignalInviteReq{}
|
||||||
switch req2 := req.Payload.(type) {
|
switch req2 := req.Payload.(type) {
|
||||||
case *pbRtc.SignalReq_Invite:
|
case *pbRtc.SignalReq_Invite:
|
||||||
invitationInfo.Invitation = req2.Invite.Invitation
|
invitationInfo.Invitation = req2.Invite.Invitation
|
||||||
@ -330,26 +325,26 @@ func (m *msgCache) GetSignalInfoFromCacheByClientMsgID(ctx context.Context, clie
|
|||||||
return invitationInfo, nil
|
return invitationInfo, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetAvailableSignalInvitationInfo(ctx context.Context, userID string) (invitationInfo *pbRtc.SignalInviteReq, err error) {
|
func (c *cache) GetAvailableSignalInvitationInfo(ctx context.Context, userID string) (invitationInfo *sdkws.SignalInviteReq, err error) {
|
||||||
key, err := m.rdb.LPop(ctx, SignalListCache+userID).Result()
|
key, err := c.rdb.LPop(ctx, SignalListCache+userID).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, utils.Wrap1(err)
|
return nil, utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
invitationInfo, err = m.GetSignalInfoFromCacheByClientMsgID(ctx, key)
|
invitationInfo, err = c.GetSignalInvitationInfoByClientMsgID(ctx, key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return invitationInfo, m.DelUserSignalList(ctx, userID)
|
return invitationInfo, utils.Wrap1(c.DelUserSignalList(ctx, userID))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) DelUserSignalList(ctx context.Context, userID string) error {
|
func (c *cache) DelUserSignalList(ctx context.Context, userID string) error {
|
||||||
return utils.Wrap1(m.rdb.Del(ctx, SignalListCache+userID).Err())
|
return utils.Wrap1(c.rdb.Del(ctx, SignalListCache+userID).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) DelMsgFromCache(ctx context.Context, userID string, seqList []int64) error {
|
func (c *cache) DelMsgFromCache(ctx context.Context, userID string, seqList []int64) error {
|
||||||
for _, seq := range seqList {
|
for _, seq := range seqList {
|
||||||
key := messageCache + userID + "_" + strconv.Itoa(int(seq))
|
key := messageCache + userID + "_" + strconv.Itoa(int(seq))
|
||||||
result, err := m.rdb.Get(ctx, key).Result()
|
result, err := c.rdb.Get(ctx, key).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == redis.Nil {
|
if err == redis.Nil {
|
||||||
continue
|
continue
|
||||||
@ -365,74 +360,74 @@ func (m *msgCache) DelMsgFromCache(ctx context.Context, userID string, seqList [
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return utils.Wrap1(err)
|
return utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
if err := m.rdb.Set(ctx, key, s, time.Duration(config.Config.MsgCacheTimeout)*time.Second).Err(); err != nil {
|
if err := c.rdb.Set(ctx, key, s, time.Duration(config.Config.MsgCacheTimeout)*time.Second).Err(); err != nil {
|
||||||
return utils.Wrap1(err)
|
return utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetGetuiToken(ctx context.Context, token string, expireTime int64) error {
|
func (c *cache) SetGetuiToken(ctx context.Context, token string, expireTime int64) error {
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, getuiToken, token, time.Duration(expireTime)*time.Second).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, getuiToken, token, time.Duration(expireTime)*time.Second).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetGetuiToken(ctx context.Context) (string, error) {
|
func (c *cache) GetGetuiToken(ctx context.Context) (string, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, getuiToken).Result())
|
return utils.Wrap2(c.rdb.Get(ctx, getuiToken).Result())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetGetuiTaskID(ctx context.Context, taskID string, expireTime int64) error {
|
func (c *cache) SetGetuiTaskID(ctx context.Context, taskID string, expireTime int64) error {
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, getuiTaskID, taskID, time.Duration(expireTime)*time.Second).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, getuiTaskID, taskID, time.Duration(expireTime)*time.Second).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetGetuiTaskID(ctx context.Context) (string, error) {
|
func (c *cache) GetGetuiTaskID(ctx context.Context) (string, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, getuiTaskID).Result())
|
return utils.Wrap2(c.rdb.Get(ctx, getuiTaskID).Result())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetSendMsgStatus(ctx context.Context, id string, status int32) error {
|
func (c *cache) SetSendMsgStatus(ctx context.Context, id string, status int32) error {
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, sendMsgFailedFlag+id, status, time.Hour*24).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, sendMsgFailedFlag+id, status, time.Hour*24).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetSendMsgStatus(ctx context.Context, id string) (int32, error) {
|
func (c *cache) GetSendMsgStatus(ctx context.Context, id string) (int32, error) {
|
||||||
result, err := m.rdb.Get(ctx, sendMsgFailedFlag+id).Int()
|
result, err := c.rdb.Get(ctx, sendMsgFailedFlag+id).Int()
|
||||||
return int32(result), utils.Wrap1(err)
|
return int32(result), utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetFcmToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) (err error) {
|
func (c *cache) SetFcmToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) (err error) {
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, FcmToken+account+":"+strconv.Itoa(platformID), fcmToken, time.Duration(expireTime)*time.Second).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, FcmToken+account+":"+strconv.Itoa(platformID), fcmToken, time.Duration(expireTime)*time.Second).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetFcmToken(ctx context.Context, account string, platformID int) (string, error) {
|
func (c *cache) GetFcmToken(ctx context.Context, account string, platformID int) (string, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, FcmToken+account+":"+strconv.Itoa(platformID)).Result())
|
return utils.Wrap2(c.rdb.Get(ctx, FcmToken+account+":"+strconv.Itoa(platformID)).Result())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) DelFcmToken(ctx context.Context, account string, platformID int) error {
|
func (c *cache) DelFcmToken(ctx context.Context, account string, platformID int) error {
|
||||||
return utils.Wrap1(m.rdb.Del(ctx, FcmToken+account+":"+strconv.Itoa(platformID)).Err())
|
return utils.Wrap1(c.rdb.Del(ctx, FcmToken+account+":"+strconv.Itoa(platformID)).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) IncrUserBadgeUnreadCountSum(ctx context.Context, userID string) (int, error) {
|
func (c *cache) IncrUserBadgeUnreadCountSum(ctx context.Context, userID string) (int, error) {
|
||||||
seq, err := m.rdb.Incr(ctx, userBadgeUnreadCountSum+userID).Result()
|
seq, err := c.rdb.Incr(ctx, userBadgeUnreadCountSum+userID).Result()
|
||||||
return int(seq), utils.Wrap1(err)
|
return int(seq), utils.Wrap1(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetUserBadgeUnreadCountSum(ctx context.Context, userID string, value int) error {
|
func (c *cache) SetUserBadgeUnreadCountSum(ctx context.Context, userID string, value int) error {
|
||||||
return utils.Wrap1(m.rdb.Set(ctx, userBadgeUnreadCountSum+userID, value, 0).Err())
|
return utils.Wrap1(c.rdb.Set(ctx, userBadgeUnreadCountSum+userID, value, 0).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetUserBadgeUnreadCountSum(ctx context.Context, userID string) (int, error) {
|
func (c *cache) GetUserBadgeUnreadCountSum(ctx context.Context, userID string) (int, error) {
|
||||||
return utils.Wrap2(m.rdb.Get(ctx, userBadgeUnreadCountSum+userID).Int())
|
return utils.Wrap2(c.rdb.Get(ctx, userBadgeUnreadCountSum+userID).Int())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) LockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error {
|
func (c *cache) LockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error {
|
||||||
key := exTypeKeyLocker + clientMsgID + "_" + TypeKey
|
key := exTypeKeyLocker + clientMsgID + "_" + TypeKey
|
||||||
return utils.Wrap1(m.rdb.SetNX(ctx, key, 1, time.Minute).Err())
|
return utils.Wrap1(c.rdb.SetNX(ctx, key, 1, time.Minute).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) UnLockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error {
|
func (c *cache) UnLockMessageTypeKey(ctx context.Context, clientMsgID string, TypeKey string) error {
|
||||||
key := exTypeKeyLocker + clientMsgID + "_" + TypeKey
|
key := exTypeKeyLocker + clientMsgID + "_" + TypeKey
|
||||||
return utils.Wrap1(m.rdb.Del(ctx, key).Err())
|
return utils.Wrap1(c.rdb.Del(ctx, key).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) getMessageReactionExPrefix(clientMsgID string, sessionType int32) string {
|
func (c *cache) getMessageReactionExPrefix(clientMsgID string, sessionType int32) string {
|
||||||
switch sessionType {
|
switch sessionType {
|
||||||
case constant.SingleChatType:
|
case constant.SingleChatType:
|
||||||
return "EX_SINGLE_" + clientMsgID
|
return "EX_SINGLE_" + clientMsgID
|
||||||
@ -446,30 +441,30 @@ func (m *msgCache) getMessageReactionExPrefix(clientMsgID string, sessionType in
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) JudgeMessageReactionEXISTS(ctx context.Context, clientMsgID string, sessionType int32) (bool, error) {
|
func (c *cache) JudgeMessageReactionEXISTS(ctx context.Context, clientMsgID string, sessionType int32) (bool, error) {
|
||||||
n, err := m.rdb.Exists(ctx, m.getMessageReactionExPrefix(clientMsgID, sessionType)).Result()
|
n, err := c.rdb.Exists(ctx, c.getMessageReactionExPrefix(clientMsgID, sessionType)).Result()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, utils.Wrap(err, "")
|
return false, utils.Wrap(err, "")
|
||||||
}
|
}
|
||||||
return n > 0, nil
|
return n > 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error {
|
func (c *cache) SetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey, value string) error {
|
||||||
return utils.Wrap1(m.rdb.HSet(ctx, m.getMessageReactionExPrefix(clientMsgID, sessionType), typeKey, value).Err())
|
return utils.Wrap1(c.rdb.HSet(ctx, c.getMessageReactionExPrefix(clientMsgID, sessionType), typeKey, value).Err())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) SetMessageReactionExpire(ctx context.Context, clientMsgID string, sessionType int32, expiration time.Duration) (bool, error) {
|
func (c *cache) SetMessageReactionExpire(ctx context.Context, clientMsgID string, sessionType int32, expiration time.Duration) (bool, error) {
|
||||||
return utils.Wrap2(m.rdb.Expire(ctx, m.getMessageReactionExPrefix(clientMsgID, sessionType), expiration).Result())
|
return utils.Wrap2(c.rdb.Expire(ctx, c.getMessageReactionExPrefix(clientMsgID, sessionType), expiration).Result())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey string) (string, error) {
|
func (c *cache) GetMessageTypeKeyValue(ctx context.Context, clientMsgID string, sessionType int32, typeKey string) (string, error) {
|
||||||
return utils.Wrap2(m.rdb.HGet(ctx, m.getMessageReactionExPrefix(clientMsgID, sessionType), typeKey).Result())
|
return utils.Wrap2(c.rdb.HGet(ctx, c.getMessageReactionExPrefix(clientMsgID, sessionType), typeKey).Result())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) GetOneMessageAllReactionList(ctx context.Context, clientMsgID string, sessionType int32) (map[string]string, error) {
|
func (c *cache) GetOneMessageAllReactionList(ctx context.Context, clientMsgID string, sessionType int32) (map[string]string, error) {
|
||||||
return utils.Wrap2(m.rdb.HGetAll(ctx, m.getMessageReactionExPrefix(clientMsgID, sessionType)).Result())
|
return utils.Wrap2(c.rdb.HGetAll(ctx, c.getMessageReactionExPrefix(clientMsgID, sessionType)).Result())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgCache) DeleteOneMessageKey(ctx context.Context, clientMsgID string, sessionType int32, subKey string) error {
|
func (c *cache) DeleteOneMessageKey(ctx context.Context, clientMsgID string, sessionType int32, subKey string) error {
|
||||||
return utils.Wrap1(m.rdb.HDel(ctx, m.getMessageReactionExPrefix(clientMsgID, sessionType), subKey).Err())
|
return utils.Wrap1(c.rdb.HDel(ctx, c.getMessageReactionExPrefix(clientMsgID, sessionType), subKey).Err())
|
||||||
}
|
}
|
||||||
|
59
pkg/common/db/cache/token.go
vendored
59
pkg/common/db/cache/token.go
vendored
@ -1,59 +0,0 @@
|
|||||||
package cache
|
|
||||||
|
|
||||||
import (
|
|
||||||
"OpenIM/pkg/common/constant"
|
|
||||||
"OpenIM/pkg/common/tokenverify"
|
|
||||||
"OpenIM/pkg/utils"
|
|
||||||
"context"
|
|
||||||
"github.com/golang-jwt/jwt/v4"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Token interface {
|
|
||||||
//结果为空 不返回错误
|
|
||||||
GetTokensWithoutError(ctx context.Context, userID, platform string) (map[string]int, error)
|
|
||||||
//创建token
|
|
||||||
CreateToken(ctx context.Context, userID string, platformID int) (string, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type TokenRedis struct {
|
|
||||||
redisClient *RedisClient
|
|
||||||
accessSecret string
|
|
||||||
accessExpire int64
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewTokenRedis(redisClient *RedisClient, accessSecret string, accessExpire int64) *TokenRedis {
|
|
||||||
return &TokenRedis{redisClient, accessSecret, accessExpire}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 结果为空 不返回错误
|
|
||||||
func (t *TokenRedis) GetTokensWithoutError(ctx context.Context, userID, platform string) (map[string]int, error) {
|
|
||||||
return t.redisClient.GetTokensWithoutError(ctx, userID, platform)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建token
|
|
||||||
func (t *TokenRedis) CreateToken(ctx context.Context, userID string, platform string) (string, error) {
|
|
||||||
tokens, err := t.redisClient.GetTokensWithoutError(ctx, userID, platform)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
var deleteTokenKey []string
|
|
||||||
for k, v := range tokens {
|
|
||||||
_, err = tokenverify.GetClaimFromToken(k)
|
|
||||||
if err != nil || v != constant.NormalToken {
|
|
||||||
deleteTokenKey = append(deleteTokenKey, k)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(deleteTokenKey) != 0 {
|
|
||||||
err := t.redisClient.DeleteTokenByUidPid(ctx, userID, platform, deleteTokenKey)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
claims := tokenverify.BuildClaims(userID, platform, t.accessExpire)
|
|
||||||
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
|
||||||
tokenString, err := token.SignedString([]byte(t.accessSecret))
|
|
||||||
if err != nil {
|
|
||||||
return "", utils.Wrap(err, "")
|
|
||||||
}
|
|
||||||
return tokenString, t.redisClient.AddTokenFlag(ctx, userID, constant.PlatformNameToID(platform), tokenString, constant.NormalToken)
|
|
||||||
}
|
|
3
pkg/common/db/cache/user.go
vendored
3
pkg/common/db/cache/user.go
vendored
@ -26,7 +26,7 @@ type UserCacheRedis struct {
|
|||||||
userDB *relation.UserGorm
|
userDB *relation.UserGorm
|
||||||
|
|
||||||
expireTime time.Duration
|
expireTime time.Duration
|
||||||
redisClient *RedisClient
|
|
||||||
rcClient *rockscache.Client
|
rcClient *rockscache.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,6 @@ func NewUserCacheRedis(rdb redis.UniversalClient, userDB *relation.UserGorm, opt
|
|||||||
return &UserCacheRedis{
|
return &UserCacheRedis{
|
||||||
userDB: userDB,
|
userDB: userDB,
|
||||||
expireTime: userExpireTime,
|
expireTime: userExpireTime,
|
||||||
redisClient: NewRedisClient(rdb),
|
|
||||||
rcClient: rockscache.NewClient(rdb, options),
|
rcClient: rockscache.NewClient(rdb, options),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,32 +1,61 @@
|
|||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"OpenIM/pkg/common/constant"
|
||||||
"OpenIM/pkg/common/db/cache"
|
"OpenIM/pkg/common/db/cache"
|
||||||
|
"OpenIM/pkg/common/tokenverify"
|
||||||
|
"OpenIM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AuthInterface interface {
|
type AuthDatabase interface {
|
||||||
//结果为空 不返回错误
|
//结果为空 不返回错误
|
||||||
GetTokensWithoutError(ctx context.Context, userID, platform string) (map[string]int, error)
|
GetTokensWithoutError(ctx context.Context, userID, platform string) (map[string]int, error)
|
||||||
//创建token
|
//创建token
|
||||||
CreateToken(ctx context.Context, userID string, platform string) (string, error)
|
CreateToken(ctx context.Context, userID string, platform string) (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthController struct {
|
type authDatabase struct {
|
||||||
database *cache.TokenRedis
|
cache cache.Cache
|
||||||
|
|
||||||
|
accessSecret string
|
||||||
|
accessExpire int64
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewAuthController(rdb redis.UniversalClient, accessSecret string, accessExpire int64) *AuthController {
|
func NewAuthDatabase(cache cache.Cache, accessSecret string, accessExpire int64) AuthDatabase {
|
||||||
return &AuthController{database: cache.NewTokenRedis(cache.NewRedisClient(rdb), accessSecret, accessExpire)}
|
return &authDatabase{cache: cache, accessSecret: accessSecret, accessExpire: accessExpire}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 结果为空 不返回错误
|
// 结果为空 不返回错误
|
||||||
func (a *AuthController) GetTokensWithoutError(ctx context.Context, userID, platform string) (map[string]int, error) {
|
func (a *authDatabase) GetTokensWithoutError(ctx context.Context, userID, platform string) (map[string]int, error) {
|
||||||
return a.database.GetTokensWithoutError(ctx, userID, platform)
|
return a.cache.GetTokensWithoutError(ctx, userID, platform)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建token
|
// 创建token
|
||||||
func (a *AuthController) CreateToken(ctx context.Context, userID string, platform string) (string, error) {
|
func (a *authDatabase) CreateToken(ctx context.Context, userID string, platform string) (string, error) {
|
||||||
return a.database.CreateToken(ctx, userID, platform)
|
tokens, err := a.cache.GetTokensWithoutError(ctx, userID, platform)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
var deleteTokenKey []string
|
||||||
|
for k, v := range tokens {
|
||||||
|
_, err = tokenverify.GetClaimFromToken(k)
|
||||||
|
if err != nil || v != constant.NormalToken {
|
||||||
|
deleteTokenKey = append(deleteTokenKey, k)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(deleteTokenKey) != 0 {
|
||||||
|
err := a.cache.DeleteTokenByUidPid(ctx, userID, platform, deleteTokenKey)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
claims := tokenverify.BuildClaims(userID, platform, a.accessExpire)
|
||||||
|
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
|
||||||
|
tokenString, err := token.SignedString([]byte(a.accessSecret))
|
||||||
|
if err != nil {
|
||||||
|
return "", utils.Wrap(err, "")
|
||||||
|
}
|
||||||
|
return tokenString, a.cache.AddTokenFlag(ctx, userID, constant.PlatformNameToID(platform), tokenString, constant.NormalToken)
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConversationDataBaseInterface interface {
|
type ConversationDatabase interface {
|
||||||
//GetUserIDExistConversation 获取拥有该会话的的用户ID列表
|
//GetUserIDExistConversation 获取拥有该会话的的用户ID列表
|
||||||
GetUserIDExistConversation(ctx context.Context, userIDList []string, conversationID string) ([]string, error)
|
GetUserIDExistConversation(ctx context.Context, userIDList []string, conversationID string) ([]string, error)
|
||||||
//UpdateUserConversationFiled 更新用户该会话的属性信息
|
//UpdateUserConversationFiled 更新用户该会话的属性信息
|
||||||
@ -32,7 +32,7 @@ type ConversationDataBaseInterface interface {
|
|||||||
SetUsersConversationFiledTx(ctx context.Context, userIDList []string, conversation *relationTb.ConversationModel, filedMap map[string]interface{}) error
|
SetUsersConversationFiledTx(ctx context.Context, userIDList []string, conversation *relationTb.ConversationModel, filedMap map[string]interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewConversationDatabase(conversation relation.Conversation, cache cache.ConversationCache, tx tx.Tx) ConversationDataBaseInterface {
|
func NewConversationDatabase(conversation relation.Conversation, cache cache.ConversationCache, tx tx.Tx) ConversationDatabase {
|
||||||
return &ConversationDataBase{
|
return &ConversationDataBase{
|
||||||
conversationDB: conversation,
|
conversationDB: conversation,
|
||||||
cache: cache,
|
cache: cache,
|
||||||
|
@ -4,11 +4,9 @@ import (
|
|||||||
unRelationTb "OpenIM/pkg/common/db/table/unrelation"
|
unRelationTb "OpenIM/pkg/common/db/table/unrelation"
|
||||||
"OpenIM/pkg/proto/sdkws"
|
"OpenIM/pkg/proto/sdkws"
|
||||||
"context"
|
"context"
|
||||||
"github.com/go-redis/redis/v8"
|
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExtendMsgInterface interface {
|
type ExtendMsgDatabase interface {
|
||||||
CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error
|
CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error
|
||||||
GetAllExtendMsgSet(ctx context.Context, ID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error)
|
GetAllExtendMsgSet(ctx context.Context, ID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error)
|
||||||
GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error)
|
GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error)
|
||||||
@ -18,82 +16,37 @@ type ExtendMsgInterface interface {
|
|||||||
GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error)
|
GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExtendMsgController struct {
|
type extendMsgDatabase struct {
|
||||||
database ExtendMsgDatabase
|
db unRelationTb.ExtendMsgSetModelInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewExtendMsgController(mgo *mongo.Client, rdb redis.UniversalClient) *ExtendMsgController {
|
func NewExtendMsgDatabase() ExtendMsgDatabase {
|
||||||
return &ExtendMsgController{}
|
return &extendMsgDatabase{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ExtendMsgController) CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error {
|
func (e *extendMsgDatabase) CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error {
|
||||||
return e.database.CreateExtendMsgSet(ctx, set)
|
return e.db.CreateExtendMsgSet(ctx, set)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ExtendMsgController) GetAllExtendMsgSet(ctx context.Context, ID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error) {
|
func (e *extendMsgDatabase) GetAllExtendMsgSet(ctx context.Context, sourceID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error) {
|
||||||
return e.GetAllExtendMsgSet(ctx, ID, opts)
|
return e.db.GetAllExtendMsgSet(ctx, sourceID, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ExtendMsgController) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error) {
|
func (e *extendMsgDatabase) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error) {
|
||||||
return e.GetExtendMsgSet(ctx, sourceID, sessionType, maxMsgUpdateTime)
|
return e.db.GetExtendMsgSet(ctx, sourceID, sessionType, maxMsgUpdateTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ExtendMsgController) InsertExtendMsg(ctx context.Context, sourceID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error {
|
func (e *extendMsgDatabase) InsertExtendMsg(ctx context.Context, sourceID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error {
|
||||||
return e.InsertExtendMsg(ctx, sourceID, sessionType, msg)
|
return e.db.InsertExtendMsg(ctx, sourceID, sessionType, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ExtendMsgController) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error {
|
func (e *extendMsgDatabase) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error {
|
||||||
return e.InsertOrUpdateReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList)
|
return e.db.InsertOrUpdateReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList)
|
||||||
}
|
}
|
||||||
func (e *ExtendMsgController) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error {
|
func (e *extendMsgDatabase) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error {
|
||||||
return e.DeleteReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList)
|
return e.db.DeleteReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ExtendMsgController) GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error) {
|
func (e *extendMsgDatabase) GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error) {
|
||||||
return e.GetExtendMsg(ctx, sourceID, sessionType, clientMsgID, maxMsgUpdateTime)
|
return e.db.TakeExtendMsg(ctx, sourceID, sessionType, clientMsgID, maxMsgUpdateTime)
|
||||||
}
|
|
||||||
|
|
||||||
type ExtendMsgDatabaseInterface interface {
|
|
||||||
CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error
|
|
||||||
GetAllExtendMsgSet(ctx context.Context, ID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error)
|
|
||||||
GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error)
|
|
||||||
InsertExtendMsg(ctx context.Context, sourceID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error
|
|
||||||
InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error
|
|
||||||
DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error
|
|
||||||
GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type ExtendMsgDatabase struct {
|
|
||||||
model unRelationTb.ExtendMsgSetModelInterface
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewExtendMsgDatabase() ExtendMsgDatabaseInterface {
|
|
||||||
return &ExtendMsgDatabase{}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *ExtendMsgDatabase) CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error {
|
|
||||||
return e.model.CreateExtendMsgSet(ctx, set)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *ExtendMsgDatabase) GetAllExtendMsgSet(ctx context.Context, sourceID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error) {
|
|
||||||
return e.model.GetAllExtendMsgSet(ctx, sourceID, opts)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *ExtendMsgDatabase) GetExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, maxMsgUpdateTime int64) (*unRelationTb.ExtendMsgSetModel, error) {
|
|
||||||
return e.model.GetExtendMsgSet(ctx, sourceID, sessionType, maxMsgUpdateTime)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *ExtendMsgDatabase) InsertExtendMsg(ctx context.Context, sourceID string, sessionType int32, msg *unRelationTb.ExtendMsgModel) error {
|
|
||||||
return e.model.InsertExtendMsg(ctx, sourceID, sessionType, msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *ExtendMsgDatabase) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error {
|
|
||||||
return e.model.InsertOrUpdateReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList)
|
|
||||||
}
|
|
||||||
func (e *ExtendMsgDatabase) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error {
|
|
||||||
return e.model.DeleteReactionExtendMsgSet(ctx, sourceID, sessionType, clientMsgID, msgFirstModifyTime, reactionExtensionList)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *ExtendMsgDatabase) GetExtendMsg(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, maxMsgUpdateTime int64) (extendMsg *unRelationTb.ExtendMsgModel, err error) {
|
|
||||||
return e.model.TakeExtendMsg(ctx, sourceID, sessionType, clientMsgID, maxMsgUpdateTime)
|
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,7 @@ import (
|
|||||||
"OpenIM/pkg/utils"
|
"OpenIM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/dtm-labs/rockscache"
|
|
||||||
_ "github.com/dtm-labs/rockscache"
|
_ "github.com/dtm-labs/rockscache"
|
||||||
"github.com/go-redis/redis/v8"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type GroupDatabase interface {
|
type GroupDatabase interface {
|
||||||
@ -56,8 +54,8 @@ func NewGroupDatabase(
|
|||||||
request relationTb.GroupRequestModelInterface,
|
request relationTb.GroupRequestModelInterface,
|
||||||
tx tx.Tx,
|
tx tx.Tx,
|
||||||
ctxTx tx.CtxTx,
|
ctxTx tx.CtxTx,
|
||||||
super unRelationTb.SuperGroupModelInterface,
|
superGroup unRelationTb.SuperGroupModelInterface,
|
||||||
client redis.UniversalClient,
|
cache cache.GroupCache,
|
||||||
) GroupDatabase {
|
) GroupDatabase {
|
||||||
database := &groupDatabase{
|
database := &groupDatabase{
|
||||||
groupDB: group,
|
groupDB: group,
|
||||||
@ -65,13 +63,8 @@ func NewGroupDatabase(
|
|||||||
groupRequestDB: request,
|
groupRequestDB: request,
|
||||||
tx: tx,
|
tx: tx,
|
||||||
ctxTx: ctxTx,
|
ctxTx: ctxTx,
|
||||||
cache: cache.NewGroupCacheRedis(client, group, member, request, super, rockscache.Options{
|
cache: cache,
|
||||||
RandomExpireAdjustment: 0.2,
|
mongoDB: superGroup,
|
||||||
DisableCacheRead: false,
|
|
||||||
DisableCacheDelete: false,
|
|
||||||
StrongConsistency: true,
|
|
||||||
}),
|
|
||||||
mongoDB: super,
|
|
||||||
}
|
}
|
||||||
return database
|
return database
|
||||||
}
|
}
|
||||||
@ -82,7 +75,7 @@ type groupDatabase struct {
|
|||||||
groupRequestDB relationTb.GroupRequestModelInterface
|
groupRequestDB relationTb.GroupRequestModelInterface
|
||||||
tx tx.Tx
|
tx tx.Tx
|
||||||
ctxTx tx.CtxTx
|
ctxTx tx.CtxTx
|
||||||
cache cache.GroupCacheRedisInterface
|
cache cache.GroupCache
|
||||||
mongoDB unRelationTb.SuperGroupModelInterface
|
mongoDB unRelationTb.SuperGroupModelInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -553,7 +553,7 @@ func (db *msgDatabase) DeleteUserMsgsAndSetMinSeq(ctx context.Context, userID st
|
|||||||
// this is struct for recursion
|
// this is struct for recursion
|
||||||
type delMsgRecursionStruct struct {
|
type delMsgRecursionStruct struct {
|
||||||
minSeq int64
|
minSeq int64
|
||||||
delDocIDList []string
|
delDocIDs []string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *delMsgRecursionStruct) getSetMinSeq() int64 {
|
func (d *delMsgRecursionStruct) getSetMinSeq() int64 {
|
||||||
@ -576,7 +576,7 @@ func (db *msgDatabase) deleteMsgRecursion(ctx context.Context, sourceID string,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取报错,或者获取不到了,物理删除并且返回seq delMongoMsgsPhysical(delStruct.delDocIDList)
|
// 获取报错,或者获取不到了,物理删除并且返回seq delMongoMsgsPhysical(delStruct.delDocIDList)
|
||||||
err = db.mgo.Delete(ctx, delStruct.delDocIDList)
|
err = db.mgo.Delete(ctx, delStruct.delDocIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@ -587,7 +587,7 @@ func (db *msgDatabase) deleteMsgRecursion(ctx context.Context, sourceID string,
|
|||||||
log.NewWarn(tracelog.GetOperationID(ctx), utils.GetSelfFuncName(), "msgs too large:", len(msgs.Msg), "docID:", msgs.DocID)
|
log.NewWarn(tracelog.GetOperationID(ctx), utils.GetSelfFuncName(), "msgs too large:", len(msgs.Msg), "docID:", msgs.DocID)
|
||||||
}
|
}
|
||||||
if msgs.Msg[len(msgs.Msg)-1].SendTime+(remainTime*1000) < utils.GetCurrentTimestampByMill() && msgs.IsFull() {
|
if msgs.Msg[len(msgs.Msg)-1].SendTime+(remainTime*1000) < utils.GetCurrentTimestampByMill() && msgs.IsFull() {
|
||||||
delStruct.delDocIDList = append(delStruct.delDocIDList, msgs.DocID)
|
delStruct.delDocIDs = append(delStruct.delDocIDs, msgs.DocID)
|
||||||
lastMsgPb := &sdkws.MsgData{}
|
lastMsgPb := &sdkws.MsgData{}
|
||||||
err = proto.Unmarshal(msgs.Msg[len(msgs.Msg)-1].Msg, lastMsgPb)
|
err = proto.Unmarshal(msgs.Msg[len(msgs.Msg)-1].Msg, lastMsgPb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -611,7 +611,7 @@ func (db *msgDatabase) deleteMsgRecursion(ctx context.Context, sourceID string,
|
|||||||
msg.SendTime = 0
|
msg.SendTime = 0
|
||||||
hasMarkDelFlag = true
|
hasMarkDelFlag = true
|
||||||
} else {
|
} else {
|
||||||
if err := db.mgo.Delete(ctx, delStruct.delDocIDList); err != nil {
|
if err := db.mgo.Delete(ctx, delStruct.delDocIDs); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
if hasMarkDelFlag {
|
if hasMarkDelFlag {
|
||||||
|
@ -5,14 +5,18 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PushInterface interface {
|
type PushDatabase interface {
|
||||||
DelFcmToken(ctx context.Context, userID string, platformID int) error
|
DelFcmToken(ctx context.Context, userID string, platformID int) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type PushDataBase struct {
|
type pushDataBase struct {
|
||||||
cache cache.Cache
|
cache cache.Cache
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PushDataBase) DelFcmToken(ctx context.Context, userID string, platformID int) error {
|
func NewPushDatabase(cache cache.Cache) PushDatabase {
|
||||||
|
return &pushDataBase{cache: cache}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *pushDataBase) DelFcmToken(ctx context.Context, userID string, platformID int) error {
|
||||||
return p.cache.DelFcmToken(ctx, userID, platformID)
|
return p.cache.DelFcmToken(ctx, userID, platformID)
|
||||||
}
|
}
|
||||||
|
38
pkg/common/db/controller/third.go
Normal file
38
pkg/common/db/controller/third.go
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package controller
|
||||||
|
|
||||||
|
import (
|
||||||
|
"OpenIM/pkg/common/db/cache"
|
||||||
|
"OpenIM/pkg/proto/sdkws"
|
||||||
|
"context"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ThirdDatabase interface {
|
||||||
|
GetSignalInvitationInfoByClientMsgID(ctx context.Context, clientMsgID string) (invitationInfo *sdkws.SignalInviteReq, err error)
|
||||||
|
GetAvailableSignalInvitationInfo(ctx context.Context, userID string) (invitationInfo *sdkws.SignalInviteReq, err error)
|
||||||
|
FcmUpdateToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) error
|
||||||
|
SetAppBadge(ctx context.Context, userID string, value int) error
|
||||||
|
}
|
||||||
|
|
||||||
|
type thirdDatabase struct {
|
||||||
|
cache cache.Cache
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewThirdDatabase(cache cache.Cache) ThirdDatabase {
|
||||||
|
return &thirdDatabase{cache: cache}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdDatabase) GetSignalInvitationInfoByClientMsgID(ctx context.Context, clientMsgID string) (invitationInfo *sdkws.SignalInviteReq, err error) {
|
||||||
|
return t.cache.GetSignalInvitationInfoByClientMsgID(ctx, clientMsgID)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdDatabase) GetAvailableSignalInvitationInfo(ctx context.Context, userID string) (invitationInfo *sdkws.SignalInviteReq, err error) {
|
||||||
|
return t.cache.GetAvailableSignalInvitationInfo(ctx, userID)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdDatabase) FcmUpdateToken(ctx context.Context, account string, platformID int, fcmToken string, expireTime int64) error {
|
||||||
|
return t.cache.SetFcmToken(ctx, account, platformID, fcmToken, expireTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *thirdDatabase) SetAppBadge(ctx context.Context, userID string, value int) error {
|
||||||
|
return t.cache.SetUserBadgeUnreadCountSum(ctx, userID, value)
|
||||||
|
}
|
@ -13,11 +13,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
//func NewMongo() *Mongo {
|
type Mongo struct {
|
||||||
// mgo := &Mongo{}
|
db *mongo.Client
|
||||||
// mgo.InitMongo()
|
}
|
||||||
// return mgo
|
|
||||||
//}
|
|
||||||
|
|
||||||
func NewMongo() (*Mongo, error) {
|
func NewMongo() (*Mongo, error) {
|
||||||
uri := "mongodb://sample.host:27017/?maxPoolSize=20&w=majority"
|
uri := "mongodb://sample.host:27017/?maxPoolSize=20&w=majority"
|
||||||
@ -54,50 +52,6 @@ func NewMongo() (*Mongo, error) {
|
|||||||
return &Mongo{db: mongoClient}, nil
|
return &Mongo{db: mongoClient}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type Mongo struct {
|
|
||||||
db *mongo.Client
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Mongo) InitMongo() {
|
|
||||||
uri := "mongodb://sample.host:27017/?maxPoolSize=20&w=majority"
|
|
||||||
if config.Config.Mongo.DBUri != "" {
|
|
||||||
// example: mongodb://$user:$password@mongo1.mongo:27017,mongo2.mongo:27017,mongo3.mongo:27017/$DBDatabase/?replicaSet=rs0&readPreference=secondary&authSource=admin&maxPoolSize=$DBMaxPoolSize
|
|
||||||
uri = config.Config.Mongo.DBUri
|
|
||||||
} else {
|
|
||||||
//mongodb://mongodb1.example.com:27317,mongodb2.example.com:27017/?replicaSet=mySet&authSource=authDB
|
|
||||||
mongodbHosts := ""
|
|
||||||
for i, v := range config.Config.Mongo.DBAddress {
|
|
||||||
if i == len(config.Config.Mongo.DBAddress)-1 {
|
|
||||||
mongodbHosts += v
|
|
||||||
} else {
|
|
||||||
mongodbHosts += v + ","
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if config.Config.Mongo.DBPassword != "" && config.Config.Mongo.DBUserName != "" {
|
|
||||||
// clientOpts := options.Client().ApplyURI("mongodb://localhost:27017,localhost:27018/?replicaSet=replset")
|
|
||||||
//mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
|
|
||||||
//uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d&authSource=admin&replicaSet=replset",
|
|
||||||
uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d&authSource=admin",
|
|
||||||
config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, mongodbHosts,
|
|
||||||
config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize)
|
|
||||||
} else {
|
|
||||||
uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d&authSource=admin",
|
|
||||||
mongodbHosts, config.Config.Mongo.DBDatabase,
|
|
||||||
config.Config.Mongo.DBMaxPoolSize)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fmt.Println(utils.GetFuncName(1), "start to init mongoDB:", uri)
|
|
||||||
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
|
||||||
if err != nil {
|
|
||||||
time.Sleep(time.Duration(30) * time.Second)
|
|
||||||
mongoClient, err = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
|
||||||
if err != nil {
|
|
||||||
panic(err.Error() + " mongo.Connect failed " + uri)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.db = mongoClient
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Mongo) GetClient() *mongo.Client {
|
func (m *Mongo) GetClient() *mongo.Client {
|
||||||
return m.db
|
return m.db
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} }
|
|||||||
func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) }
|
func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*OnlinePushMsgReq) ProtoMessage() {}
|
func (*OnlinePushMsgReq) ProtoMessage() {}
|
||||||
func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) {
|
func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{0}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{0}
|
||||||
}
|
}
|
||||||
func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error {
|
func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b)
|
return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b)
|
||||||
@ -89,7 +89,7 @@ func (m *OnlinePushMsgResp) Reset() { *m = OnlinePushMsgResp{} }
|
|||||||
func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) }
|
func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*OnlinePushMsgResp) ProtoMessage() {}
|
func (*OnlinePushMsgResp) ProtoMessage() {}
|
||||||
func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) {
|
func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{1}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{1}
|
||||||
}
|
}
|
||||||
func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error {
|
func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b)
|
return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b)
|
||||||
@ -129,7 +129,7 @@ func (m *SingleMsgToUserResultList) Reset() { *m = SingleMsgToUserResult
|
|||||||
func (m *SingleMsgToUserResultList) String() string { return proto.CompactTextString(m) }
|
func (m *SingleMsgToUserResultList) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SingleMsgToUserResultList) ProtoMessage() {}
|
func (*SingleMsgToUserResultList) ProtoMessage() {}
|
||||||
func (*SingleMsgToUserResultList) Descriptor() ([]byte, []int) {
|
func (*SingleMsgToUserResultList) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{2}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{2}
|
||||||
}
|
}
|
||||||
func (m *SingleMsgToUserResultList) XXX_Unmarshal(b []byte) error {
|
func (m *SingleMsgToUserResultList) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_SingleMsgToUserResultList.Unmarshal(m, b)
|
return xxx_messageInfo_SingleMsgToUserResultList.Unmarshal(m, b)
|
||||||
@ -183,7 +183,7 @@ func (m *OnlineBatchPushOneMsgReq) Reset() { *m = OnlineBatchPushOneMsgR
|
|||||||
func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) }
|
func (m *OnlineBatchPushOneMsgReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*OnlineBatchPushOneMsgReq) ProtoMessage() {}
|
func (*OnlineBatchPushOneMsgReq) ProtoMessage() {}
|
||||||
func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) {
|
func (*OnlineBatchPushOneMsgReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{3}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{3}
|
||||||
}
|
}
|
||||||
func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error {
|
func (m *OnlineBatchPushOneMsgReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b)
|
return xxx_messageInfo_OnlineBatchPushOneMsgReq.Unmarshal(m, b)
|
||||||
@ -235,7 +235,7 @@ func (m *OnlineBatchPushOneMsgResp) Reset() { *m = OnlineBatchPushOneMsg
|
|||||||
func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) }
|
func (m *OnlineBatchPushOneMsgResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*OnlineBatchPushOneMsgResp) ProtoMessage() {}
|
func (*OnlineBatchPushOneMsgResp) ProtoMessage() {}
|
||||||
func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) {
|
func (*OnlineBatchPushOneMsgResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{4}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{4}
|
||||||
}
|
}
|
||||||
func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error {
|
func (m *OnlineBatchPushOneMsgResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b)
|
return xxx_messageInfo_OnlineBatchPushOneMsgResp.Unmarshal(m, b)
|
||||||
@ -275,7 +275,7 @@ func (m *SingleMsgToUserPlatform) Reset() { *m = SingleMsgToUserPlatform
|
|||||||
func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) }
|
func (m *SingleMsgToUserPlatform) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SingleMsgToUserPlatform) ProtoMessage() {}
|
func (*SingleMsgToUserPlatform) ProtoMessage() {}
|
||||||
func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) {
|
func (*SingleMsgToUserPlatform) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{5}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{5}
|
||||||
}
|
}
|
||||||
func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error {
|
func (m *SingleMsgToUserPlatform) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b)
|
return xxx_messageInfo_SingleMsgToUserPlatform.Unmarshal(m, b)
|
||||||
@ -329,7 +329,7 @@ func (m *GetUsersOnlineStatusReq) Reset() { *m = GetUsersOnlineStatusReq
|
|||||||
func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) }
|
func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetUsersOnlineStatusReq) ProtoMessage() {}
|
func (*GetUsersOnlineStatusReq) ProtoMessage() {}
|
||||||
func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) {
|
func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{6}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{6}
|
||||||
}
|
}
|
||||||
func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error {
|
func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b)
|
return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b)
|
||||||
@ -384,7 +384,7 @@ func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusRe
|
|||||||
func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) }
|
func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetUsersOnlineStatusResp) ProtoMessage() {}
|
func (*GetUsersOnlineStatusResp) ProtoMessage() {}
|
||||||
func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) {
|
func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{7}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{7}
|
||||||
}
|
}
|
||||||
func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error {
|
func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b)
|
return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b)
|
||||||
@ -448,7 +448,7 @@ func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() {
|
|||||||
func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) }
|
func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {}
|
func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {}
|
||||||
func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) {
|
func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{7, 0}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{7, 0}
|
||||||
}
|
}
|
||||||
func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error {
|
func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b)
|
return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b)
|
||||||
@ -509,7 +509,7 @@ func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersO
|
|||||||
func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) }
|
func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {}
|
func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {}
|
||||||
func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) {
|
func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{7, 1}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{7, 1}
|
||||||
}
|
}
|
||||||
func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error {
|
func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b)
|
return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b)
|
||||||
@ -565,7 +565,7 @@ func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() {
|
|||||||
func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) }
|
func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {}
|
func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {}
|
||||||
func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) {
|
func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{7, 2}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{7, 2}
|
||||||
}
|
}
|
||||||
func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error {
|
func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b)
|
return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b)
|
||||||
@ -619,7 +619,7 @@ func (m *KickUserOfflineReq) Reset() { *m = KickUserOfflineReq{} }
|
|||||||
func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) }
|
func (m *KickUserOfflineReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*KickUserOfflineReq) ProtoMessage() {}
|
func (*KickUserOfflineReq) ProtoMessage() {}
|
||||||
func (*KickUserOfflineReq) Descriptor() ([]byte, []int) {
|
func (*KickUserOfflineReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{8}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{8}
|
||||||
}
|
}
|
||||||
func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error {
|
func (m *KickUserOfflineReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b)
|
return xxx_messageInfo_KickUserOfflineReq.Unmarshal(m, b)
|
||||||
@ -670,7 +670,7 @@ func (m *KickUserOfflineResp) Reset() { *m = KickUserOfflineResp{} }
|
|||||||
func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) }
|
func (m *KickUserOfflineResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*KickUserOfflineResp) ProtoMessage() {}
|
func (*KickUserOfflineResp) ProtoMessage() {}
|
||||||
func (*KickUserOfflineResp) Descriptor() ([]byte, []int) {
|
func (*KickUserOfflineResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{9}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{9}
|
||||||
}
|
}
|
||||||
func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error {
|
func (m *KickUserOfflineResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b)
|
return xxx_messageInfo_KickUserOfflineResp.Unmarshal(m, b)
|
||||||
@ -704,7 +704,7 @@ func (m *MultiTerminalLoginCheckReq) Reset() { *m = MultiTerminalLoginCh
|
|||||||
func (m *MultiTerminalLoginCheckReq) String() string { return proto.CompactTextString(m) }
|
func (m *MultiTerminalLoginCheckReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*MultiTerminalLoginCheckReq) ProtoMessage() {}
|
func (*MultiTerminalLoginCheckReq) ProtoMessage() {}
|
||||||
func (*MultiTerminalLoginCheckReq) Descriptor() ([]byte, []int) {
|
func (*MultiTerminalLoginCheckReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{10}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{10}
|
||||||
}
|
}
|
||||||
func (m *MultiTerminalLoginCheckReq) XXX_Unmarshal(b []byte) error {
|
func (m *MultiTerminalLoginCheckReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_MultiTerminalLoginCheckReq.Unmarshal(m, b)
|
return xxx_messageInfo_MultiTerminalLoginCheckReq.Unmarshal(m, b)
|
||||||
@ -764,7 +764,7 @@ func (m *MultiTerminalLoginCheckResp) Reset() { *m = MultiTerminalLoginC
|
|||||||
func (m *MultiTerminalLoginCheckResp) String() string { return proto.CompactTextString(m) }
|
func (m *MultiTerminalLoginCheckResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*MultiTerminalLoginCheckResp) ProtoMessage() {}
|
func (*MultiTerminalLoginCheckResp) ProtoMessage() {}
|
||||||
func (*MultiTerminalLoginCheckResp) Descriptor() ([]byte, []int) {
|
func (*MultiTerminalLoginCheckResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d, []int{11}
|
return fileDescriptor_msg_gateway_f8a0998f55e14ad9, []int{11}
|
||||||
}
|
}
|
||||||
func (m *MultiTerminalLoginCheckResp) XXX_Unmarshal(b []byte) error {
|
func (m *MultiTerminalLoginCheckResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_MultiTerminalLoginCheckResp.Unmarshal(m, b)
|
return xxx_messageInfo_MultiTerminalLoginCheckResp.Unmarshal(m, b)
|
||||||
@ -824,9 +824,9 @@ var _ grpc.ClientConn
|
|||||||
// is compatible with the grpc package it is being compiled against.
|
// is compatible with the grpc package it is being compiled against.
|
||||||
const _ = grpc.SupportPackageIsVersion4
|
const _ = grpc.SupportPackageIsVersion4
|
||||||
|
|
||||||
// Client API for Relay service
|
// Client API for MsgGateway service
|
||||||
|
|
||||||
type RelayClient interface {
|
type MsgGatewayClient interface {
|
||||||
OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error)
|
OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error)
|
||||||
GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error)
|
GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error)
|
||||||
OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error)
|
OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error)
|
||||||
@ -835,71 +835,71 @@ type RelayClient interface {
|
|||||||
MultiTerminalLoginCheck(ctx context.Context, in *MultiTerminalLoginCheckReq, opts ...grpc.CallOption) (*MultiTerminalLoginCheckResp, error)
|
MultiTerminalLoginCheck(ctx context.Context, in *MultiTerminalLoginCheckReq, opts ...grpc.CallOption) (*MultiTerminalLoginCheckResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type relayClient struct {
|
type msgGatewayClient struct {
|
||||||
cc *grpc.ClientConn
|
cc *grpc.ClientConn
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRelayClient(cc *grpc.ClientConn) RelayClient {
|
func NewMsgGatewayClient(cc *grpc.ClientConn) MsgGatewayClient {
|
||||||
return &relayClient{cc}
|
return &msgGatewayClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *relayClient) OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error) {
|
func (c *msgGatewayClient) OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error) {
|
||||||
out := new(OnlinePushMsgResp)
|
out := new(OnlinePushMsgResp)
|
||||||
err := grpc.Invoke(ctx, "/msggateway.relay/OnlinePushMsg", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/msggateway.msgGateway/OnlinePushMsg", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *relayClient) GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error) {
|
func (c *msgGatewayClient) GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error) {
|
||||||
out := new(GetUsersOnlineStatusResp)
|
out := new(GetUsersOnlineStatusResp)
|
||||||
err := grpc.Invoke(ctx, "/msggateway.relay/GetUsersOnlineStatus", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/msggateway.msgGateway/GetUsersOnlineStatus", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *relayClient) OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) {
|
func (c *msgGatewayClient) OnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) {
|
||||||
out := new(OnlineBatchPushOneMsgResp)
|
out := new(OnlineBatchPushOneMsgResp)
|
||||||
err := grpc.Invoke(ctx, "/msggateway.relay/OnlineBatchPushOneMsg", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/msggateway.msgGateway/OnlineBatchPushOneMsg", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *relayClient) SuperGroupOnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) {
|
func (c *msgGatewayClient) SuperGroupOnlineBatchPushOneMsg(ctx context.Context, in *OnlineBatchPushOneMsgReq, opts ...grpc.CallOption) (*OnlineBatchPushOneMsgResp, error) {
|
||||||
out := new(OnlineBatchPushOneMsgResp)
|
out := new(OnlineBatchPushOneMsgResp)
|
||||||
err := grpc.Invoke(ctx, "/msggateway.relay/SuperGroupOnlineBatchPushOneMsg", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/msggateway.msgGateway/SuperGroupOnlineBatchPushOneMsg", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *relayClient) KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, error) {
|
func (c *msgGatewayClient) KickUserOffline(ctx context.Context, in *KickUserOfflineReq, opts ...grpc.CallOption) (*KickUserOfflineResp, error) {
|
||||||
out := new(KickUserOfflineResp)
|
out := new(KickUserOfflineResp)
|
||||||
err := grpc.Invoke(ctx, "/msggateway.relay/KickUserOffline", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/msggateway.msgGateway/KickUserOffline", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *relayClient) MultiTerminalLoginCheck(ctx context.Context, in *MultiTerminalLoginCheckReq, opts ...grpc.CallOption) (*MultiTerminalLoginCheckResp, error) {
|
func (c *msgGatewayClient) MultiTerminalLoginCheck(ctx context.Context, in *MultiTerminalLoginCheckReq, opts ...grpc.CallOption) (*MultiTerminalLoginCheckResp, error) {
|
||||||
out := new(MultiTerminalLoginCheckResp)
|
out := new(MultiTerminalLoginCheckResp)
|
||||||
err := grpc.Invoke(ctx, "/msggateway.relay/MultiTerminalLoginCheck", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/msggateway.msgGateway/MultiTerminalLoginCheck", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Server API for Relay service
|
// Server API for MsgGateway service
|
||||||
|
|
||||||
type RelayServer interface {
|
type MsgGatewayServer interface {
|
||||||
OnlinePushMsg(context.Context, *OnlinePushMsgReq) (*OnlinePushMsgResp, error)
|
OnlinePushMsg(context.Context, *OnlinePushMsgReq) (*OnlinePushMsgResp, error)
|
||||||
GetUsersOnlineStatus(context.Context, *GetUsersOnlineStatusReq) (*GetUsersOnlineStatusResp, error)
|
GetUsersOnlineStatus(context.Context, *GetUsersOnlineStatusReq) (*GetUsersOnlineStatusResp, error)
|
||||||
OnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error)
|
OnlineBatchPushOneMsg(context.Context, *OnlineBatchPushOneMsgReq) (*OnlineBatchPushOneMsgResp, error)
|
||||||
@ -908,145 +908,145 @@ type RelayServer interface {
|
|||||||
MultiTerminalLoginCheck(context.Context, *MultiTerminalLoginCheckReq) (*MultiTerminalLoginCheckResp, error)
|
MultiTerminalLoginCheck(context.Context, *MultiTerminalLoginCheckReq) (*MultiTerminalLoginCheckResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterRelayServer(s *grpc.Server, srv RelayServer) {
|
func RegisterMsgGatewayServer(s *grpc.Server, srv MsgGatewayServer) {
|
||||||
s.RegisterService(&_Relay_serviceDesc, srv)
|
s.RegisterService(&_MsgGateway_serviceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Relay_OnlinePushMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _MsgGateway_OnlinePushMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(OnlinePushMsgReq)
|
in := new(OnlinePushMsgReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(RelayServer).OnlinePushMsg(ctx, in)
|
return srv.(MsgGatewayServer).OnlinePushMsg(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/msggateway.relay/OnlinePushMsg",
|
FullMethod: "/msggateway.msgGateway/OnlinePushMsg",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(RelayServer).OnlinePushMsg(ctx, req.(*OnlinePushMsgReq))
|
return srv.(MsgGatewayServer).OnlinePushMsg(ctx, req.(*OnlinePushMsgReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Relay_GetUsersOnlineStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _MsgGateway_GetUsersOnlineStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetUsersOnlineStatusReq)
|
in := new(GetUsersOnlineStatusReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(RelayServer).GetUsersOnlineStatus(ctx, in)
|
return srv.(MsgGatewayServer).GetUsersOnlineStatus(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/msggateway.relay/GetUsersOnlineStatus",
|
FullMethod: "/msggateway.msgGateway/GetUsersOnlineStatus",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(RelayServer).GetUsersOnlineStatus(ctx, req.(*GetUsersOnlineStatusReq))
|
return srv.(MsgGatewayServer).GetUsersOnlineStatus(ctx, req.(*GetUsersOnlineStatusReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Relay_OnlineBatchPushOneMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _MsgGateway_OnlineBatchPushOneMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(OnlineBatchPushOneMsgReq)
|
in := new(OnlineBatchPushOneMsgReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(RelayServer).OnlineBatchPushOneMsg(ctx, in)
|
return srv.(MsgGatewayServer).OnlineBatchPushOneMsg(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/msggateway.relay/OnlineBatchPushOneMsg",
|
FullMethod: "/msggateway.msgGateway/OnlineBatchPushOneMsg",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(RelayServer).OnlineBatchPushOneMsg(ctx, req.(*OnlineBatchPushOneMsgReq))
|
return srv.(MsgGatewayServer).OnlineBatchPushOneMsg(ctx, req.(*OnlineBatchPushOneMsgReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Relay_SuperGroupOnlineBatchPushOneMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _MsgGateway_SuperGroupOnlineBatchPushOneMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(OnlineBatchPushOneMsgReq)
|
in := new(OnlineBatchPushOneMsgReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(RelayServer).SuperGroupOnlineBatchPushOneMsg(ctx, in)
|
return srv.(MsgGatewayServer).SuperGroupOnlineBatchPushOneMsg(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/msggateway.relay/SuperGroupOnlineBatchPushOneMsg",
|
FullMethod: "/msggateway.msgGateway/SuperGroupOnlineBatchPushOneMsg",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(RelayServer).SuperGroupOnlineBatchPushOneMsg(ctx, req.(*OnlineBatchPushOneMsgReq))
|
return srv.(MsgGatewayServer).SuperGroupOnlineBatchPushOneMsg(ctx, req.(*OnlineBatchPushOneMsgReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Relay_KickUserOffline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _MsgGateway_KickUserOffline_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(KickUserOfflineReq)
|
in := new(KickUserOfflineReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(RelayServer).KickUserOffline(ctx, in)
|
return srv.(MsgGatewayServer).KickUserOffline(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/msggateway.relay/KickUserOffline",
|
FullMethod: "/msggateway.msgGateway/KickUserOffline",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(RelayServer).KickUserOffline(ctx, req.(*KickUserOfflineReq))
|
return srv.(MsgGatewayServer).KickUserOffline(ctx, req.(*KickUserOfflineReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Relay_MultiTerminalLoginCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _MsgGateway_MultiTerminalLoginCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(MultiTerminalLoginCheckReq)
|
in := new(MultiTerminalLoginCheckReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(RelayServer).MultiTerminalLoginCheck(ctx, in)
|
return srv.(MsgGatewayServer).MultiTerminalLoginCheck(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/msggateway.relay/MultiTerminalLoginCheck",
|
FullMethod: "/msggateway.msgGateway/MultiTerminalLoginCheck",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(RelayServer).MultiTerminalLoginCheck(ctx, req.(*MultiTerminalLoginCheckReq))
|
return srv.(MsgGatewayServer).MultiTerminalLoginCheck(ctx, req.(*MultiTerminalLoginCheckReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
var _Relay_serviceDesc = grpc.ServiceDesc{
|
var _MsgGateway_serviceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "msggateway.relay",
|
ServiceName: "msggateway.msgGateway",
|
||||||
HandlerType: (*RelayServer)(nil),
|
HandlerType: (*MsgGatewayServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
{
|
||||||
MethodName: "OnlinePushMsg",
|
MethodName: "OnlinePushMsg",
|
||||||
Handler: _Relay_OnlinePushMsg_Handler,
|
Handler: _MsgGateway_OnlinePushMsg_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetUsersOnlineStatus",
|
MethodName: "GetUsersOnlineStatus",
|
||||||
Handler: _Relay_GetUsersOnlineStatus_Handler,
|
Handler: _MsgGateway_GetUsersOnlineStatus_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "OnlineBatchPushOneMsg",
|
MethodName: "OnlineBatchPushOneMsg",
|
||||||
Handler: _Relay_OnlineBatchPushOneMsg_Handler,
|
Handler: _MsgGateway_OnlineBatchPushOneMsg_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "SuperGroupOnlineBatchPushOneMsg",
|
MethodName: "SuperGroupOnlineBatchPushOneMsg",
|
||||||
Handler: _Relay_SuperGroupOnlineBatchPushOneMsg_Handler,
|
Handler: _MsgGateway_SuperGroupOnlineBatchPushOneMsg_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "KickUserOffline",
|
MethodName: "KickUserOffline",
|
||||||
Handler: _Relay_KickUserOffline_Handler,
|
Handler: _MsgGateway_KickUserOffline_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "MultiTerminalLoginCheck",
|
MethodName: "MultiTerminalLoginCheck",
|
||||||
Handler: _Relay_MultiTerminalLoginCheck_Handler,
|
Handler: _MsgGateway_MultiTerminalLoginCheck_Handler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
@ -1054,62 +1054,62 @@ var _Relay_serviceDesc = grpc.ServiceDesc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterFile("msggateway/msg_gateway.proto", fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d)
|
proto.RegisterFile("msggateway/msg_gateway.proto", fileDescriptor_msg_gateway_f8a0998f55e14ad9)
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptor_msg_gateway_6b0c70f9cf7f8f8d = []byte{
|
var fileDescriptor_msg_gateway_f8a0998f55e14ad9 = []byte{
|
||||||
// 842 bytes of a gzipped FileDescriptorProto
|
// 843 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x8f, 0xd3, 0x46,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x8f, 0xd3, 0x46,
|
||||||
0x14, 0x97, 0x49, 0x02, 0xec, 0xdb, 0x5d, 0xba, 0x9d, 0x2e, 0x5d, 0xe3, 0xd2, 0x25, 0x32, 0xb0,
|
0x14, 0x97, 0x49, 0x02, 0xec, 0xdb, 0x5d, 0xba, 0x9d, 0x2e, 0x5d, 0xe3, 0xd2, 0x25, 0x32, 0xb0,
|
||||||
0x44, 0x95, 0x48, 0xd4, 0xf4, 0xd0, 0x43, 0x6f, 0x4b, 0x04, 0x8a, 0x9a, 0x28, 0x74, 0x02, 0x12,
|
0x44, 0x95, 0x48, 0xd4, 0xf4, 0xd0, 0x43, 0x6f, 0x4b, 0xc4, 0x2a, 0x6a, 0xa2, 0xd0, 0x09, 0x48,
|
||||||
0xea, 0xa5, 0x72, 0x9d, 0x89, 0xe3, 0xc6, 0xf1, 0x0c, 0x33, 0x36, 0xd1, 0x5e, 0x5a, 0x89, 0x73,
|
0xa8, 0x97, 0xca, 0x75, 0x26, 0x8e, 0x1b, 0xc7, 0x33, 0xcc, 0xd8, 0x44, 0x5c, 0x5a, 0x89, 0x73,
|
||||||
0x4f, 0xfd, 0x12, 0xfd, 0x36, 0xfd, 0x4c, 0xd5, 0xfc, 0x49, 0x32, 0x8e, 0xe3, 0x25, 0x20, 0xb5,
|
0x4f, 0xfd, 0x12, 0xfd, 0x40, 0xfd, 0x42, 0xd5, 0xfc, 0x49, 0x32, 0x8e, 0xe3, 0x25, 0x20, 0xb5,
|
||||||
0x37, 0xbf, 0xdf, 0xcc, 0xfb, 0xf3, 0xfb, 0xbd, 0x37, 0x33, 0x86, 0xfb, 0x0b, 0x11, 0x45, 0x41,
|
0x37, 0xbf, 0xdf, 0xcc, 0xfb, 0xf3, 0xfb, 0xbd, 0x37, 0x33, 0x86, 0xfb, 0x0b, 0x11, 0x45, 0x41,
|
||||||
0x46, 0x96, 0xc1, 0x55, 0x67, 0x21, 0xa2, 0x5f, 0xcc, 0x77, 0x9b, 0x71, 0x9a, 0x51, 0x04, 0x9b,
|
0x46, 0x96, 0xc1, 0xbb, 0xce, 0x42, 0x44, 0xbf, 0x98, 0xef, 0x36, 0xe3, 0x34, 0xa3, 0x08, 0x36,
|
||||||
0x55, 0xef, 0xc9, 0x88, 0x91, 0xf4, 0x69, 0x7f, 0xf8, 0x74, 0x4c, 0xf8, 0x3b, 0xc2, 0x3b, 0x6c,
|
0xab, 0xde, 0x93, 0x11, 0x23, 0xe9, 0xd3, 0xfe, 0xf0, 0xe9, 0x98, 0xf0, 0xb7, 0x84, 0x77, 0xd8,
|
||||||
0x1e, 0x75, 0xd4, 0xae, 0x8e, 0x98, 0xcc, 0x97, 0xa2, 0xb3, 0x14, 0xda, 0xc9, 0x7f, 0xef, 0xc0,
|
0x3c, 0xea, 0xa8, 0x5d, 0x1d, 0x31, 0x99, 0x2f, 0x45, 0x67, 0x29, 0xb4, 0x93, 0xff, 0xde, 0x81,
|
||||||
0xc9, 0x28, 0x4d, 0xe2, 0x94, 0xbc, 0xcc, 0xc5, 0x6c, 0x28, 0x22, 0x4c, 0xde, 0xa2, 0x26, 0x1c,
|
0x93, 0x51, 0x9a, 0xc4, 0x29, 0x79, 0x91, 0x8b, 0xd9, 0x50, 0x44, 0x98, 0xbc, 0x41, 0x4d, 0x38,
|
||||||
0x8e, 0x18, 0xe1, 0x41, 0x16, 0xd3, 0xb4, 0xdf, 0x73, 0x9d, 0xa6, 0xd3, 0x3a, 0xc0, 0x36, 0x84,
|
0x1c, 0x31, 0xc2, 0x83, 0x2c, 0xa6, 0x69, 0xbf, 0xe7, 0x3a, 0x4d, 0xa7, 0x75, 0x80, 0x6d, 0x08,
|
||||||
0x5a, 0x70, 0x6b, 0x21, 0xa2, 0x5e, 0x90, 0x05, 0xee, 0x8d, 0xa6, 0xd3, 0x3a, 0xec, 0xde, 0x69,
|
0xb5, 0xe0, 0xd6, 0x42, 0x44, 0xbd, 0x20, 0x0b, 0xdc, 0x1b, 0x4d, 0xa7, 0x75, 0xd8, 0xbd, 0xd3,
|
||||||
0xab, 0xc0, 0xed, 0xa1, 0x46, 0xf1, 0x6a, 0x19, 0xf9, 0x70, 0xc4, 0x72, 0x31, 0x7b, 0x45, 0x5f,
|
0x56, 0x81, 0xdb, 0x43, 0x8d, 0xe2, 0xd5, 0x32, 0xf2, 0xe1, 0x88, 0xe5, 0x62, 0xf6, 0x92, 0xbe,
|
||||||
0x0b, 0xc2, 0xfb, 0x3d, 0xb7, 0xa6, 0x82, 0x15, 0x30, 0x7f, 0x00, 0x9f, 0x6f, 0xd5, 0x20, 0x18,
|
0x12, 0x84, 0xf7, 0x7b, 0x6e, 0x4d, 0x05, 0x2b, 0x60, 0xfe, 0x00, 0x3e, 0xdf, 0xaa, 0x41, 0x30,
|
||||||
0xfa, 0x1e, 0xea, 0x9c, 0x08, 0xe6, 0x3a, 0xcd, 0x5a, 0xeb, 0xb0, 0xfb, 0xb0, 0xbd, 0x61, 0xd7,
|
0xf4, 0x3d, 0xd4, 0x39, 0x11, 0xcc, 0x75, 0x9a, 0xb5, 0xd6, 0x61, 0xf7, 0x61, 0x7b, 0xc3, 0xae,
|
||||||
0x1e, 0xc7, 0x69, 0x94, 0x90, 0xa1, 0x88, 0x74, 0x84, 0x97, 0x49, 0x90, 0x4d, 0x29, 0x5f, 0x60,
|
0x3d, 0x8e, 0xd3, 0x28, 0x21, 0x43, 0x11, 0xe9, 0x08, 0x2f, 0x92, 0x20, 0x9b, 0x52, 0xbe, 0xc0,
|
||||||
0xe5, 0xe0, 0xff, 0xe9, 0xc0, 0xbd, 0xad, 0x1d, 0x98, 0x88, 0x3c, 0xc9, 0x06, 0xb1, 0xc8, 0xd0,
|
0xca, 0xc1, 0xff, 0xd3, 0x81, 0x7b, 0x5b, 0x3b, 0x30, 0x11, 0x79, 0x92, 0x0d, 0x62, 0x91, 0xa1,
|
||||||
0x97, 0x70, 0x33, 0xd7, 0x95, 0x68, 0x5a, 0xc6, 0x5a, 0xa7, 0xbb, 0xf1, 0x91, 0xe9, 0xd0, 0x39,
|
0x2f, 0xe1, 0x66, 0xae, 0x2b, 0xd1, 0xb4, 0x8c, 0xb5, 0x4e, 0x77, 0xe3, 0x23, 0xd3, 0xa1, 0x73,
|
||||||
0x00, 0x5d, 0x17, 0xaf, 0xe8, 0xdd, 0xc6, 0x16, 0xe2, 0xff, 0xe5, 0x80, 0xab, 0xd9, 0x5d, 0x06,
|
0x00, 0xba, 0x2e, 0x5e, 0xd1, 0xbb, 0x8d, 0x2d, 0xc4, 0xff, 0xcb, 0x01, 0x57, 0xb3, 0xbb, 0x0c,
|
||||||
0x59, 0x38, 0x93, 0xd8, 0x28, 0x25, 0xff, 0x81, 0xd2, 0xdf, 0xc0, 0x89, 0xad, 0xaa, 0x64, 0xeb,
|
0xb2, 0x70, 0x26, 0xb1, 0x51, 0x4a, 0xfe, 0x03, 0xa5, 0xbf, 0x81, 0x13, 0x5b, 0x55, 0xc9, 0xd6,
|
||||||
0xd6, 0x9a, 0xb5, 0xd6, 0x01, 0x2e, 0xe1, 0x7e, 0x0a, 0xf7, 0x2a, 0x6a, 0x12, 0x0c, 0xfd, 0x04,
|
0xad, 0x35, 0x6b, 0xad, 0x03, 0x5c, 0xc2, 0xfd, 0x14, 0xee, 0x55, 0xd4, 0x24, 0x18, 0xfa, 0x09,
|
||||||
0x27, 0x42, 0x51, 0x96, 0xb8, 0x96, 0xce, 0x74, 0xe1, 0xf1, 0x35, 0xb2, 0x6c, 0x34, 0xc6, 0x25,
|
0x4e, 0x84, 0xa2, 0x2c, 0x71, 0x2d, 0x9d, 0xe9, 0xc2, 0xe3, 0x6b, 0x64, 0xd9, 0x68, 0x8c, 0x4b,
|
||||||
0x77, 0xff, 0x0a, 0xce, 0x2a, 0x54, 0x94, 0xfa, 0xe9, 0x4d, 0xcf, 0xe8, 0x84, 0x28, 0x05, 0x6a,
|
0xee, 0xfe, 0x3b, 0x38, 0xab, 0x50, 0x51, 0xea, 0xa7, 0x37, 0x3d, 0xa3, 0x13, 0xa2, 0x14, 0xa8,
|
||||||
0xd8, 0x42, 0x64, 0xc3, 0x30, 0x09, 0xdf, 0xf5, 0x7b, 0x8a, 0xff, 0x01, 0x36, 0x16, 0xba, 0x80,
|
0x61, 0x0b, 0x91, 0x0d, 0xc3, 0x24, 0x7c, 0xdb, 0xef, 0x29, 0xfe, 0x07, 0xd8, 0x58, 0xe8, 0x02,
|
||||||
0x3b, 0xf2, 0x4b, 0xc6, 0x79, 0x4e, 0xf9, 0xc2, 0x8c, 0x56, 0x03, 0x6f, 0xa1, 0xfe, 0x12, 0xce,
|
0xee, 0xc8, 0x2f, 0x19, 0xe7, 0x39, 0xe5, 0x0b, 0x33, 0x5a, 0x0d, 0xbc, 0x85, 0xfa, 0x4b, 0x38,
|
||||||
0x5e, 0x90, 0x4c, 0xa6, 0x14, 0x9a, 0xf2, 0x38, 0x0b, 0xb2, 0x5c, 0x48, 0xf5, 0xcf, 0x01, 0xf2,
|
0xbb, 0x22, 0x99, 0x4c, 0x29, 0x34, 0xe5, 0x71, 0x16, 0x64, 0xb9, 0x90, 0xea, 0x9f, 0x03, 0xe4,
|
||||||
0x8d, 0x56, 0x8e, 0xd2, 0xca, 0x42, 0x64, 0x77, 0xa8, 0xd5, 0x1d, 0x9d, 0xdf, 0x86, 0x90, 0x07,
|
0x1b, 0xad, 0x1c, 0xa5, 0x95, 0x85, 0xc8, 0xee, 0x50, 0xab, 0x3b, 0x3a, 0xbf, 0x0d, 0x21, 0x0f,
|
||||||
0xb7, 0x29, 0x2b, 0x4c, 0xf6, 0xda, 0xf6, 0xdf, 0x37, 0xc0, 0xdd, 0x9d, 0x59, 0x30, 0xe4, 0xc2,
|
0x6e, 0x53, 0x56, 0x98, 0xec, 0xb5, 0xed, 0xbf, 0x6f, 0x80, 0xbb, 0x3b, 0xb3, 0x60, 0xc8, 0x85,
|
||||||
0x2d, 0xc2, 0xf9, 0x9a, 0x72, 0x03, 0xaf, 0x4c, 0xc9, 0x97, 0x70, 0x3e, 0x14, 0xd1, 0x8a, 0xaf,
|
0x5b, 0x84, 0xf3, 0x35, 0xe5, 0x06, 0x5e, 0x99, 0x92, 0x2f, 0xe1, 0x7c, 0x28, 0xa2, 0x15, 0x5f,
|
||||||
0xb6, 0xd0, 0x1b, 0x38, 0x16, 0x79, 0x18, 0x12, 0x21, 0x4c, 0x4b, 0x6a, 0xaa, 0x25, 0x5d, 0xbb,
|
0x6d, 0xa1, 0xd7, 0x70, 0x2c, 0xf2, 0x30, 0x24, 0x42, 0x98, 0x96, 0xd4, 0x54, 0x4b, 0xba, 0x76,
|
||||||
0x25, 0x55, 0xe9, 0xda, 0x63, 0xdb, 0x13, 0x17, 0x03, 0xa1, 0xd7, 0x70, 0x34, 0x0d, 0xe2, 0x84,
|
0x4b, 0xaa, 0xd2, 0xb5, 0xc7, 0xb6, 0x27, 0x2e, 0x06, 0x42, 0xaf, 0xe0, 0x68, 0x1a, 0xc4, 0x09,
|
||||||
0x4c, 0x4c, 0xe0, 0xba, 0x0a, 0xfc, 0xed, 0x5e, 0x81, 0x9f, 0x2b, 0xc7, 0x1e, 0xc9, 0x82, 0x38,
|
0x99, 0x98, 0xc0, 0x75, 0x15, 0xf8, 0xdb, 0xbd, 0x02, 0x3f, 0x57, 0x8e, 0x3d, 0x92, 0x05, 0x71,
|
||||||
0xc1, 0x85, 0x30, 0xde, 0x1f, 0x70, 0x6c, 0xd2, 0xea, 0x65, 0x29, 0x16, 0x33, 0x5d, 0x37, 0x93,
|
0x82, 0x0b, 0x61, 0xbc, 0x3f, 0xe0, 0xd8, 0xa4, 0xd5, 0xcb, 0x52, 0x2c, 0x66, 0xba, 0x6e, 0x26,
|
||||||
0xbe, 0xb6, 0x25, 0x6b, 0xa1, 0xa2, 0xae, 0x58, 0x6b, 0x4b, 0xe2, 0x21, 0x4d, 0xd3, 0xb5, 0xbc,
|
0x7d, 0x6d, 0x4b, 0xd6, 0x42, 0x45, 0x5d, 0xb1, 0xd6, 0x96, 0xc4, 0x43, 0x9a, 0xa6, 0x6b, 0x79,
|
||||||
0xc6, 0x92, 0xd7, 0x4a, 0x2c, 0x2e, 0x83, 0x70, 0x1e, 0x71, 0x9a, 0xa7, 0x13, 0xb7, 0xae, 0xce,
|
0x8d, 0x25, 0xaf, 0x95, 0x58, 0x5c, 0x06, 0xe1, 0x3c, 0xe2, 0x34, 0x4f, 0x27, 0x6e, 0x5d, 0x9d,
|
||||||
0x5d, 0x01, 0xf3, 0xde, 0xc0, 0x91, 0x5d, 0x9e, 0x75, 0xf4, 0x6b, 0x85, 0xa3, 0xff, 0xd1, 0xbd,
|
0xbb, 0x02, 0xe6, 0xbd, 0x86, 0x23, 0xbb, 0x3c, 0xeb, 0xe8, 0xd7, 0x0a, 0x47, 0xff, 0xa3, 0x7b,
|
||||||
0xf0, 0xfe, 0x76, 0xd6, 0xdc, 0x8c, 0x86, 0x55, 0xd7, 0x4a, 0x15, 0xaf, 0x29, 0x9c, 0x4e, 0x54,
|
0xe1, 0xfd, 0xed, 0xac, 0xb9, 0x19, 0x0d, 0xab, 0xae, 0x95, 0x2a, 0x5e, 0x53, 0x38, 0x9d, 0xa8,
|
||||||
0x55, 0xab, 0x73, 0xa0, 0x35, 0xfd, 0x94, 0xa6, 0x1a, 0xf1, 0x77, 0xc6, 0xf3, 0x7f, 0x07, 0xf4,
|
0xaa, 0x56, 0xe7, 0x40, 0x6b, 0xfa, 0x29, 0x4d, 0x35, 0xe2, 0xef, 0x8c, 0xe7, 0xff, 0x0e, 0xe8,
|
||||||
0x63, 0x1c, 0xce, 0x65, 0x80, 0xd1, 0x74, 0x2a, 0x03, 0x98, 0x6b, 0x87, 0x96, 0xaf, 0x1d, 0x7b,
|
0xc7, 0x38, 0x9c, 0xcb, 0x00, 0xa3, 0xe9, 0x54, 0x06, 0x30, 0xd7, 0x0e, 0x2d, 0x5f, 0x3b, 0xf6,
|
||||||
0xb0, 0xcf, 0x01, 0x56, 0xbd, 0x31, 0x93, 0xdf, 0xc0, 0x16, 0x22, 0x4f, 0xdf, 0xdc, 0xc4, 0x2d,
|
0x60, 0x9f, 0x03, 0xac, 0x7a, 0x63, 0x26, 0xbf, 0x81, 0x2d, 0x44, 0x9e, 0xbe, 0xb9, 0x89, 0x5b,
|
||||||
0x5c, 0x35, 0x5b, 0xa8, 0x7f, 0x17, 0xbe, 0x28, 0xe5, 0xd7, 0x77, 0xb4, 0x37, 0xcc, 0x93, 0x2c,
|
0xb8, 0x6a, 0xb6, 0x50, 0xff, 0x2e, 0x7c, 0x51, 0xca, 0xaf, 0xef, 0x68, 0x6f, 0x98, 0x27, 0x59,
|
||||||
0x7e, 0x45, 0xf8, 0x22, 0x4e, 0x83, 0x64, 0x40, 0xa3, 0x38, 0x7d, 0x36, 0x23, 0xe1, 0x5c, 0xd6,
|
0xfc, 0x92, 0xf0, 0x45, 0x9c, 0x06, 0xc9, 0x80, 0x46, 0x71, 0xfa, 0x6c, 0x46, 0xc2, 0xb9, 0xac,
|
||||||
0x57, 0xa5, 0xe6, 0x87, 0xaa, 0x3a, 0x85, 0x46, 0x46, 0xe7, 0x24, 0x35, 0x0d, 0xd6, 0xc6, 0x36,
|
0xaf, 0x4a, 0xcd, 0x0f, 0x55, 0x75, 0x0a, 0x8d, 0x8c, 0xce, 0x49, 0x6a, 0x1a, 0xac, 0x8d, 0x6d,
|
||||||
0xdb, 0x7a, 0x89, 0xad, 0x3f, 0x82, 0xaf, 0x2a, 0xab, 0xf9, 0x94, 0xc3, 0xda, 0xfd, 0xa7, 0x0e,
|
0xb6, 0xf5, 0x12, 0x5b, 0x7f, 0x04, 0x5f, 0x55, 0x56, 0xf3, 0x29, 0x87, 0xb5, 0xfb, 0x4f, 0x1d,
|
||||||
0x0d, 0x4e, 0x92, 0xe0, 0x0a, 0x0d, 0xe0, 0xb8, 0xf0, 0xb6, 0xa1, 0xfb, 0x76, 0x6f, 0xb7, 0x9f,
|
0xe4, 0x73, 0x7c, 0xa5, 0x5b, 0x88, 0x06, 0x70, 0x5c, 0x78, 0xe0, 0xd0, 0x7d, 0xbb, 0xc1, 0xdb,
|
||||||
0x5e, 0xef, 0xeb, 0x6b, 0x56, 0x05, 0x43, 0x01, 0x9c, 0xee, 0x1a, 0x07, 0xf4, 0xf0, 0xc3, 0x03,
|
0xef, 0xaf, 0xf7, 0xf5, 0x35, 0xab, 0x82, 0xa1, 0x00, 0x4e, 0x77, 0xcd, 0x04, 0x7a, 0xf8, 0xe1,
|
||||||
0xf3, 0xd6, 0x7b, 0xb4, 0xcf, 0x54, 0xa1, 0x09, 0xdc, 0xdd, 0xf9, 0x34, 0xa0, 0x47, 0xe5, 0xd2,
|
0xa9, 0x79, 0xe3, 0x3d, 0xda, 0x67, 0xb4, 0xd0, 0x04, 0xee, 0xee, 0x7c, 0x1f, 0xd0, 0xa3, 0x72,
|
||||||
0xca, 0x2f, 0x9a, 0xf7, 0x78, 0x8f, 0x5d, 0x82, 0xa1, 0x14, 0x1e, 0x8c, 0x73, 0x46, 0xf8, 0x0b,
|
0x69, 0xe5, 0x67, 0xcd, 0x7b, 0xbc, 0xc7, 0x2e, 0xc1, 0x50, 0x0a, 0x0f, 0xc6, 0x39, 0x23, 0xfc,
|
||||||
0x4e, 0x73, 0xf6, 0x3f, 0xe4, 0xc3, 0xf0, 0xd9, 0xd6, 0x1c, 0xa2, 0x73, 0xdb, 0xb3, 0x7c, 0x48,
|
0x8a, 0xd3, 0x9c, 0xfd, 0x0f, 0xf9, 0x30, 0x7c, 0xb6, 0x35, 0x8c, 0xe8, 0xdc, 0xf6, 0x2c, 0x9f,
|
||||||
0xbc, 0x07, 0xd7, 0xae, 0x0b, 0x86, 0x7e, 0x83, 0xb3, 0x8a, 0xa9, 0x41, 0x17, 0xb6, 0x6f, 0xf5,
|
0x14, 0xef, 0xc1, 0xb5, 0xeb, 0x82, 0xa1, 0xdf, 0xe0, 0xac, 0x62, 0x74, 0xd0, 0x85, 0xed, 0x5b,
|
||||||
0xa0, 0x7b, 0x4f, 0xf6, 0xda, 0x27, 0xd8, 0x65, 0xeb, 0xe7, 0x0b, 0xf9, 0x4b, 0xd7, 0x1f, 0x5a,
|
0x3d, 0xed, 0xde, 0x93, 0xbd, 0xf6, 0x09, 0x76, 0xd9, 0xfa, 0xf9, 0x42, 0xfe, 0xd7, 0xf5, 0x87,
|
||||||
0xbf, 0x72, 0x1b, 0xd7, 0x1f, 0x36, 0x9f, 0xbf, 0xde, 0x54, 0x8b, 0xdf, 0xfd, 0x1b, 0x00, 0x00,
|
0xd6, 0xff, 0xdc, 0xc6, 0xf5, 0x87, 0xcd, 0xe7, 0xaf, 0x37, 0xd5, 0xe2, 0x77, 0xff, 0x06, 0x00,
|
||||||
0xff, 0xff, 0xef, 0xac, 0x2e, 0x46, 0x2d, 0x0a, 0x00, 0x00,
|
0x00, 0xff, 0xff, 0xf0, 0x2f, 0x8a, 0x41, 0x32, 0x0a, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ message MultiTerminalLoginCheckResp{
|
|||||||
string errMsg = 2;
|
string errMsg = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
service relay {
|
service msgGateway {
|
||||||
rpc OnlinePushMsg(OnlinePushMsgReq) returns(OnlinePushMsgResp);
|
rpc OnlinePushMsg(OnlinePushMsgReq) returns(OnlinePushMsgResp);
|
||||||
rpc GetUsersOnlineStatus(GetUsersOnlineStatusReq) returns(GetUsersOnlineStatusResp);
|
rpc GetUsersOnlineStatus(GetUsersOnlineStatusReq) returns(GetUsersOnlineStatusResp);
|
||||||
rpc OnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp);
|
rpc OnlineBatchPushOneMsg(OnlineBatchPushOneMsgReq) returns(OnlineBatchPushOneMsgResp);
|
||||||
|
@ -1,265 +1,17 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
|
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
|
||||||
option go_package = "OpenIM/pkg/proto/rtc;rtc";
|
option go_package = "OpenIM/pkg/proto/rtc;rtc";
|
||||||
package proto;
|
package proto;
|
||||||
|
|
||||||
message CommonResp{
|
|
||||||
int32 errCode = 1;
|
|
||||||
string errMsg = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message MsgData {
|
|
||||||
string sendID = 1;
|
|
||||||
string recvID = 2;
|
|
||||||
string groupID = 3;
|
|
||||||
string clientMsgID = 4;
|
|
||||||
string serverMsgID = 5;
|
|
||||||
int32 senderPlatformID = 6;
|
|
||||||
string senderNickname = 7;
|
|
||||||
string senderFaceURL = 8;
|
|
||||||
int32 sessionType = 9;
|
|
||||||
int32 msgFrom = 10;
|
|
||||||
int32 contentType = 11;
|
|
||||||
bytes content = 12;
|
|
||||||
uint32 seq = 14;
|
|
||||||
int64 sendTime = 15;
|
|
||||||
int64 createTime = 16;
|
|
||||||
int32 status = 17;
|
|
||||||
map<string, bool> options = 18;
|
|
||||||
OfflinePushInfo offlinePushInfo = 19;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GroupInfo{
|
|
||||||
string groupID = 1;
|
|
||||||
string groupName = 2;
|
|
||||||
string notification = 3;
|
|
||||||
string introduction = 4;
|
|
||||||
string faceURL = 5;
|
|
||||||
string ownerUserID = 6;
|
|
||||||
uint32 createTime = 7;
|
|
||||||
uint32 memberCount = 8;
|
|
||||||
string ex = 9;
|
|
||||||
int32 status = 10;
|
|
||||||
string creatorUserID = 11;
|
|
||||||
int32 groupType = 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GroupMemberFullInfo {
|
|
||||||
string groupID = 1 ;
|
|
||||||
string userID = 2 ;
|
|
||||||
int32 roleLevel = 3;
|
|
||||||
int32 joinTime = 4;
|
|
||||||
string nickname = 5;
|
|
||||||
string faceURL = 6;
|
|
||||||
int32 appMangerLevel = 7; //if >0
|
|
||||||
int32 joinSource = 8;
|
|
||||||
string operatorUserID = 9;
|
|
||||||
string ex = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ParticipantMetaData{
|
|
||||||
GroupInfo groupInfo = 1;
|
|
||||||
GroupMemberFullInfo groupMemberInfo = 2;
|
|
||||||
PublicUserInfo userInfo = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message PublicUserInfo{
|
|
||||||
string userID = 1;
|
|
||||||
string nickname = 2;
|
|
||||||
string faceURL = 3;
|
|
||||||
int32 gender = 4;
|
|
||||||
string ex = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetJoinTokenReq{
|
|
||||||
string room = 1;
|
|
||||||
string identity = 2;
|
|
||||||
ParticipantMetaData metaData = 3;
|
|
||||||
string operationID = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetJoinTokenResp{
|
|
||||||
CommonResp CommonResp = 1;
|
|
||||||
string jwt = 2;
|
|
||||||
string liveURL = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OfflinePushInfo{
|
|
||||||
string title = 1;
|
|
||||||
string desc = 2;
|
|
||||||
string ex = 3;
|
|
||||||
string iOSPushSound = 4;
|
|
||||||
bool iOSBadgeCount = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalReq {
|
|
||||||
oneof payload {
|
|
||||||
SignalInviteReq invite = 1;
|
|
||||||
SignalInviteInGroupReq inviteInGroup= 2;
|
|
||||||
SignalCancelReq cancel = 3;
|
|
||||||
SignalAcceptReq accept = 4;
|
|
||||||
SignalHungUpReq hungUp = 5;
|
|
||||||
SignalRejectReq reject = 6;
|
|
||||||
SignalGetRoomByGroupIDReq getRoomByGroupID = 7;
|
|
||||||
|
|
||||||
SignalOnRoomParticipantConnectedReq onRoomParticipantConnectedReq = 8;
|
|
||||||
SignalOnRoomParticipantDisconnectedReq onRoomParticipantDisconnectedReq = 9;
|
|
||||||
SignalGetTokenByRoomIDReq getTokenByRoomID = 10;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalResp {
|
|
||||||
oneof payload {
|
|
||||||
SignalInviteReply invite = 1;
|
|
||||||
SignalInviteInGroupReply inviteInGroup= 2;
|
|
||||||
SignalCancelReply cancel = 3;
|
|
||||||
SignalAcceptReply accept = 4;
|
|
||||||
SignalHungUpReply hungUp = 5;
|
|
||||||
SignalRejectReply reject = 6;
|
|
||||||
SignalGetRoomByGroupIDReply getRoomByGroupID = 7;
|
|
||||||
SignalGetTokenByRoomIDReply getTokenByRoomID = 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
message InvitationInfo {
|
|
||||||
string inviterUserID = 1;
|
|
||||||
repeated string inviteeUserIDList = 2;
|
|
||||||
string customData = 3;
|
|
||||||
string groupID = 4;
|
|
||||||
string roomID = 5;
|
|
||||||
int32 timeout = 6;
|
|
||||||
string mediaType = 7;
|
|
||||||
int32 platformID = 8;
|
|
||||||
int32 sessionType = 9;
|
|
||||||
int32 initiateTime = 10;
|
|
||||||
repeated string busyLineUserIDList = 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message SignalInviteReq {
|
|
||||||
string opUserID = 1;
|
|
||||||
InvitationInfo invitation = 2;
|
|
||||||
OfflinePushInfo offlinePushInfo = 3;
|
|
||||||
ParticipantMetaData participant = 4;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalInviteReply {
|
|
||||||
string token = 1;
|
|
||||||
string roomID = 2;
|
|
||||||
string liveURL = 3;
|
|
||||||
repeated string busyLineUserIDList = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalInviteInGroupReq {
|
|
||||||
string opUserID = 1;
|
|
||||||
InvitationInfo invitation = 2;
|
|
||||||
OfflinePushInfo offlinePushInfo = 3;
|
|
||||||
ParticipantMetaData participant = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalInviteInGroupReply {
|
|
||||||
string token = 1;
|
|
||||||
string roomID = 2;
|
|
||||||
string liveURL = 3;
|
|
||||||
repeated string busyLineUserIDList = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalCancelReq {
|
|
||||||
string opUserID = 1;
|
|
||||||
InvitationInfo invitation = 2;
|
|
||||||
OfflinePushInfo offlinePushInfo = 3;
|
|
||||||
ParticipantMetaData participant = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalCancelReply {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalAcceptReq {
|
|
||||||
string opUserID = 1;
|
|
||||||
InvitationInfo invitation = 2;
|
|
||||||
OfflinePushInfo offlinePushInfo = 3;
|
|
||||||
ParticipantMetaData participant = 4;
|
|
||||||
int32 opUserPlatformID = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalAcceptReply {
|
|
||||||
string token = 1;
|
|
||||||
string roomID = 2;
|
|
||||||
string liveURL = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalHungUpReq {
|
|
||||||
string opUserID = 1;
|
|
||||||
InvitationInfo invitation = 2;
|
|
||||||
OfflinePushInfo offlinePushInfo = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalHungUpReply {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message SignalRejectReq {
|
|
||||||
string opUserID = 1;
|
|
||||||
InvitationInfo invitation = 2;
|
|
||||||
OfflinePushInfo offlinePushInfo = 3;
|
|
||||||
ParticipantMetaData participant = 4;
|
|
||||||
int32 opUserPlatformID = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalRejectReply {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalGetRoomByGroupIDReq {
|
|
||||||
string opUserID = 1;
|
|
||||||
string groupID = 2;
|
|
||||||
ParticipantMetaData participant = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalGetRoomByGroupIDReply {
|
|
||||||
InvitationInfo invitation = 1;
|
|
||||||
repeated ParticipantMetaData participant = 2;
|
|
||||||
string roomID = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalOnRoomParticipantConnectedReq {
|
|
||||||
InvitationInfo invitation = 1;
|
|
||||||
repeated ParticipantMetaData participant = 2;
|
|
||||||
string groupID = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalOnRoomParticipantDisconnectedReq {
|
|
||||||
InvitationInfo invitation = 1;
|
|
||||||
repeated ParticipantMetaData participant = 2;
|
|
||||||
string groupID = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalGetTokenByRoomIDReq {
|
|
||||||
string roomID = 1;
|
|
||||||
string opUserID = 2;
|
|
||||||
ParticipantMetaData participant = 3;
|
|
||||||
string operationID = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SignalGetTokenByRoomIDReply {
|
|
||||||
string token = 1;
|
|
||||||
string liveURL = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message SignalMessageAssembleReq {
|
message SignalMessageAssembleReq {
|
||||||
SignalReq signalReq = 1;
|
sdkws.SignalReq signalReq = 1;
|
||||||
string operationID = 2;
|
string operationID = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SignalMessageAssembleResp {
|
message SignalMessageAssembleResp {
|
||||||
CommonResp commonResp = 1;
|
bool isPass = 1;
|
||||||
bool isPass = 2;
|
SignalResp signalResp = 2;
|
||||||
SignalResp signalResp = 3;
|
MsgData msgData = 3;
|
||||||
MsgData msgData = 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message SignalGetRoomsReq {
|
message SignalGetRoomsReq {
|
||||||
@ -268,8 +20,7 @@ message SignalGetRoomsReq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message SignalGetRoomsResp {
|
message SignalGetRoomsResp {
|
||||||
CommonResp commonResp = 1;
|
repeated SignalGetRoomByGroupIDReply rooms = 1;
|
||||||
repeated SignalGetRoomByGroupIDReply roomList = 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
service RtcService {
|
service RtcService {
|
||||||
|
@ -1,369 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
|
|
||||||
import "Open-IM-Server/pkg/proto/sdkws/wrappers.proto";
|
|
||||||
option go_package = "OpenIM/pkg/proto/group;group";
|
|
||||||
package group;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message CreateGroupReq{
|
|
||||||
repeated string initMembers = 1;
|
|
||||||
sdkws.GroupInfo groupInfo = 2;
|
|
||||||
repeated string adminUserIDs = 3;
|
|
||||||
string ownerUserID = 4; //owner
|
|
||||||
}
|
|
||||||
message CreateGroupResp{
|
|
||||||
sdkws.GroupInfo groupInfo = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GetGroupsInfoReq{
|
|
||||||
repeated string groupIDs = 1;
|
|
||||||
}
|
|
||||||
message GetGroupsInfoResp{
|
|
||||||
repeated sdkws.GroupInfo groupInfos = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message SetGroupInfoReq{
|
|
||||||
sdkws.GroupInfoForSet groupInfoForSet = 1;
|
|
||||||
}
|
|
||||||
message SetGroupInfoResp{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GetGroupApplicationListReq {
|
|
||||||
sdkws.RequestPagination pagination = 1;
|
|
||||||
string fromUserID = 2; //owner or admin
|
|
||||||
}
|
|
||||||
message GetGroupApplicationListResp {
|
|
||||||
uint32 total = 1;
|
|
||||||
repeated sdkws.GroupRequest groupRequests = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetUserReqApplicationListReq{
|
|
||||||
sdkws.RequestPagination pagination = 1;
|
|
||||||
string userID = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetUserReqApplicationListResp{
|
|
||||||
uint32 total = 1;
|
|
||||||
repeated sdkws.GroupRequest groupRequests = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message TransferGroupOwnerReq {
|
|
||||||
string groupID = 1;
|
|
||||||
string oldOwnerUserID = 2;
|
|
||||||
string newOwnerUserID = 3;
|
|
||||||
}
|
|
||||||
message TransferGroupOwnerResp{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message JoinGroupReq{
|
|
||||||
string groupID = 1;
|
|
||||||
string reqMessage = 2;
|
|
||||||
int32 joinSource = 3;
|
|
||||||
string inviterUserID = 4;
|
|
||||||
}
|
|
||||||
message JoinGroupResp{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GroupApplicationResponseReq{
|
|
||||||
string groupID = 1;
|
|
||||||
string fromUserID = 2; //
|
|
||||||
string handledMsg = 3;
|
|
||||||
int32 handleResult = 4;
|
|
||||||
}
|
|
||||||
message GroupApplicationResponseResp{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message QuitGroupReq{
|
|
||||||
string groupID = 1;
|
|
||||||
}
|
|
||||||
message QuitGroupResp{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GetGroupMemberListReq {
|
|
||||||
sdkws.RequestPagination pagination = 1;
|
|
||||||
string groupID = 2;
|
|
||||||
int32 filter = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMemberListResp {
|
|
||||||
uint32 total = 1;
|
|
||||||
repeated sdkws.GroupMemberFullInfo members = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GetGroupMembersInfoReq {
|
|
||||||
string groupID = 1;
|
|
||||||
repeated string members = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMembersInfoResp {
|
|
||||||
repeated sdkws.GroupMemberFullInfo members = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message KickGroupMemberReq {
|
|
||||||
string groupID = 1;
|
|
||||||
repeated string kickedUserIDs = 2;
|
|
||||||
string reason = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message KickGroupMemberResp {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GetJoinedGroupListReq {
|
|
||||||
sdkws.RequestPagination pagination = 1;
|
|
||||||
string fromUserID = 2;
|
|
||||||
}
|
|
||||||
message GetJoinedGroupListResp{
|
|
||||||
uint32 total = 1;
|
|
||||||
repeated sdkws.GroupInfo groups = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message InviteUserToGroupReq {
|
|
||||||
string groupID = 1;
|
|
||||||
string reason = 2;
|
|
||||||
repeated string invitedUserIDs = 3;
|
|
||||||
}
|
|
||||||
message InviteUserToGroupResp {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GetGroupAllMemberReq {
|
|
||||||
sdkws.RequestPagination pagination = 1;
|
|
||||||
string groupID = 2;
|
|
||||||
}
|
|
||||||
message GetGroupAllMemberResp {
|
|
||||||
repeated sdkws.GroupMemberFullInfo members = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message CMSGroup {
|
|
||||||
sdkws.GroupInfo groupInfo = 1;
|
|
||||||
string groupOwnerUserName = 2;
|
|
||||||
string groupOwnerUserID = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message GetGroupsReq {
|
|
||||||
sdkws.RequestPagination pagination = 1;
|
|
||||||
string groupName = 2;
|
|
||||||
string groupID = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupsResp {
|
|
||||||
uint32 total = 1;
|
|
||||||
repeated CMSGroup groups = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMemberReq {
|
|
||||||
string groupID = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMembersCMSReq {
|
|
||||||
sdkws.RequestPagination pagination = 1;
|
|
||||||
string groupID = 2;
|
|
||||||
string userName = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMembersCMSResp {
|
|
||||||
uint32 total = 1;
|
|
||||||
repeated sdkws.GroupMemberFullInfo members = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DismissGroupReq{
|
|
||||||
string groupID = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DismissGroupResp{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message MuteGroupMemberReq{
|
|
||||||
string groupID = 1;
|
|
||||||
string userID = 2;
|
|
||||||
uint32 mutedSeconds = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message MuteGroupMemberResp{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message CancelMuteGroupMemberReq{
|
|
||||||
string groupID = 1;
|
|
||||||
string userID = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message CancelMuteGroupMemberResp{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message MuteGroupReq{
|
|
||||||
string groupID = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message MuteGroupResp{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message CancelMuteGroupReq{
|
|
||||||
string groupID = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message CancelMuteGroupResp{
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetJoinedSuperGroupListReq {
|
|
||||||
string userID = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetJoinedSuperGroupListResp {
|
|
||||||
repeated sdkws.GroupInfo groups = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetSuperGroupsInfoReq {
|
|
||||||
repeated string groupIDs = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetSuperGroupsInfoResp {
|
|
||||||
repeated sdkws.GroupInfo groupInfos = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SetGroupMemberInfo{
|
|
||||||
string groupID = 1;
|
|
||||||
string userID = 2;
|
|
||||||
google.protobuf.StringValue nickname = 3;
|
|
||||||
google.protobuf.StringValue faceURL = 4;
|
|
||||||
google.protobuf.Int32Value roleLevel = 5;
|
|
||||||
google.protobuf.StringValue ex = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SetGroupMemberInfoReq{
|
|
||||||
repeated SetGroupMemberInfo members = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SetGroupMemberInfoResp{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupAbstractInfoReq{
|
|
||||||
repeated string groupIDs = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GroupAbstractInfo{
|
|
||||||
string groupID = 1;
|
|
||||||
uint32 groupMemberNumber = 2;
|
|
||||||
uint64 groupMemberListHash = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupAbstractInfoResp{
|
|
||||||
repeated GroupAbstractInfo groupAbstractInfos = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetUserInGroupMembersReq {
|
|
||||||
string userID = 1;
|
|
||||||
repeated string groupIDs = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetUserInGroupMembersResp{
|
|
||||||
repeated sdkws.GroupMemberFullInfo members = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMemberUserIDReq{
|
|
||||||
string groupID = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMemberUserIDResp{
|
|
||||||
repeated string userIDs = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMemberRoleLevelReq{
|
|
||||||
string groupID = 1;
|
|
||||||
repeated string roleLevel = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message GetGroupMemberRoleLevelResp {
|
|
||||||
repeated sdkws.GroupMemberFullInfo members = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
service group{
|
|
||||||
//创建群
|
|
||||||
rpc createGroup(CreateGroupReq) returns(CreateGroupResp);
|
|
||||||
//申请加群
|
|
||||||
rpc joinGroup(JoinGroupReq) returns(JoinGroupResp);
|
|
||||||
//退出群
|
|
||||||
rpc quitGroup(QuitGroupReq) returns(QuitGroupResp);
|
|
||||||
//获取指定群信息
|
|
||||||
rpc getGroupsInfo(GetGroupsInfoReq) returns(GetGroupsInfoResp);
|
|
||||||
//设置群信息
|
|
||||||
rpc setGroupInfo(SetGroupInfoReq) returns(SetGroupInfoResp);
|
|
||||||
//(以管理员或群主身份)获取群的加群申请
|
|
||||||
rpc getGroupApplicationList(GetGroupApplicationListReq) returns(GetGroupApplicationListResp);
|
|
||||||
//获取用户自己的主动加群申请
|
|
||||||
rpc getUserReqApplicationList(GetUserReqApplicationListReq) returns(GetUserReqApplicationListResp);
|
|
||||||
//转让群主
|
|
||||||
rpc transferGroupOwner(TransferGroupOwnerReq) returns(TransferGroupOwnerResp);
|
|
||||||
//群主或管理员处理进群申请
|
|
||||||
rpc groupApplicationResponse(GroupApplicationResponseReq) returns(GroupApplicationResponseResp);
|
|
||||||
//获取某个群的群成员
|
|
||||||
rpc getGroupMemberList(GetGroupMemberListReq) returns(GetGroupMemberListResp);
|
|
||||||
//获取某个群的指定群成员
|
|
||||||
rpc getGroupMembersInfo(GetGroupMembersInfoReq) returns(GetGroupMembersInfoResp);
|
|
||||||
//踢出群
|
|
||||||
rpc kickGroupMember(KickGroupMemberReq) returns (KickGroupMemberResp);
|
|
||||||
//获取某个人已加入群
|
|
||||||
rpc getJoinedGroupList(GetJoinedGroupListReq) returns (GetJoinedGroupListResp);
|
|
||||||
//邀请某些人进群
|
|
||||||
rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp);
|
|
||||||
|
|
||||||
rpc getGroups(GetGroupsReq) returns(GetGroupsResp);
|
|
||||||
rpc getGroupMembersCMS(GetGroupMembersCMSReq) returns(GetGroupMembersCMSResp);
|
|
||||||
|
|
||||||
//解散群
|
|
||||||
rpc dismissGroup(DismissGroupReq) returns(DismissGroupResp);
|
|
||||||
//对某个群成员禁言
|
|
||||||
rpc muteGroupMember(MuteGroupMemberReq) returns(MuteGroupMemberResp);
|
|
||||||
//对某个群成员取消禁言
|
|
||||||
rpc cancelMuteGroupMember(CancelMuteGroupMemberReq) returns(CancelMuteGroupMemberResp);
|
|
||||||
//对某个群禁言
|
|
||||||
rpc muteGroup(MuteGroupReq) returns(MuteGroupResp);
|
|
||||||
//对某个群取消禁言
|
|
||||||
rpc cancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp);
|
|
||||||
|
|
||||||
//获取某个用户加入的超级群
|
|
||||||
rpc getJoinedSuperGroupList(GetJoinedSuperGroupListReq) returns (GetJoinedSuperGroupListResp);
|
|
||||||
//获取指定的超级群信息
|
|
||||||
rpc getSuperGroupsInfo(GetSuperGroupsInfoReq) returns (GetSuperGroupsInfoResp);
|
|
||||||
//设置群成员昵称
|
|
||||||
//设置群成员信息
|
|
||||||
rpc setGroupMemberInfo(SetGroupMemberInfoReq) returns (SetGroupMemberInfoResp);
|
|
||||||
//获取群信息hash值
|
|
||||||
rpc getGroupAbstractInfo(GetGroupAbstractInfoReq) returns (GetGroupAbstractInfoResp);
|
|
||||||
//获取某个用户在指定群中的信息
|
|
||||||
rpc getUserInGroupMembers(GetUserInGroupMembersReq) returns (GetUserInGroupMembersResp);
|
|
||||||
//获取群成员用户ID
|
|
||||||
rpc getGroupMemberUserID(GetGroupMemberUserIDReq) returns (GetGroupMemberUserIDResp);
|
|
||||||
//查询群组中对应级别的成员
|
|
||||||
rpc GetGroupMemberRoleLevel(GetGroupMemberRoleLevelReq)returns (GetGroupMemberRoleLevelResp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -39,7 +39,7 @@ func (m *ApplySpaceReq) Reset() { *m = ApplySpaceReq{} }
|
|||||||
func (m *ApplySpaceReq) String() string { return proto.CompactTextString(m) }
|
func (m *ApplySpaceReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*ApplySpaceReq) ProtoMessage() {}
|
func (*ApplySpaceReq) ProtoMessage() {}
|
||||||
func (*ApplySpaceReq) Descriptor() ([]byte, []int) {
|
func (*ApplySpaceReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{0}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{0}
|
||||||
}
|
}
|
||||||
func (m *ApplySpaceReq) XXX_Unmarshal(b []byte) error {
|
func (m *ApplySpaceReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_ApplySpaceReq.Unmarshal(m, b)
|
return xxx_messageInfo_ApplySpaceReq.Unmarshal(m, b)
|
||||||
@ -108,7 +108,7 @@ func (m *ApplySpaceResp) Reset() { *m = ApplySpaceResp{} }
|
|||||||
func (m *ApplySpaceResp) String() string { return proto.CompactTextString(m) }
|
func (m *ApplySpaceResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*ApplySpaceResp) ProtoMessage() {}
|
func (*ApplySpaceResp) ProtoMessage() {}
|
||||||
func (*ApplySpaceResp) Descriptor() ([]byte, []int) {
|
func (*ApplySpaceResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{1}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{1}
|
||||||
}
|
}
|
||||||
func (m *ApplySpaceResp) XXX_Unmarshal(b []byte) error {
|
func (m *ApplySpaceResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_ApplySpaceResp.Unmarshal(m, b)
|
return xxx_messageInfo_ApplySpaceResp.Unmarshal(m, b)
|
||||||
@ -167,7 +167,7 @@ func (m *ConfirmSpaceReq) Reset() { *m = ConfirmSpaceReq{} }
|
|||||||
func (m *ConfirmSpaceReq) String() string { return proto.CompactTextString(m) }
|
func (m *ConfirmSpaceReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*ConfirmSpaceReq) ProtoMessage() {}
|
func (*ConfirmSpaceReq) ProtoMessage() {}
|
||||||
func (*ConfirmSpaceReq) Descriptor() ([]byte, []int) {
|
func (*ConfirmSpaceReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{2}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{2}
|
||||||
}
|
}
|
||||||
func (m *ConfirmSpaceReq) XXX_Unmarshal(b []byte) error {
|
func (m *ConfirmSpaceReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_ConfirmSpaceReq.Unmarshal(m, b)
|
return xxx_messageInfo_ConfirmSpaceReq.Unmarshal(m, b)
|
||||||
@ -205,7 +205,7 @@ func (m *ConfirmSpaceResp) Reset() { *m = ConfirmSpaceResp{} }
|
|||||||
func (m *ConfirmSpaceResp) String() string { return proto.CompactTextString(m) }
|
func (m *ConfirmSpaceResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*ConfirmSpaceResp) ProtoMessage() {}
|
func (*ConfirmSpaceResp) ProtoMessage() {}
|
||||||
func (*ConfirmSpaceResp) Descriptor() ([]byte, []int) {
|
func (*ConfirmSpaceResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{3}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{3}
|
||||||
}
|
}
|
||||||
func (m *ConfirmSpaceResp) XXX_Unmarshal(b []byte) error {
|
func (m *ConfirmSpaceResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_ConfirmSpaceResp.Unmarshal(m, b)
|
return xxx_messageInfo_ConfirmSpaceResp.Unmarshal(m, b)
|
||||||
@ -232,45 +232,45 @@ func (m *ConfirmSpaceResp) GetConfirmID() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetRTCInvitationInfoReq struct {
|
type GetSignalInvitationInfoReq struct {
|
||||||
ClientMsgID string `protobuf:"bytes,1,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"`
|
ClientMsgID string `protobuf:"bytes,1,opt,name=ClientMsgID" json:"ClientMsgID,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoReq) Reset() { *m = GetRTCInvitationInfoReq{} }
|
func (m *GetSignalInvitationInfoReq) Reset() { *m = GetSignalInvitationInfoReq{} }
|
||||||
func (m *GetRTCInvitationInfoReq) String() string { return proto.CompactTextString(m) }
|
func (m *GetSignalInvitationInfoReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetRTCInvitationInfoReq) ProtoMessage() {}
|
func (*GetSignalInvitationInfoReq) ProtoMessage() {}
|
||||||
func (*GetRTCInvitationInfoReq) Descriptor() ([]byte, []int) {
|
func (*GetSignalInvitationInfoReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{4}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{4}
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoReq) XXX_Unmarshal(b []byte) error {
|
func (m *GetSignalInvitationInfoReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoReq.Unmarshal(m, b)
|
return xxx_messageInfo_GetSignalInvitationInfoReq.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *GetSignalInvitationInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoReq.Marshal(b, m, deterministic)
|
return xxx_messageInfo_GetSignalInvitationInfoReq.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (dst *GetRTCInvitationInfoReq) XXX_Merge(src proto.Message) {
|
func (dst *GetSignalInvitationInfoReq) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_GetRTCInvitationInfoReq.Merge(dst, src)
|
xxx_messageInfo_GetSignalInvitationInfoReq.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoReq) XXX_Size() int {
|
func (m *GetSignalInvitationInfoReq) XXX_Size() int {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoReq.Size(m)
|
return xxx_messageInfo_GetSignalInvitationInfoReq.Size(m)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoReq) XXX_DiscardUnknown() {
|
func (m *GetSignalInvitationInfoReq) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_GetRTCInvitationInfoReq.DiscardUnknown(m)
|
xxx_messageInfo_GetSignalInvitationInfoReq.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_GetRTCInvitationInfoReq proto.InternalMessageInfo
|
var xxx_messageInfo_GetSignalInvitationInfoReq proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoReq) GetClientMsgID() string {
|
func (m *GetSignalInvitationInfoReq) GetClientMsgID() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.ClientMsgID
|
return m.ClientMsgID
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetRTCInvitationInfoResp struct {
|
type GetSignalInvitationInfoResp struct {
|
||||||
InvitationInfo *sdkws.InvitationInfo `protobuf:"bytes,1,opt,name=invitationInfo" json:"invitationInfo,omitempty"`
|
InvitationInfo *sdkws.InvitationInfo `protobuf:"bytes,1,opt,name=invitationInfo" json:"invitationInfo,omitempty"`
|
||||||
OfflinePushInfo *sdkws.OfflinePushInfo `protobuf:"bytes,2,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"`
|
OfflinePushInfo *sdkws.OfflinePushInfo `protobuf:"bytes,2,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
@ -278,83 +278,83 @@ type GetRTCInvitationInfoResp struct {
|
|||||||
XXX_sizecache int32 `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoResp) Reset() { *m = GetRTCInvitationInfoResp{} }
|
func (m *GetSignalInvitationInfoResp) Reset() { *m = GetSignalInvitationInfoResp{} }
|
||||||
func (m *GetRTCInvitationInfoResp) String() string { return proto.CompactTextString(m) }
|
func (m *GetSignalInvitationInfoResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetRTCInvitationInfoResp) ProtoMessage() {}
|
func (*GetSignalInvitationInfoResp) ProtoMessage() {}
|
||||||
func (*GetRTCInvitationInfoResp) Descriptor() ([]byte, []int) {
|
func (*GetSignalInvitationInfoResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{5}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{5}
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoResp) XXX_Unmarshal(b []byte) error {
|
func (m *GetSignalInvitationInfoResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoResp.Unmarshal(m, b)
|
return xxx_messageInfo_GetSignalInvitationInfoResp.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *GetSignalInvitationInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoResp.Marshal(b, m, deterministic)
|
return xxx_messageInfo_GetSignalInvitationInfoResp.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (dst *GetRTCInvitationInfoResp) XXX_Merge(src proto.Message) {
|
func (dst *GetSignalInvitationInfoResp) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_GetRTCInvitationInfoResp.Merge(dst, src)
|
xxx_messageInfo_GetSignalInvitationInfoResp.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoResp) XXX_Size() int {
|
func (m *GetSignalInvitationInfoResp) XXX_Size() int {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoResp.Size(m)
|
return xxx_messageInfo_GetSignalInvitationInfoResp.Size(m)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoResp) XXX_DiscardUnknown() {
|
func (m *GetSignalInvitationInfoResp) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_GetRTCInvitationInfoResp.DiscardUnknown(m)
|
xxx_messageInfo_GetSignalInvitationInfoResp.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_GetRTCInvitationInfoResp proto.InternalMessageInfo
|
var xxx_messageInfo_GetSignalInvitationInfoResp proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoResp) GetInvitationInfo() *sdkws.InvitationInfo {
|
func (m *GetSignalInvitationInfoResp) GetInvitationInfo() *sdkws.InvitationInfo {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.InvitationInfo
|
return m.InvitationInfo
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoResp) GetOfflinePushInfo() *sdkws.OfflinePushInfo {
|
func (m *GetSignalInvitationInfoResp) GetOfflinePushInfo() *sdkws.OfflinePushInfo {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.OfflinePushInfo
|
return m.OfflinePushInfo
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetRTCInvitationInfoStartAppReq struct {
|
type GetSignalInvitationInfoStartAppReq struct {
|
||||||
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
|
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoStartAppReq) Reset() { *m = GetRTCInvitationInfoStartAppReq{} }
|
func (m *GetSignalInvitationInfoStartAppReq) Reset() { *m = GetSignalInvitationInfoStartAppReq{} }
|
||||||
func (m *GetRTCInvitationInfoStartAppReq) String() string { return proto.CompactTextString(m) }
|
func (m *GetSignalInvitationInfoStartAppReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetRTCInvitationInfoStartAppReq) ProtoMessage() {}
|
func (*GetSignalInvitationInfoStartAppReq) ProtoMessage() {}
|
||||||
func (*GetRTCInvitationInfoStartAppReq) Descriptor() ([]byte, []int) {
|
func (*GetSignalInvitationInfoStartAppReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{6}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{6}
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoStartAppReq) XXX_Unmarshal(b []byte) error {
|
func (m *GetSignalInvitationInfoStartAppReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoStartAppReq.Unmarshal(m, b)
|
return xxx_messageInfo_GetSignalInvitationInfoStartAppReq.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoStartAppReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *GetSignalInvitationInfoStartAppReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoStartAppReq.Marshal(b, m, deterministic)
|
return xxx_messageInfo_GetSignalInvitationInfoStartAppReq.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (dst *GetRTCInvitationInfoStartAppReq) XXX_Merge(src proto.Message) {
|
func (dst *GetSignalInvitationInfoStartAppReq) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_GetRTCInvitationInfoStartAppReq.Merge(dst, src)
|
xxx_messageInfo_GetSignalInvitationInfoStartAppReq.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoStartAppReq) XXX_Size() int {
|
func (m *GetSignalInvitationInfoStartAppReq) XXX_Size() int {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoStartAppReq.Size(m)
|
return xxx_messageInfo_GetSignalInvitationInfoStartAppReq.Size(m)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoStartAppReq) XXX_DiscardUnknown() {
|
func (m *GetSignalInvitationInfoStartAppReq) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_GetRTCInvitationInfoStartAppReq.DiscardUnknown(m)
|
xxx_messageInfo_GetSignalInvitationInfoStartAppReq.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_GetRTCInvitationInfoStartAppReq proto.InternalMessageInfo
|
var xxx_messageInfo_GetSignalInvitationInfoStartAppReq proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoStartAppReq) GetUserID() string {
|
func (m *GetSignalInvitationInfoStartAppReq) GetUserID() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.UserID
|
return m.UserID
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetRTCInvitationInfoStartAppResp struct {
|
type GetSignalInvitationInfoStartAppResp struct {
|
||||||
InvitationInfo *sdkws.InvitationInfo `protobuf:"bytes,1,opt,name=invitationInfo" json:"invitationInfo,omitempty"`
|
InvitationInfo *sdkws.InvitationInfo `protobuf:"bytes,1,opt,name=invitationInfo" json:"invitationInfo,omitempty"`
|
||||||
OfflinePushInfo *sdkws.OfflinePushInfo `protobuf:"bytes,2,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"`
|
OfflinePushInfo *sdkws.OfflinePushInfo `protobuf:"bytes,2,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
@ -362,38 +362,38 @@ type GetRTCInvitationInfoStartAppResp struct {
|
|||||||
XXX_sizecache int32 `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoStartAppResp) Reset() { *m = GetRTCInvitationInfoStartAppResp{} }
|
func (m *GetSignalInvitationInfoStartAppResp) Reset() { *m = GetSignalInvitationInfoStartAppResp{} }
|
||||||
func (m *GetRTCInvitationInfoStartAppResp) String() string { return proto.CompactTextString(m) }
|
func (m *GetSignalInvitationInfoStartAppResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetRTCInvitationInfoStartAppResp) ProtoMessage() {}
|
func (*GetSignalInvitationInfoStartAppResp) ProtoMessage() {}
|
||||||
func (*GetRTCInvitationInfoStartAppResp) Descriptor() ([]byte, []int) {
|
func (*GetSignalInvitationInfoStartAppResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{7}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{7}
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoStartAppResp) XXX_Unmarshal(b []byte) error {
|
func (m *GetSignalInvitationInfoStartAppResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoStartAppResp.Unmarshal(m, b)
|
return xxx_messageInfo_GetSignalInvitationInfoStartAppResp.Unmarshal(m, b)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoStartAppResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *GetSignalInvitationInfoStartAppResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoStartAppResp.Marshal(b, m, deterministic)
|
return xxx_messageInfo_GetSignalInvitationInfoStartAppResp.Marshal(b, m, deterministic)
|
||||||
}
|
}
|
||||||
func (dst *GetRTCInvitationInfoStartAppResp) XXX_Merge(src proto.Message) {
|
func (dst *GetSignalInvitationInfoStartAppResp) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_GetRTCInvitationInfoStartAppResp.Merge(dst, src)
|
xxx_messageInfo_GetSignalInvitationInfoStartAppResp.Merge(dst, src)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoStartAppResp) XXX_Size() int {
|
func (m *GetSignalInvitationInfoStartAppResp) XXX_Size() int {
|
||||||
return xxx_messageInfo_GetRTCInvitationInfoStartAppResp.Size(m)
|
return xxx_messageInfo_GetSignalInvitationInfoStartAppResp.Size(m)
|
||||||
}
|
}
|
||||||
func (m *GetRTCInvitationInfoStartAppResp) XXX_DiscardUnknown() {
|
func (m *GetSignalInvitationInfoStartAppResp) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_GetRTCInvitationInfoStartAppResp.DiscardUnknown(m)
|
xxx_messageInfo_GetSignalInvitationInfoStartAppResp.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_GetRTCInvitationInfoStartAppResp proto.InternalMessageInfo
|
var xxx_messageInfo_GetSignalInvitationInfoStartAppResp proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoStartAppResp) GetInvitationInfo() *sdkws.InvitationInfo {
|
func (m *GetSignalInvitationInfoStartAppResp) GetInvitationInfo() *sdkws.InvitationInfo {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.InvitationInfo
|
return m.InvitationInfo
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *GetRTCInvitationInfoStartAppResp) GetOfflinePushInfo() *sdkws.OfflinePushInfo {
|
func (m *GetSignalInvitationInfoStartAppResp) GetOfflinePushInfo() *sdkws.OfflinePushInfo {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.OfflinePushInfo
|
return m.OfflinePushInfo
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ func (m *FcmUpdateTokenReq) Reset() { *m = FcmUpdateTokenReq{} }
|
|||||||
func (m *FcmUpdateTokenReq) String() string { return proto.CompactTextString(m) }
|
func (m *FcmUpdateTokenReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*FcmUpdateTokenReq) ProtoMessage() {}
|
func (*FcmUpdateTokenReq) ProtoMessage() {}
|
||||||
func (*FcmUpdateTokenReq) Descriptor() ([]byte, []int) {
|
func (*FcmUpdateTokenReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{8}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{8}
|
||||||
}
|
}
|
||||||
func (m *FcmUpdateTokenReq) XXX_Unmarshal(b []byte) error {
|
func (m *FcmUpdateTokenReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_FcmUpdateTokenReq.Unmarshal(m, b)
|
return xxx_messageInfo_FcmUpdateTokenReq.Unmarshal(m, b)
|
||||||
@ -456,7 +456,7 @@ func (m *FcmUpdateTokenResp) Reset() { *m = FcmUpdateTokenResp{} }
|
|||||||
func (m *FcmUpdateTokenResp) String() string { return proto.CompactTextString(m) }
|
func (m *FcmUpdateTokenResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*FcmUpdateTokenResp) ProtoMessage() {}
|
func (*FcmUpdateTokenResp) ProtoMessage() {}
|
||||||
func (*FcmUpdateTokenResp) Descriptor() ([]byte, []int) {
|
func (*FcmUpdateTokenResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{9}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{9}
|
||||||
}
|
}
|
||||||
func (m *FcmUpdateTokenResp) XXX_Unmarshal(b []byte) error {
|
func (m *FcmUpdateTokenResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_FcmUpdateTokenResp.Unmarshal(m, b)
|
return xxx_messageInfo_FcmUpdateTokenResp.Unmarshal(m, b)
|
||||||
@ -488,7 +488,7 @@ func (m *SetAppBadgeReq) Reset() { *m = SetAppBadgeReq{} }
|
|||||||
func (m *SetAppBadgeReq) String() string { return proto.CompactTextString(m) }
|
func (m *SetAppBadgeReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SetAppBadgeReq) ProtoMessage() {}
|
func (*SetAppBadgeReq) ProtoMessage() {}
|
||||||
func (*SetAppBadgeReq) Descriptor() ([]byte, []int) {
|
func (*SetAppBadgeReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{10}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{10}
|
||||||
}
|
}
|
||||||
func (m *SetAppBadgeReq) XXX_Unmarshal(b []byte) error {
|
func (m *SetAppBadgeReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_SetAppBadgeReq.Unmarshal(m, b)
|
return xxx_messageInfo_SetAppBadgeReq.Unmarshal(m, b)
|
||||||
@ -532,7 +532,7 @@ func (m *SetAppBadgeResp) Reset() { *m = SetAppBadgeResp{} }
|
|||||||
func (m *SetAppBadgeResp) String() string { return proto.CompactTextString(m) }
|
func (m *SetAppBadgeResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SetAppBadgeResp) ProtoMessage() {}
|
func (*SetAppBadgeResp) ProtoMessage() {}
|
||||||
func (*SetAppBadgeResp) Descriptor() ([]byte, []int) {
|
func (*SetAppBadgeResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_third_7f0ad743baded49b, []int{11}
|
return fileDescriptor_third_3f9746cdadff77e4, []int{11}
|
||||||
}
|
}
|
||||||
func (m *SetAppBadgeResp) XXX_Unmarshal(b []byte) error {
|
func (m *SetAppBadgeResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_SetAppBadgeResp.Unmarshal(m, b)
|
return xxx_messageInfo_SetAppBadgeResp.Unmarshal(m, b)
|
||||||
@ -557,10 +557,10 @@ func init() {
|
|||||||
proto.RegisterType((*ApplySpaceResp)(nil), "third.ApplySpaceResp")
|
proto.RegisterType((*ApplySpaceResp)(nil), "third.ApplySpaceResp")
|
||||||
proto.RegisterType((*ConfirmSpaceReq)(nil), "third.ConfirmSpaceReq")
|
proto.RegisterType((*ConfirmSpaceReq)(nil), "third.ConfirmSpaceReq")
|
||||||
proto.RegisterType((*ConfirmSpaceResp)(nil), "third.ConfirmSpaceResp")
|
proto.RegisterType((*ConfirmSpaceResp)(nil), "third.ConfirmSpaceResp")
|
||||||
proto.RegisterType((*GetRTCInvitationInfoReq)(nil), "third.GetRTCInvitationInfoReq")
|
proto.RegisterType((*GetSignalInvitationInfoReq)(nil), "third.GetSignalInvitationInfoReq")
|
||||||
proto.RegisterType((*GetRTCInvitationInfoResp)(nil), "third.GetRTCInvitationInfoResp")
|
proto.RegisterType((*GetSignalInvitationInfoResp)(nil), "third.GetSignalInvitationInfoResp")
|
||||||
proto.RegisterType((*GetRTCInvitationInfoStartAppReq)(nil), "third.GetRTCInvitationInfoStartAppReq")
|
proto.RegisterType((*GetSignalInvitationInfoStartAppReq)(nil), "third.GetSignalInvitationInfoStartAppReq")
|
||||||
proto.RegisterType((*GetRTCInvitationInfoStartAppResp)(nil), "third.GetRTCInvitationInfoStartAppResp")
|
proto.RegisterType((*GetSignalInvitationInfoStartAppResp)(nil), "third.GetSignalInvitationInfoStartAppResp")
|
||||||
proto.RegisterType((*FcmUpdateTokenReq)(nil), "third.FcmUpdateTokenReq")
|
proto.RegisterType((*FcmUpdateTokenReq)(nil), "third.FcmUpdateTokenReq")
|
||||||
proto.RegisterType((*FcmUpdateTokenResp)(nil), "third.FcmUpdateTokenResp")
|
proto.RegisterType((*FcmUpdateTokenResp)(nil), "third.FcmUpdateTokenResp")
|
||||||
proto.RegisterType((*SetAppBadgeReq)(nil), "third.SetAppBadgeReq")
|
proto.RegisterType((*SetAppBadgeReq)(nil), "third.SetAppBadgeReq")
|
||||||
@ -579,8 +579,8 @@ const _ = grpc.SupportPackageIsVersion4
|
|||||||
|
|
||||||
type ThirdClient interface {
|
type ThirdClient interface {
|
||||||
ApplySpace(ctx context.Context, in *ApplySpaceReq, opts ...grpc.CallOption) (*ApplySpaceResp, error)
|
ApplySpace(ctx context.Context, in *ApplySpaceReq, opts ...grpc.CallOption) (*ApplySpaceResp, error)
|
||||||
GetRTCInvitationInfo(ctx context.Context, in *GetRTCInvitationInfoReq, opts ...grpc.CallOption) (*GetRTCInvitationInfoResp, error)
|
GetSignalInvitationInfo(ctx context.Context, in *GetSignalInvitationInfoReq, opts ...grpc.CallOption) (*GetSignalInvitationInfoResp, error)
|
||||||
GetRTCInvitationInfoStartApp(ctx context.Context, in *GetRTCInvitationInfoStartAppReq, opts ...grpc.CallOption) (*GetRTCInvitationInfoStartAppResp, error)
|
GetSignalInvitationInfoStartApp(ctx context.Context, in *GetSignalInvitationInfoStartAppReq, opts ...grpc.CallOption) (*GetSignalInvitationInfoStartAppResp, error)
|
||||||
FcmUpdateToken(ctx context.Context, in *FcmUpdateTokenReq, opts ...grpc.CallOption) (*FcmUpdateTokenResp, error)
|
FcmUpdateToken(ctx context.Context, in *FcmUpdateTokenReq, opts ...grpc.CallOption) (*FcmUpdateTokenResp, error)
|
||||||
SetAppBadge(ctx context.Context, in *SetAppBadgeReq, opts ...grpc.CallOption) (*SetAppBadgeResp, error)
|
SetAppBadge(ctx context.Context, in *SetAppBadgeReq, opts ...grpc.CallOption) (*SetAppBadgeResp, error)
|
||||||
}
|
}
|
||||||
@ -602,18 +602,18 @@ func (c *thirdClient) ApplySpace(ctx context.Context, in *ApplySpaceReq, opts ..
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *thirdClient) GetRTCInvitationInfo(ctx context.Context, in *GetRTCInvitationInfoReq, opts ...grpc.CallOption) (*GetRTCInvitationInfoResp, error) {
|
func (c *thirdClient) GetSignalInvitationInfo(ctx context.Context, in *GetSignalInvitationInfoReq, opts ...grpc.CallOption) (*GetSignalInvitationInfoResp, error) {
|
||||||
out := new(GetRTCInvitationInfoResp)
|
out := new(GetSignalInvitationInfoResp)
|
||||||
err := grpc.Invoke(ctx, "/third.third/GetRTCInvitationInfo", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/third.third/GetSignalInvitationInfo", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *thirdClient) GetRTCInvitationInfoStartApp(ctx context.Context, in *GetRTCInvitationInfoStartAppReq, opts ...grpc.CallOption) (*GetRTCInvitationInfoStartAppResp, error) {
|
func (c *thirdClient) GetSignalInvitationInfoStartApp(ctx context.Context, in *GetSignalInvitationInfoStartAppReq, opts ...grpc.CallOption) (*GetSignalInvitationInfoStartAppResp, error) {
|
||||||
out := new(GetRTCInvitationInfoStartAppResp)
|
out := new(GetSignalInvitationInfoStartAppResp)
|
||||||
err := grpc.Invoke(ctx, "/third.third/GetRTCInvitationInfoStartApp", in, out, c.cc, opts...)
|
err := grpc.Invoke(ctx, "/third.third/GetSignalInvitationInfoStartApp", in, out, c.cc, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -642,8 +642,8 @@ func (c *thirdClient) SetAppBadge(ctx context.Context, in *SetAppBadgeReq, opts
|
|||||||
|
|
||||||
type ThirdServer interface {
|
type ThirdServer interface {
|
||||||
ApplySpace(context.Context, *ApplySpaceReq) (*ApplySpaceResp, error)
|
ApplySpace(context.Context, *ApplySpaceReq) (*ApplySpaceResp, error)
|
||||||
GetRTCInvitationInfo(context.Context, *GetRTCInvitationInfoReq) (*GetRTCInvitationInfoResp, error)
|
GetSignalInvitationInfo(context.Context, *GetSignalInvitationInfoReq) (*GetSignalInvitationInfoResp, error)
|
||||||
GetRTCInvitationInfoStartApp(context.Context, *GetRTCInvitationInfoStartAppReq) (*GetRTCInvitationInfoStartAppResp, error)
|
GetSignalInvitationInfoStartApp(context.Context, *GetSignalInvitationInfoStartAppReq) (*GetSignalInvitationInfoStartAppResp, error)
|
||||||
FcmUpdateToken(context.Context, *FcmUpdateTokenReq) (*FcmUpdateTokenResp, error)
|
FcmUpdateToken(context.Context, *FcmUpdateTokenReq) (*FcmUpdateTokenResp, error)
|
||||||
SetAppBadge(context.Context, *SetAppBadgeReq) (*SetAppBadgeResp, error)
|
SetAppBadge(context.Context, *SetAppBadgeReq) (*SetAppBadgeResp, error)
|
||||||
}
|
}
|
||||||
@ -670,38 +670,38 @@ func _Third_ApplySpace_Handler(srv interface{}, ctx context.Context, dec func(in
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Third_GetRTCInvitationInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Third_GetSignalInvitationInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetRTCInvitationInfoReq)
|
in := new(GetSignalInvitationInfoReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(ThirdServer).GetRTCInvitationInfo(ctx, in)
|
return srv.(ThirdServer).GetSignalInvitationInfo(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/third.third/GetRTCInvitationInfo",
|
FullMethod: "/third.third/GetSignalInvitationInfo",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(ThirdServer).GetRTCInvitationInfo(ctx, req.(*GetRTCInvitationInfoReq))
|
return srv.(ThirdServer).GetSignalInvitationInfo(ctx, req.(*GetSignalInvitationInfoReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Third_GetRTCInvitationInfoStartApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Third_GetSignalInvitationInfoStartApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetRTCInvitationInfoStartAppReq)
|
in := new(GetSignalInvitationInfoStartAppReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(ThirdServer).GetRTCInvitationInfoStartApp(ctx, in)
|
return srv.(ThirdServer).GetSignalInvitationInfoStartApp(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/third.third/GetRTCInvitationInfoStartApp",
|
FullMethod: "/third.third/GetSignalInvitationInfoStartApp",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(ThirdServer).GetRTCInvitationInfoStartApp(ctx, req.(*GetRTCInvitationInfoStartAppReq))
|
return srv.(ThirdServer).GetSignalInvitationInfoStartApp(ctx, req.(*GetSignalInvitationInfoStartAppReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
@ -751,12 +751,12 @@ var _Third_serviceDesc = grpc.ServiceDesc{
|
|||||||
Handler: _Third_ApplySpace_Handler,
|
Handler: _Third_ApplySpace_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetRTCInvitationInfo",
|
MethodName: "GetSignalInvitationInfo",
|
||||||
Handler: _Third_GetRTCInvitationInfo_Handler,
|
Handler: _Third_GetSignalInvitationInfo_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetRTCInvitationInfoStartApp",
|
MethodName: "GetSignalInvitationInfoStartApp",
|
||||||
Handler: _Third_GetRTCInvitationInfoStartApp_Handler,
|
Handler: _Third_GetSignalInvitationInfoStartApp_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "FcmUpdateToken",
|
MethodName: "FcmUpdateToken",
|
||||||
@ -771,45 +771,46 @@ var _Third_serviceDesc = grpc.ServiceDesc{
|
|||||||
Metadata: "third/third.proto",
|
Metadata: "third/third.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("third/third.proto", fileDescriptor_third_7f0ad743baded49b) }
|
func init() { proto.RegisterFile("third/third.proto", fileDescriptor_third_3f9746cdadff77e4) }
|
||||||
|
|
||||||
var fileDescriptor_third_7f0ad743baded49b = []byte{
|
var fileDescriptor_third_3f9746cdadff77e4 = []byte{
|
||||||
// 588 bytes of a gzipped FileDescriptorProto
|
// 594 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x41, 0x4f, 0xdb, 0x30,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xc1, 0x6e, 0xd3, 0x4c,
|
||||||
0x14, 0x56, 0x08, 0x65, 0xeb, 0xab, 0x28, 0x60, 0x01, 0xcb, 0x22, 0x04, 0x51, 0x0e, 0xc0, 0x85,
|
0x10, 0x96, 0xeb, 0xa6, 0xff, 0x9f, 0x89, 0x9a, 0xb6, 0xab, 0xb6, 0x18, 0x53, 0x15, 0x63, 0x24,
|
||||||
0x66, 0x62, 0x27, 0xc4, 0x26, 0x0d, 0xba, 0x75, 0xaa, 0xa6, 0x0a, 0x94, 0xb6, 0xda, 0xb4, 0x5b,
|
0x28, 0x48, 0x8d, 0x51, 0x39, 0x21, 0x0a, 0xa2, 0x2d, 0x04, 0x45, 0x28, 0x6a, 0xe5, 0x34, 0x12,
|
||||||
0xd6, 0x3a, 0x6d, 0xd4, 0xc6, 0x7e, 0xb3, 0x1d, 0x10, 0xfb, 0x03, 0x3b, 0xef, 0xbc, 0xe3, 0xfe,
|
0xe2, 0x84, 0x49, 0xd6, 0x89, 0x15, 0x7b, 0x77, 0xd8, 0x5d, 0xb7, 0x94, 0x17, 0xe0, 0x2d, 0xb8,
|
||||||
0xe8, 0x14, 0xb7, 0x94, 0x24, 0x0b, 0xdd, 0x8e, 0xbb, 0x58, 0x7e, 0x9f, 0xbf, 0xef, 0xf9, 0x3d,
|
0x20, 0xf1, 0x9c, 0xc8, 0x9b, 0x34, 0xb5, 0x4d, 0x42, 0x38, 0x72, 0xb1, 0x66, 0xbe, 0xfd, 0xbe,
|
||||||
0xbf, 0xe7, 0x07, 0x5b, 0x6a, 0x1c, 0x89, 0xa1, 0xa7, 0xd7, 0x06, 0x0a, 0xae, 0x38, 0xa9, 0x68,
|
0xd9, 0x99, 0x9d, 0xf1, 0xc0, 0x86, 0x1a, 0x46, 0xa2, 0xef, 0xe9, 0x6f, 0x03, 0x05, 0x57, 0x9c,
|
||||||
0xc3, 0x3e, 0xba, 0x42, 0xca, 0x4e, 0xda, 0x9d, 0x93, 0x2e, 0x15, 0x37, 0x54, 0x78, 0x38, 0x19,
|
0x54, 0xb4, 0x63, 0x3f, 0x3c, 0x45, 0xca, 0xf6, 0x5b, 0xed, 0xfd, 0x0e, 0x15, 0x17, 0x54, 0x78,
|
||||||
0x79, 0x9a, 0xe0, 0xc9, 0xe1, 0xe4, 0x56, 0x7a, 0xb7, 0x72, 0xc6, 0x77, 0xbf, 0x1b, 0xb0, 0x7e,
|
0x38, 0x1a, 0x78, 0x9a, 0xe0, 0xc9, 0xfe, 0xe8, 0x52, 0x7a, 0x97, 0x72, 0xcc, 0x77, 0xbf, 0x19,
|
||||||
0x81, 0x38, 0xbd, 0xeb, 0x62, 0x30, 0xa0, 0x3e, 0xfd, 0x4a, 0x08, 0xac, 0xb2, 0x20, 0xa6, 0x96,
|
0xb0, 0x7a, 0x84, 0x18, 0x5f, 0x75, 0x30, 0xe8, 0x51, 0x9f, 0x7e, 0x26, 0x04, 0x96, 0x59, 0x90,
|
||||||
0xe1, 0x18, 0xc7, 0x55, 0x5f, 0xef, 0x53, 0x4c, 0x46, 0xdf, 0xa8, 0xb5, 0xe2, 0x18, 0xc7, 0xa6,
|
0x50, 0xcb, 0x70, 0x8c, 0xbd, 0xaa, 0xaf, 0xed, 0x0c, 0x93, 0xd1, 0x57, 0x6a, 0x2d, 0x39, 0xc6,
|
||||||
0xaf, 0xf7, 0x29, 0x36, 0x0e, 0xe4, 0xd8, 0x32, 0x67, 0xbc, 0x74, 0x4f, 0x2c, 0x78, 0x82, 0x89,
|
0x9e, 0xe9, 0x6b, 0x3b, 0xc3, 0x86, 0x81, 0x1c, 0x5a, 0xe6, 0x98, 0x97, 0xd9, 0xc4, 0x82, 0xff,
|
||||||
0x40, 0x2e, 0xa9, 0xb5, 0xea, 0x18, 0xc7, 0xeb, 0xfe, 0xbd, 0x49, 0x1c, 0xa8, 0x0d, 0x38, 0x53,
|
0x30, 0x15, 0xc8, 0x25, 0xb5, 0x96, 0x1d, 0x63, 0x6f, 0xd5, 0xbf, 0x76, 0x89, 0x03, 0xb5, 0x1e,
|
||||||
0x94, 0xa9, 0xde, 0x1d, 0x52, 0xab, 0xa2, 0x45, 0x59, 0xc8, 0x0d, 0xa1, 0x9e, 0x0d, 0x44, 0x22,
|
0x67, 0x8a, 0x32, 0x75, 0x7e, 0x85, 0xd4, 0xaa, 0x68, 0x51, 0x1e, 0x72, 0x43, 0xa8, 0xe7, 0x13,
|
||||||
0xd9, 0x04, 0x33, 0x11, 0xd3, 0x79, 0x20, 0xe9, 0xb6, 0x34, 0x8e, 0x4d, 0x30, 0x31, 0x51, 0x96,
|
0x91, 0x48, 0xd6, 0xc1, 0x4c, 0x45, 0x3c, 0x49, 0x24, 0x33, 0x67, 0xe6, 0xb1, 0x0e, 0x26, 0xa6,
|
||||||
0xe9, 0x98, 0x29, 0x0b, 0x13, 0x45, 0xf6, 0xa0, 0x3a, 0xe0, 0x2c, 0x8c, 0x44, 0xdc, 0x7e, 0xab,
|
0xca, 0x32, 0x1d, 0x33, 0x63, 0x61, 0xaa, 0xc8, 0x0e, 0x54, 0x7b, 0x9c, 0x85, 0x91, 0x48, 0x5a,
|
||||||
0xe3, 0xa8, 0xfa, 0x0f, 0x80, 0xeb, 0xc1, 0x46, 0x73, 0x66, 0x2c, 0x52, 0xce, 0x09, 0x8c, 0xa2,
|
0xaf, 0x75, 0x1e, 0x55, 0xff, 0x06, 0x70, 0x3d, 0x58, 0x3b, 0x19, 0x3b, 0xd3, 0x92, 0x0b, 0x02,
|
||||||
0xe0, 0x05, 0x6c, 0xe6, 0x05, 0x12, 0xff, 0xa2, 0x38, 0x87, 0x67, 0xef, 0xa9, 0xf2, 0x7b, 0xcd,
|
0xa3, 0x2c, 0x78, 0x02, 0xeb, 0x45, 0x81, 0xc4, 0x05, 0x8a, 0x97, 0x60, 0xbf, 0xa5, 0xaa, 0x13,
|
||||||
0x36, 0xbb, 0x89, 0x54, 0xa0, 0x22, 0xce, 0xda, 0x2c, 0xe4, 0xe9, 0x55, 0x0e, 0xd4, 0x9a, 0xd3,
|
0x0d, 0x58, 0x10, 0xb7, 0xd8, 0x45, 0xa4, 0x02, 0x15, 0x71, 0xd6, 0x62, 0x21, 0xcf, 0x6e, 0x73,
|
||||||
0x88, 0x32, 0xd5, 0x91, 0xa3, 0x85, 0x34, 0x0b, 0xb9, 0x3f, 0x0d, 0xb0, 0xca, 0xd5, 0x12, 0xc9,
|
0xa0, 0x76, 0x12, 0x47, 0x94, 0xa9, 0xb6, 0x1c, 0x4c, 0xd5, 0x79, 0xc8, 0xfd, 0x6e, 0xc0, 0x9d,
|
||||||
0x6b, 0xa8, 0x47, 0x39, 0x54, 0x7b, 0xa8, 0x9d, 0xee, 0x34, 0x74, 0x5d, 0x1b, 0x05, 0x49, 0x81,
|
0xb9, 0x01, 0x24, 0x92, 0x17, 0x50, 0x8f, 0x0a, 0xa8, 0x0e, 0x52, 0x3b, 0xd8, 0x6a, 0xe8, 0xee,
|
||||||
0x4c, 0xde, 0xc0, 0x06, 0x0f, 0xc3, 0x69, 0xc4, 0xe8, 0x75, 0x22, 0xc7, 0x5a, 0xbf, 0xa2, 0xf5,
|
0x36, 0x4a, 0x92, 0x12, 0x99, 0xbc, 0x82, 0x35, 0x1e, 0x86, 0x71, 0xc4, 0xe8, 0x59, 0x2a, 0x87,
|
||||||
0xbb, 0x73, 0xfd, 0x55, 0xfe, 0xd4, 0x2f, 0xd2, 0xdd, 0x33, 0x38, 0x28, 0x0b, 0xae, 0xab, 0x02,
|
0x5a, 0xbf, 0xa4, 0xf5, 0xdb, 0x13, 0xfd, 0x69, 0xf1, 0xd4, 0x2f, 0xd3, 0xdd, 0x43, 0x70, 0xe7,
|
||||||
0xa1, 0x2e, 0x10, 0xd3, 0x14, 0x77, 0x61, 0x2d, 0x91, 0x54, 0x2c, 0xb2, 0x9b, 0x5b, 0xee, 0x2f,
|
0xe4, 0xd7, 0x51, 0x81, 0x50, 0x47, 0x88, 0x59, 0xa1, 0xdb, 0xb0, 0x92, 0x4a, 0x2a, 0xa6, 0x35,
|
||||||
0x03, 0x9c, 0xe5, 0xda, 0xff, 0x21, 0xc1, 0x0f, 0xb0, 0xd5, 0x1a, 0xc4, 0x7d, 0x1c, 0x06, 0x8a,
|
0x4e, 0x3c, 0xf7, 0xa7, 0x01, 0xf7, 0x17, 0xca, 0xff, 0x85, 0x32, 0xdf, 0xc1, 0x46, 0xb3, 0x97,
|
||||||
0xf6, 0xf8, 0x84, 0xb2, 0x34, 0x25, 0x1b, 0x9e, 0x5e, 0x4f, 0x03, 0x15, 0x72, 0x11, 0xeb, 0x78,
|
0x74, 0xb1, 0x1f, 0x28, 0x7a, 0xce, 0x47, 0x94, 0x65, 0x55, 0xd9, 0xf0, 0xff, 0x59, 0x1c, 0xa8,
|
||||||
0x2a, 0xfe, 0xc2, 0x4e, 0xcf, 0x5a, 0x83, 0x58, 0x53, 0xf5, 0x5d, 0x55, 0x7f, 0x61, 0xbb, 0xdb,
|
0x90, 0x8b, 0x44, 0xe7, 0x53, 0xf1, 0xa7, 0x7e, 0x76, 0xd6, 0xec, 0x25, 0x9a, 0xaa, 0xef, 0xaa,
|
||||||
0x40, 0x8a, 0xce, 0x24, 0xba, 0x9f, 0xa0, 0xde, 0xa5, 0x69, 0xc6, 0x97, 0xc1, 0x70, 0xa4, 0x1b,
|
0xfa, 0x53, 0xdf, 0xdd, 0x04, 0x52, 0x0e, 0x26, 0xd1, 0x7d, 0x0f, 0xf5, 0x0e, 0xcd, 0x2a, 0x3e,
|
||||||
0x70, 0x1f, 0xa0, 0x25, 0x78, 0xdc, 0xcf, 0x3e, 0x5b, 0x06, 0x21, 0x87, 0xfa, 0x6f, 0xf4, 0x99,
|
0x0e, 0xfa, 0x03, 0x3d, 0x8c, 0xbb, 0x00, 0x4d, 0xc1, 0x93, 0x6e, 0xfe, 0xe5, 0x72, 0x08, 0x79,
|
||||||
0xa0, 0xc1, 0xb0, 0xc9, 0x13, 0xa6, 0xf4, 0x4d, 0x15, 0xbf, 0x80, 0xba, 0x5b, 0xb0, 0x91, 0xf3,
|
0xa0, 0xff, 0x93, 0x2e, 0x13, 0x34, 0xe8, 0x9f, 0xf0, 0x94, 0x29, 0x7d, 0x53, 0xc5, 0x2f, 0xa1,
|
||||||
0x2c, 0xf1, 0xf4, 0x87, 0x09, 0xb3, 0x99, 0x40, 0xce, 0x00, 0x1e, 0x3e, 0x18, 0xd9, 0x6e, 0xcc,
|
0xee, 0x06, 0xac, 0x15, 0x22, 0x4b, 0x3c, 0xf8, 0x61, 0xc2, 0x78, 0x3f, 0x90, 0x67, 0x00, 0x37,
|
||||||
0xc6, 0x46, 0xee, 0xf3, 0xdb, 0x3b, 0x25, 0xa8, 0x44, 0xf2, 0x11, 0xb6, 0xcb, 0x2a, 0x47, 0xf6,
|
0x3f, 0x1b, 0xd9, 0x6c, 0x8c, 0x57, 0x48, 0x61, 0x11, 0xd8, 0x5b, 0x33, 0x50, 0x89, 0xe4, 0x23,
|
||||||
0xe7, 0xf4, 0x47, 0xba, 0xdd, 0x3e, 0x58, 0x7a, 0x2e, 0x91, 0x70, 0xd8, 0x5b, 0xd6, 0x12, 0xe4,
|
0xdc, 0x9a, 0xd3, 0x3c, 0x72, 0x6f, 0xa2, 0x98, 0x3f, 0xfc, 0xb6, 0xbb, 0x88, 0x22, 0x91, 0x7c,
|
||||||
0x70, 0x89, 0x83, 0x4c, 0xcf, 0xd9, 0x47, 0xff, 0xc4, 0x93, 0x48, 0xde, 0x41, 0x3d, 0x5f, 0x11,
|
0x81, 0xbb, 0x0b, 0xc6, 0x83, 0x3c, 0xfa, 0x73, 0x98, 0xdc, 0x14, 0xda, 0x8f, 0xff, 0x96, 0x2a,
|
||||||
0x62, 0xcd, 0xa5, 0x7f, 0x54, 0xdd, 0x7e, 0xfe, 0xc8, 0x89, 0x44, 0xf2, 0x0a, 0x6a, 0x99, 0x87,
|
0x91, 0xbc, 0x81, 0x7a, 0xb1, 0x47, 0xc4, 0x9a, 0xa8, 0x7f, 0x9b, 0x03, 0xfb, 0xf6, 0x9c, 0x13,
|
||||||
0x26, 0xf7, 0xcf, 0x96, 0x2f, 0xab, 0xbd, 0x5b, 0x06, 0x4b, 0xbc, 0xdc, 0xff, 0xbc, 0x97, 0xce,
|
0x89, 0xe4, 0x10, 0x6a, 0xb9, 0xa7, 0x27, 0xd7, 0x0f, 0x59, 0x6c, 0xb4, 0xbd, 0x3d, 0x0b, 0x96,
|
||||||
0xe7, 0x76, 0x27, 0x33, 0x97, 0x35, 0xf3, 0x5c, 0xaf, 0x5f, 0xd6, 0x34, 0xf4, 0xf2, 0x77, 0x00,
|
0x78, 0xbc, 0xfb, 0x61, 0x27, 0xdb, 0xde, 0xad, 0x76, 0x6e, 0x6b, 0x6b, 0xe6, 0x73, 0xfd, 0xfd,
|
||||||
0x00, 0x00, 0xff, 0xff, 0x85, 0xa6, 0x11, 0xd8, 0xe0, 0x05, 0x00, 0x00,
|
0xb4, 0xa2, 0xa1, 0xa7, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xf0, 0xfa, 0xf7, 0xfe, 0x05,
|
||||||
|
0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
@ -27,35 +27,37 @@ message ConfirmSpaceResp {
|
|||||||
string confirmID = 1;
|
string confirmID = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetRTCInvitationInfoReq {
|
message GetSignalInvitationInfoReq {
|
||||||
string ClientMsgID = 1;
|
string ClientMsgID = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetRTCInvitationInfoResp {
|
message GetSignalInvitationInfoResp {
|
||||||
sdkws.InvitationInfo invitationInfo = 1;
|
sdkws.InvitationInfo invitationInfo = 1;
|
||||||
sdkws.OfflinePushInfo offlinePushInfo = 2;
|
sdkws.OfflinePushInfo offlinePushInfo = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetRTCInvitationInfoStartAppReq {
|
message GetSignalInvitationInfoStartAppReq {
|
||||||
string userID = 1;
|
string userID = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetRTCInvitationInfoStartAppResp {
|
message GetSignalInvitationInfoStartAppResp {
|
||||||
sdkws.InvitationInfo invitationInfo = 1;
|
sdkws.InvitationInfo invitationInfo = 1;
|
||||||
sdkws.OfflinePushInfo offlinePushInfo = 2;
|
sdkws.OfflinePushInfo offlinePushInfo = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message FcmUpdateTokenReq {
|
message FcmUpdateTokenReq {
|
||||||
int32 Platform = 1;
|
int32 PlatformID = 1;
|
||||||
string FcmToken = 2;
|
string FcmToken = 2;
|
||||||
|
string account = 3;
|
||||||
|
int64 expireTime = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message FcmUpdateTokenResp {
|
message FcmUpdateTokenResp {
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetAppBadgeReq {
|
message SetAppBadgeReq {
|
||||||
string FromUserID = 1;
|
string userID = 1;
|
||||||
int32 AppUnreadCount = 2;
|
int AppUnreadCount = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetAppBadgeResp {
|
message SetAppBadgeResp {
|
||||||
@ -63,8 +65,8 @@ message SetAppBadgeResp {
|
|||||||
|
|
||||||
service third {
|
service third {
|
||||||
rpc ApplySpace(ApplySpaceReq) returns(ApplySpaceResp);
|
rpc ApplySpace(ApplySpaceReq) returns(ApplySpaceResp);
|
||||||
rpc GetRTCInvitationInfo(GetRTCInvitationInfoReq) returns(GetRTCInvitationInfoResp);
|
rpc GetSignalInvitationInfo(GetSignalInvitationInfoReq) returns(GetSignalInvitationInfoResp);
|
||||||
rpc GetRTCInvitationInfoStartApp(GetRTCInvitationInfoStartAppReq) returns(GetRTCInvitationInfoStartAppResp);
|
rpc GetSignalInvitationInfoStartApp(GetSignalInvitationInfoStartAppReq) returns(GetSignalInvitationInfoStartAppResp);
|
||||||
rpc FcmUpdateToken(FcmUpdateTokenReq) returns(FcmUpdateTokenResp);
|
rpc FcmUpdateToken(FcmUpdateTokenReq) returns(FcmUpdateTokenResp);
|
||||||
rpc SetAppBadge(SetAppBadgeReq) returns(SetAppBadgeResp);
|
rpc SetAppBadge(SetAppBadgeReq) returns(SetAppBadgeResp);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user