This commit is contained in:
wangchuxiao
2023-02-09 20:36:34 +08:00
parent 8a1702fcf7
commit 759432794f
216 changed files with 2299 additions and 4059 deletions
-21
View File
@@ -1,21 +0,0 @@
package apistruct
type SetClientInitConfigReq struct {
OperationID string `json:"operationID" binding:"required"`
DiscoverPageURL *string `json:"discoverPageURL"`
}
type SetClientInitConfigResp struct {
CommResp
}
type GetClientInitConfigReq struct {
OperationID string `json:"operationID" binding:"required"`
}
type GetClientInitConfigResp struct {
CommResp
Data struct {
DiscoverPageURL string `json:"discoverPageURL"`
} `json:"data"`
}
-5
View File
@@ -4,8 +4,3 @@ type RequestPagination struct {
PageNumber int `json:"pageNumber" binding:"required"`
ShowNumber int `json:"showNumber" binding:"required"`
}
type ResponsePagination struct {
CurrentPage int `json:"currentPage"`
ShowNumber int `json:"showNumber"`
}
+1 -1
View File
@@ -1,7 +1,7 @@
package apistruct
import (
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
open_im_sdk "Open_IM/pkg/proto/sdkws"
)
type CommResp struct {
+8 -8
View File
@@ -2,7 +2,7 @@ package apistruct
import (
pbRelay "Open_IM/pkg/proto/relay"
server_api_params "Open_IM/pkg/proto/sdk_ws"
sdkws "Open_IM/pkg/proto/sdkws"
)
type DeleteUsersReq struct {
@@ -46,12 +46,12 @@ type ManagementSendMsg struct {
SenderFaceURL string `json:"senderFaceURL" `
SenderPlatformID int32 `json:"senderPlatformID"`
//ForceList []string `json:"forceList" `
Content map[string]interface{} `json:"content" binding:"required" swaggerignore:"true"`
ContentType int32 `json:"contentType" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
IsOnlineOnly bool `json:"isOnlineOnly"`
NotOfflinePush bool `json:"notOfflinePush"`
OfflinePushInfo *server_api_params.OfflinePushInfo `json:"offlinePushInfo"`
Content map[string]interface{} `json:"content" binding:"required" swaggerignore:"true"`
ContentType int32 `json:"contentType" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
IsOnlineOnly bool `json:"isOnlineOnly"`
NotOfflinePush bool `json:"notOfflinePush"`
OfflinePushInfo *sdkws.OfflinePushInfo `json:"offlinePushInfo"`
}
type ManagementSendMsgReq struct {
@@ -61,7 +61,7 @@ type ManagementSendMsgReq struct {
type ManagementSendMsgResp struct {
CommResp
ResultList server_api_params.UserSendMsgResp `json:"data"`
ResultList sdkws.UserSendMsgResp `json:"data"`
}
type ManagementBatchSendMsgReq struct {
+32 -32
View File
@@ -2,7 +2,7 @@ package apistruct
import (
"Open_IM/pkg/proto/msg"
sdk_ws "Open_IM/pkg/proto/sdk_ws"
sdkws "Open_IM/pkg/proto/sdkws"
)
type DelMsgReq struct {
@@ -54,16 +54,16 @@ type SetMsgMinSeqResp struct {
}
type ModifyMessageReactionExtensionsReq struct {
OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
ReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
Ex *string `json:"ex"`
AttachedInfo *string `json:"attachedInfo"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
ReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
Ex *string `json:"ex"`
AttachedInfo *string `json:"attachedInfo"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type ModifyMessageReactionExtensionsResp struct {
@@ -106,13 +106,13 @@ type AddMessageReactionExtensionsReq ModifyMessageReactionExtensionsReq
type AddMessageReactionExtensionsResp ModifyMessageReactionExtensionsResp
type DeleteMessageReactionExtensionsReq struct {
OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime" binding:"required"`
ReactionExtensionList []*sdk_ws.KeyValue `json:"reactionExtensionList" binding:"required"`
OperationID string `json:"operationID" binding:"required"`
SourceID string `json:"sourceID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime" binding:"required"`
ReactionExtensionList []*sdkws.KeyValue `json:"reactionExtensionList" binding:"required"`
}
type DeleteMessageReactionExtensionsResp struct {
@@ -121,21 +121,21 @@ type DeleteMessageReactionExtensionsResp struct {
}
type ReactionMessageModifierNotification struct {
SourceID string `json:"sourceID" binding:"required"`
OpUserID string `json:"opUserID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
SuccessReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
SourceID string `json:"sourceID" binding:"required"`
OpUserID string `json:"opUserID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
SuccessReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type ReactionMessageDeleteNotification struct {
SourceID string `json:"sourceID" binding:"required"`
OpUserID string `json:"opUserID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
SuccessReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
SourceID string `json:"sourceID" binding:"required"`
OpUserID string `json:"opUserID" binding:"required"`
SessionType int32 `json:"sessionType" binding:"required"`
SuccessReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList,omitempty" binding:"required"`
ClientMsgID string `json:"clientMsgID" binding:"required"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
-121
View File
@@ -1,121 +0,0 @@
package apistruct
import open_im_sdk "Open_IM/pkg/proto/sdk_ws"
type CreateDepartmentReq struct {
*open_im_sdk.Department
OperationID string `json:"operationID" binding:"required"`
}
type CreateDepartmentResp struct {
CommResp
Department *open_im_sdk.Department `json:"-"`
Data map[string]interface{} `json:"data" swaggerignore:"true"`
}
type UpdateDepartmentReq struct {
*open_im_sdk.Department
DepartmentID string `json:"departmentID" binding:"required"`
OperationID string `json:"operationID" binding:"required"`
}
type UpdateDepartmentResp struct {
CommResp
}
type GetSubDepartmentReq struct {
OperationID string `json:"operationID" binding:"required"`
DepartmentID string `json:"departmentID" binding:"required"`
}
type GetSubDepartmentResp struct {
CommResp
DepartmentList []*open_im_sdk.Department `json:"-"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type DeleteDepartmentReq struct {
OperationID string `json:"operationID" binding:"required"`
DepartmentID string `json:"departmentID" binding:"required"`
}
type DeleteDepartmentResp struct {
CommResp
}
type CreateOrganizationUserReq struct {
OperationID string `json:"operationID" binding:"required"`
*open_im_sdk.OrganizationUser
}
type CreateOrganizationUserResp struct {
CommResp
}
type UpdateOrganizationUserReq struct {
OperationID string `json:"operationID" binding:"required"`
*open_im_sdk.OrganizationUser
}
type UpdateOrganizationUserResp struct {
CommResp
}
type CreateDepartmentMemberReq struct {
OperationID string `json:"operationID" binding:"required"`
*open_im_sdk.DepartmentMember
}
type CreateDepartmentMemberResp struct {
CommResp
}
type GetUserInDepartmentReq struct {
UserID string `json:"userID" binding:"required"`
OperationID string `json:"operationID" binding:"required"`
}
type GetUserInDepartmentResp struct {
CommResp
UserInDepartment *open_im_sdk.UserInDepartment `json:"-"`
Data map[string]interface{} `json:"data" swaggerignore:"true"`
}
type UpdateUserInDepartmentReq struct {
OperationID string `json:"operationID" binding:"required"`
*open_im_sdk.DepartmentMember
}
type UpdateUserInDepartmentResp struct {
CommResp
}
type DeleteOrganizationUserReq struct {
UserID string `json:"userID" binding:"required"`
OperationID string `json:"operationID" binding:"required"`
}
type DeleteOrganizationUserResp struct {
CommResp
}
type GetDepartmentMemberReq struct {
DepartmentID string `json:"departmentID" binding:"required"`
OperationID string `json:"operationID" binding:"required"`
}
type GetDepartmentMemberResp struct {
CommResp
UserInDepartmentList []*open_im_sdk.UserDepartmentMember `json:"-"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
type DeleteUserInDepartmentReq struct {
DepartmentID string `json:"departmentID" binding:"required"`
UserID string `json:"userID" binding:"required"`
OperationID string `json:"operationID" binding:"required"`
}
type DeleteUserInDepartmentResp struct {
CommResp
}
type GetUserInOrganizationReq struct {
OperationID string `json:"operationID" binding:"required"`
UserIDList []string `json:"userIDList" binding:"required"`
}
type GetUserInOrganizationResp struct {
CommResp
OrganizationUserList []*open_im_sdk.OrganizationUser `json:"-"`
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
}
-12
View File
@@ -1,11 +1,5 @@
package apistruct
import (
"net/http"
"github.com/gin-gonic/gin"
)
type ApiUserInfo struct {
UserID string `json:"userID" binding:"required,min=1,max=64" swaggo:"true,用户ID,"`
Nickname string `json:"nickname" binding:"omitempty,min=1,max=64" swaggo:"true,my id,19"`
@@ -22,9 +16,3 @@ type GroupAddMemberInfo struct {
UserID string `json:"userID" binding:"required"`
RoleLevel int32 `json:"roleLevel" binding:"required,oneof= 1 3"`
}
func SetErrCodeMsg(c *gin.Context, status int) *CommResp {
resp := CommResp{ErrCode: int32(status), ErrMsg: http.StatusText(status)}
c.JSON(status, resp)
return &resp
}
-11
View File
@@ -1,11 +0,0 @@
package apistruct
type Swagger400Resp struct {
ErrCode int32 `json:"errCode" example:"400"`
ErrMsg string `json:"errMsg" example:"err msg"`
}
type Swagger500Resp struct {
ErrCode int32 `json:"errCode" example:"500"`
ErrMsg string `json:"errMsg" example:"err msg"`
}
+1 -1
View File
@@ -1,7 +1,7 @@
package apistruct
import (
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
open_im_sdk "Open_IM/pkg/proto/sdkws"
)
type GetUsersInfoReq struct {
+1 -1
View File
@@ -2,7 +2,7 @@ package callbackstruct
import (
"Open_IM/pkg/proto/group"
common "Open_IM/pkg/proto/sdk_ws"
common "Open_IM/pkg/proto/sdkws"
)
type CallbackBeforeCreateGroupReq struct {
+38 -38
View File
@@ -2,7 +2,7 @@ package callbackstruct
import (
"Open_IM/pkg/proto/msg"
sdk_ws "Open_IM/pkg/proto/sdk_ws"
sdkws "Open_IM/pkg/proto/sdkws"
)
type CallbackBeforeSendSingleMsgReq struct {
@@ -47,36 +47,36 @@ type CallbackMsgModifyCommandReq struct {
type CallbackMsgModifyCommandResp struct {
*CommonCallbackResp
Content *string `json:"content"`
RecvID *string `json:"recvID"`
GroupID *string `json:"groupID"`
ClientMsgID *string `json:"clientMsgID"`
ServerMsgID *string `json:"serverMsgID"`
SenderPlatformID *int32 `json:"senderPlatformID"`
SenderNickname *string `json:"senderNickname"`
SenderFaceURL *string `json:"senderFaceURL"`
SessionType *int32 `json:"sessionType"`
MsgFrom *int32 `json:"msgFrom"`
ContentType *int32 `json:"contentType"`
Status *int32 `json:"status"`
Options *map[string]bool `json:"options"`
OfflinePushInfo *sdk_ws.OfflinePushInfo `json:"offlinePushInfo"`
AtUserIDList *[]string `json:"atUserIDList"`
MsgDataList *[]byte `json:"msgDataList"`
AttachedInfo *string `json:"attachedInfo"`
Ex *string `json:"ex"`
Content *string `json:"content"`
RecvID *string `json:"recvID"`
GroupID *string `json:"groupID"`
ClientMsgID *string `json:"clientMsgID"`
ServerMsgID *string `json:"serverMsgID"`
SenderPlatformID *int32 `json:"senderPlatformID"`
SenderNickname *string `json:"senderNickname"`
SenderFaceURL *string `json:"senderFaceURL"`
SessionType *int32 `json:"sessionType"`
MsgFrom *int32 `json:"msgFrom"`
ContentType *int32 `json:"contentType"`
Status *int32 `json:"status"`
Options *map[string]bool `json:"options"`
OfflinePushInfo *sdkws.OfflinePushInfo `json:"offlinePushInfo"`
AtUserIDList *[]string `json:"atUserIDList"`
MsgDataList *[]byte `json:"msgDataList"`
AttachedInfo *string `json:"attachedInfo"`
Ex *string `json:"ex"`
}
type CallbackBeforeSetMessageReactionExtReq struct {
OperationID string `json:"operationID"`
CallbackCommand string `json:"callbackCommand"`
SourceID string `json:"sourceID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
ReactionExtensionList map[string]*sdk_ws.KeyValue `json:"reactionExtensionList"`
ClientMsgID string `json:"clientMsgID"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
OperationID string `json:"operationID"`
CallbackCommand string `json:"callbackCommand"`
SourceID string `json:"sourceID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
ReactionExtensionList map[string]*sdkws.KeyValue `json:"reactionExtensionList"`
ClientMsgID string `json:"clientMsgID"`
IsReact bool `json:"isReact"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackBeforeSetMessageReactionExtResp struct {
*CommonCallbackResp
@@ -84,15 +84,15 @@ type CallbackBeforeSetMessageReactionExtResp struct {
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackDeleteMessageReactionExtReq struct {
OperationID string `json:"operationID"`
CallbackCommand string `json:"callbackCommand"`
SourceID string `json:"sourceID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
ReactionExtensionList []*sdk_ws.KeyValue `json:"reactionExtensionList"`
ClientMsgID string `json:"clientMsgID"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
OperationID string `json:"operationID"`
CallbackCommand string `json:"callbackCommand"`
SourceID string `json:"sourceID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
ReactionExtensionList []*sdkws.KeyValue `json:"reactionExtensionList"`
ClientMsgID string `json:"clientMsgID"`
IsExternalExtensions bool `json:"isExternalExtensions"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackDeleteMessageReactionExtResp struct {
*CommonCallbackResp
+1 -1
View File
@@ -1,6 +1,6 @@
package callbackstruct
import common "Open_IM/pkg/proto/sdk_ws"
import common "Open_IM/pkg/proto/sdkws"
type CallbackBeforePushReq struct {
UserStatusBatchCallbackReq
+2 -2
View File
@@ -2,7 +2,7 @@ package cmsstruct
import (
"Open_IM/pkg/api_struct"
server_api_params "Open_IM/pkg/proto/sdk_ws"
sdkws "Open_IM/pkg/proto/sdkws"
)
type AdminLoginRequest struct {
@@ -51,6 +51,6 @@ type GetUserRegisterAddFriendIDListRequest struct {
}
type GetUserRegisterAddFriendIDListResponse struct {
Users []*server_api_params.UserInfo `json:"users"`
Users []*sdkws.UserInfo `json:"users"`
apistruct.ResponsePagination
}
+1 -1
View File
@@ -1,7 +1,7 @@
package cmsstruct
import (
pbCommon "Open_IM/pkg/proto/sdk_ws"
pbCommon "Open_IM/pkg/proto/sdkws"
)
type GetChatLogsReq struct {
+1 -45
View File
@@ -133,7 +133,6 @@ type config struct {
OpenImPushPort []int `yaml:"openImPushPort"`
OpenImAdminCmsPort []int `yaml:"openImAdminCmsPort"`
OpenImOfficePort []int `yaml:"openImOfficePort"`
OpenImOrganizationPort []int `yaml:"openImOrganizationPort"`
OpenImConversationPort []int `yaml:"openImConversationPort"`
OpenImCachePort []int `yaml:"openImCachePort"`
OpenImRealTimeCommPort []int `yaml:"openImRealTimeCommPort"`
@@ -149,7 +148,6 @@ type config struct {
OpenImAuthName string `yaml:"openImAuthName"`
OpenImAdminCMSName string `yaml:"openImAdminCMSName"`
OpenImOfficeName string `yaml:"openImOfficeName"`
OpenImOrganizationName string `yaml:"openImOrganizationName"`
OpenImConversationName string `yaml:"openImConversationName"`
OpenImCacheName string `yaml:"openImCacheName"`
OpenImRealTimeCommName string `yaml:"openImRealTimeCommName"`
@@ -404,11 +402,6 @@ type config struct {
OfflinePush POfflinePush `yaml:"offlinePush"`
DefaultTips PDefaultTips `yaml:"defaultTips"`
} `yaml:"groupMemberSetToOrdinaryUser"`
OrganizationChanged struct {
Conversation PConversation `yaml:"conversation"`
OfflinePush POfflinePush `yaml:"offlinePush"`
DefaultTips PDefaultTips `yaml:"defaultTips"`
} `yaml:"organizationChanged"`
////////////////////////user///////////////////////
UserInfoUpdated struct {
@@ -496,44 +489,7 @@ type config struct {
} `yaml:"offlinePush"`
} `yaml:"signal"`
}
Demo struct {
Port []int `yaml:"openImDemoPort"`
ListenIP string `yaml:"listenIP"`
AliSMSVerify struct {
AccessKeyID string `yaml:"accessKeyId"`
AccessKeySecret string `yaml:"accessKeySecret"`
SignName string `yaml:"signName"`
VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"`
Enable bool `yaml:"enable"`
}
TencentSMS struct {
AppID string `yaml:"appID"`
Region string `yaml:"region"`
SecretID string `yaml:"secretID"`
SecretKey string `yaml:"secretKey"`
SignName string `yaml:"signName"`
VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"`
Enable bool `yaml:"enable"`
}
SuperCode string `yaml:"superCode"`
CodeTTL int `yaml:"codeTTL"`
UseSuperCode bool `yaml:"useSuperCode"`
Mail struct {
Title string `yaml:"title"`
SenderMail string `yaml:"senderMail"`
SenderAuthorizationCode string `yaml:"senderAuthorizationCode"`
SmtpAddr string `yaml:"smtpAddr"`
SmtpPort int `yaml:"smtpPort"`
}
TestDepartMentID string `yaml:"testDepartMentID"`
ImAPIURL string `yaml:"imAPIURL"`
NeedInvitationCode bool `yaml:"needInvitationCode"`
OnboardProcess bool `yaml:"onboardProcess"`
JoinDepartmentIDList []string `yaml:"joinDepartmentIDList"`
JoinDepartmentGroups bool `yaml:"joinDepartmentGroups"`
OaNotification bool `yaml:"oaNotification"`
CreateOrganizationUserAndJoinDepartment bool `yaml:"createOrganizationUserAndJoinDepartment"`
}
WorkMoment struct {
OnlyFriendCanSee bool `yaml:"onlyFriendCanSee"`
} `yaml:"workMoment"`
-2
View File
@@ -94,8 +94,6 @@ const (
ConversationPrivateChatNotification = 1701
ConversationUnreadNotification = 1702
OrganizationChangedNotification = 1801
WorkMomentNotificationBegin = 1900
WorkMomentNotification = 1901
+1 -1
View File
@@ -56,7 +56,7 @@ func NewConversationRedis(rcClient *rockscache.Client) *ConversationRedis {
}
func NewNewConversationRedis(rdb redis.UniversalClient, conversationDB *relation.ConversationGorm, options rockscache.Options) *ConversationRedis {
return &ConversationRedis{conversationDB: conversationDB, expireTime: conversationExpireTime, rcClient: rockscache.NewClient(rdb, options)}
return &ConversationRedis{rcClient: rockscache.NewClient(rdb, options)}
}
func (c *ConversationRedis) getConversationKey(ownerUserID, conversationID string) string {
+1 -1
View File
@@ -6,7 +6,7 @@ import (
log2 "Open_IM/pkg/common/log"
pbChat "Open_IM/pkg/proto/msg"
pbRtc "Open_IM/pkg/proto/rtc"
pbCommon "Open_IM/pkg/proto/sdk_ws"
pbCommon "Open_IM/pkg/proto/sdkws"
"Open_IM/pkg/utils"
"context"
"errors"
+1 -1
View File
@@ -3,7 +3,7 @@ package cache
import (
"Open_IM/pkg/common/constant"
pbChat "Open_IM/pkg/proto/msg"
common "Open_IM/pkg/proto/sdk_ws"
common "Open_IM/pkg/proto/sdkws"
"context"
"flag"
"fmt"
-536
View File
@@ -68,539 +68,3 @@ func (rc *RcClient) DelKeys() {
}
}
}
func (rc *Client) GetFriendIDListFromCache(ctx context.Context, userID string) (friendIDList []string, err error) {
getFriendIDList := func() (string, error) {
friendIDList, err := relation.GetFriendIDListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(friendIDList)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "friendIDList", friendIDList)
}()
friendIDListStr, err := db.DB.Rc.Fetch(friendRelationCache+userID, time.Second*30*60, getFriendIDList)
if err != nil {
return nil, utils.Wrap(err, "")
}
err = json.Unmarshal([]byte(friendIDListStr), &friendIDList)
return friendIDList, utils.Wrap(err, "")
}
func DelFriendIDListFromCache(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID)
}()
return db.DB.Rc.TagAsDeleted(friendRelationCache + userID)
}
func GetBlackListFromCache(ctx context.Context, userID string) (blackIDs []string, err error) {
getBlackIDList := func() (string, error) {
blackIDs, err := relation.GetBlackIDListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(blackIDs)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "blackIDList", blackIDs)
}()
blackIDListStr, err := db.DB.Rc.Fetch(blackListCache+userID, time.Second*30*60, getBlackIDList)
if err != nil {
return nil, utils.Wrap(err, "")
}
err = json.Unmarshal([]byte(blackIDListStr), &blackIDs)
return blackIDs, utils.Wrap(err, "")
}
func DelBlackIDListFromCache(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "ctx", ctx)
}()
return db.DB.Rc.TagAsDeleted(blackListCache + userID)
}
func GetJoinedGroupIDListFromCache(ctx context.Context, userID string) (joinedGroupList []string, err error) {
getJoinedGroupIDList := func() (string, error) {
joinedGroupList, err := relation.GetJoinedGroupIDListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(joinedGroupList)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "joinedGroupList", joinedGroupList)
}()
joinedGroupIDListStr, err := db.DB.Rc.Fetch(joinedGroupListCache+userID, time.Second*30*60, getJoinedGroupIDList)
if err != nil {
return nil, utils.Wrap(err, "")
}
err = json.Unmarshal([]byte(joinedGroupIDListStr), &joinedGroupList)
return joinedGroupList, utils.Wrap(err, "")
}
func DelJoinedGroupIDListFromCache(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID)
}()
return db.DB.Rc.TagAsDeleted(joinedGroupListCache + userID)
}
func GetGroupMemberIDListFromCache(ctx context.Context, groupID string) (groupMemberIDList []string, err error) {
f := func() (string, error) {
groupInfo, err := GetGroupInfoFromCache(ctx, groupID)
if err != nil {
return "", utils.Wrap(err, "GetGroupInfoFromCache failed")
}
var groupMemberIDList []string
if groupInfo.GroupType == constant.SuperGroup {
superGroup, err := db.DB.GetSuperGroup(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
groupMemberIDList = superGroup.MemberIDList
} else {
groupMemberIDList, err = relation.GetGroupMemberIDListByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
}
bytes, err := json.Marshal(groupMemberIDList)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID, "groupMemberIDList", groupMemberIDList)
}()
groupIDListStr, err := db.DB.Rc.Fetch(groupCache+groupID, time.Second*30*60, f)
if err != nil {
return nil, utils.Wrap(err, "")
}
err = json.Unmarshal([]byte(groupIDListStr), &groupMemberIDList)
return groupMemberIDList, utils.Wrap(err, "")
}
func DelGroupMemberIDListFromCache(ctx context.Context, groupID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID)
}()
return db.DB.Rc.TagAsDeleted(groupCache + groupID)
}
func GetUserInfoFromCache(ctx context.Context, userID string) (userInfo *relation.User, err error) {
getUserInfo := func() (string, error) {
userInfo, err := relation.GetUserByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(userInfo)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "userInfo", *userInfo)
}()
userInfoStr, err := db.DB.Rc.Fetch(userInfoCache+userID, time.Second*30*60, getUserInfo)
if err != nil {
return nil, utils.Wrap(err, "")
}
userInfo = &relation.User{}
err = json.Unmarshal([]byte(userInfoStr), userInfo)
return userInfo, utils.Wrap(err, "")
}
func GetUserInfoFromCacheBatch(ctx context.Context, userIDs []string) ([]*relation.User, error) {
var users []*relation.User
for _, userID := range userIDs {
user, err := GetUserInfoFromCache(ctx, userID)
if err != nil {
return nil, err
}
users = append(users, user)
}
return users, nil
}
func DelUserInfoFromCache(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID)
}()
return db.DB.Rc.TagAsDeleted(userInfoCache + userID)
}
func GetGroupMemberInfoFromCache(ctx context.Context, groupID, userID string) (groupMember *relation.GroupMember, err error) {
getGroupMemberInfo := func() (string, error) {
groupMemberInfo, err := relation.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(groupMemberInfo)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID, "userID", userID, "groupMember", *groupMember)
}()
groupMemberInfoStr, err := db.DB.Rc.Fetch(groupMemberInfoCache+groupID+"-"+userID, time.Second*30*60, getGroupMemberInfo)
if err != nil {
return nil, utils.Wrap(err, "")
}
groupMember = &relation.GroupMember{}
err = json.Unmarshal([]byte(groupMemberInfoStr), groupMember)
return groupMember, utils.Wrap(err, "")
}
func DelGroupMemberInfoFromCache(ctx context.Context, groupID, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID, "userID", userID)
}()
return db.DB.Rc.TagAsDeleted(groupMemberInfoCache + groupID + "-" + userID)
}
func GetGroupMembersInfoFromCache(ctx context.Context, count, offset int32, groupID string) (groupMembers []*relation.GroupMember, err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "count", count, "offset", offset, "groupID", groupID, "groupMember", groupMembers)
}()
groupMemberIDList, err := GetGroupMemberIDListFromCache(ctx, groupID)
if err != nil {
return nil, err
}
if count < 0 || offset < 0 {
return nil, nil
}
var groupMemberList []*relation.GroupMember
var start, stop int32
start = offset
stop = offset + count
l := int32(len(groupMemberIDList))
if start > stop {
return nil, nil
}
if start >= l {
return nil, nil
}
if count != 0 {
if stop >= l {
stop = l
}
groupMemberIDList = groupMemberIDList[start:stop]
} else {
if l < 1000 {
stop = l
} else {
stop = 1000
}
groupMemberIDList = groupMemberIDList[start:stop]
}
//log.NewDebug("", utils.GetSelfFuncName(), "ID list: ", groupMemberIDList)
for _, userID := range groupMemberIDList {
groupMember, err := GetGroupMemberInfoFromCache(ctx, groupID, userID)
if err != nil {
log.NewError("", utils.GetSelfFuncName(), err.Error(), groupID, userID)
continue
}
groupMembers = append(groupMembers, groupMember)
}
return groupMemberList, nil
}
func GetAllGroupMembersInfoFromCache(ctx context.Context, groupID string) (groupMembers []*relation.GroupMember, err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID, "groupMembers", groupMembers)
}()
getGroupMemberInfo := func() (string, error) {
groupMembers, err := relation.GetGroupMemberListByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(groupMembers)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
groupMembersStr, err := db.DB.Rc.Fetch(groupAllMemberInfoCache+groupID, time.Second*30*60, getGroupMemberInfo)
if err != nil {
return nil, utils.Wrap(err, "")
}
err = json.Unmarshal([]byte(groupMembersStr), &groupMembers)
return groupMembers, utils.Wrap(err, "")
}
func DelAllGroupMembersInfoFromCache(ctx context.Context, groupID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID)
}()
return db.DB.Rc.TagAsDeleted(groupAllMemberInfoCache + groupID)
}
//func GetGroupInfoFromCache(ctx context.Context, groupID string) (groupInfo *mysql.GroupGorm, err error) {
// getGroupInfo := func() (string, error) {
// groupInfo, err := mysql.GetGroupInfoByGroupID(groupID)
// if err != nil {
// return "", utils.Wrap(err, "")
// }
// bytes, err := json.Marshal(groupInfo)
// if err != nil {
// return "", utils.Wrap(err, "")
// }
// return string(bytes), nil
// }
// groupInfo = &mysql.GroupGorm{}
// defer func() {
// tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID, "groupInfo", groupInfo)
// }()
// groupInfoStr, err := db.DB.Rc.Fetch(groupInfoCache+groupID, time.Second*30*60, getGroupInfo)
// if err != nil {
// return nil, utils.Wrap(err, "")
// }
// err = json.Unmarshal([]byte(groupInfoStr), groupInfo)
// return groupInfo, utils.Wrap(err, "")
//}
//
//func DelGroupInfoFromCache(ctx context.Context, groupID string) (err error) {
// defer func() {
// tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID)
// }()
// return db.DB.Rc.TagAsDeleted(groupInfoCache + groupID)
//}
func GetAllFriendsInfoFromCache(ctx context.Context, userID string) (friends []*relation.Friend, err error) {
getAllFriendInfo := func() (string, error) {
friendInfoList, err := relation.GetFriendListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(friendInfoList)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "friends", friends)
}()
allFriendInfoStr, err := db.DB.Rc.Fetch(allFriendInfoCache+userID, time.Second*30*60, getAllFriendInfo)
if err != nil {
return nil, utils.Wrap(err, "")
}
err = json.Unmarshal([]byte(allFriendInfoStr), &friends)
return friends, utils.Wrap(err, "")
}
func DelAllFriendsInfoFromCache(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID)
}()
return db.DB.Rc.TagAsDeleted(allFriendInfoCache + userID)
}
func GetJoinedSuperGroupListFromCache(ctx context.Context, userID string) (joinedSuperGroupIDs []string, err error) {
getJoinedSuperGroupIDList := func() (string, error) {
userToSuperGroup, err := db.DB.GetSuperGroupByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "")
}
bytes, err := json.Marshal(userToSuperGroup.GroupIDList)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "joinedSuperGroupIDs", joinedSuperGroupIDs)
}()
joinedSuperGroupListStr, err := db.DB.Rc.Fetch(joinedSuperGroupListCache+userID, time.Second*30*60, getJoinedSuperGroupIDList)
if err != nil {
return nil, err
}
err = json.Unmarshal([]byte(joinedSuperGroupListStr), &joinedSuperGroupIDs)
return joinedSuperGroupIDs, utils.Wrap(err, "")
}
func DelJoinedSuperGroupIDListFromCache(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID)
}()
return db.DB.Rc.TagAsDeleted(joinedSuperGroupListCache + userID)
}
func GetGroupMemberListHashFromCache(ctx context.Context, groupID string) (hashCodeUint64 uint64, err error) {
generateHash := func() (string, error) {
groupInfo, err := GetGroupInfoFromCache(ctx, groupID)
if err != nil {
return "0", utils.Wrap(err, "GetGroupInfoFromCache failed")
}
if groupInfo.Status == constant.GroupStatusDismissed {
return "0", nil
}
groupMemberIDList, err := GetGroupMemberIDListFromCache(ctx, groupID)
if err != nil {
return "", utils.Wrap(err, "GetGroupMemberIDListFromCache failed")
}
sort.Strings(groupMemberIDList)
var all string
for _, v := range groupMemberIDList {
all += v
}
bi := big.NewInt(0)
bi.SetString(utils.Md5(all)[0:8], 16)
return strconv.Itoa(int(bi.Uint64())), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID, "hashCodeUint64", hashCodeUint64)
}()
hashCodeStr, err := db.DB.Rc.Fetch(groupMemberListHashCache+groupID, time.Second*30*60, generateHash)
if err != nil {
return 0, utils.Wrap(err, "fetch failed")
}
hashCode, err := strconv.Atoi(hashCodeStr)
return uint64(hashCode), err
}
func DelGroupMemberListHashFromCache(ctx context.Context, groupID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID)
}()
return db.DB.Rc.TagAsDeleted(groupMemberListHashCache + groupID)
}
func GetGroupMemberNumFromCache(ctx context.Context, groupID string) (num int, err error) {
getGroupMemberNum := func() (string, error) {
num, err := relation.GetGroupMemberNumByGroupID(groupID)
if err != nil {
return "", utils.Wrap(err, "")
}
return strconv.Itoa(int(num)), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID, "num", num)
}()
groupMember, err := db.DB.Rc.Fetch(groupMemberNumCache+groupID, time.Second*30*60, getGroupMemberNum)
if err != nil {
return 0, utils.Wrap(err, "")
}
return strconv.Atoi(groupMember)
}
func DelGroupMemberNumFromCache(ctx context.Context, groupID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groupID", groupID)
}()
return db.DB.Rc.TagAsDeleted(groupMemberNumCache + groupID)
}
func GetUserConversationIDListFromCache(ctx context.Context, userID string) (conversationIDs []string, err error) {
getConversationIDList := func() (string, error) {
conversationIDList, err := relation.GetConversationIDListByUserID(userID)
if err != nil {
return "", utils.Wrap(err, "getConversationIDList failed")
}
log.NewDebug("", utils.GetSelfFuncName(), conversationIDList)
bytes, err := json.Marshal(conversationIDList)
if err != nil {
return "", utils.Wrap(err, "")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID, "conversationIDs", conversationIDs)
}()
conversationIDListStr, err := db.DB.Rc.Fetch(conversationIDListCache+userID, time.Second*30*60, getConversationIDList)
err = json.Unmarshal([]byte(conversationIDListStr), &conversationIDs)
if err != nil {
return nil, utils.Wrap(err, "")
}
return conversationIDs, nil
}
func DelUserConversationIDListFromCache(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID)
}()
return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationIDListCache+userID), "DelUserConversationIDListFromCache err")
}
func GetConversationFromCache(ctx context.Context, ownerUserID, conversationID string) (conversation *relation.Conversation, err error) {
getConversation := func() (string, error) {
conversation, err := relation.GetConversation(ownerUserID, conversationID)
if err != nil {
return "", utils.Wrap(err, "get failed")
}
bytes, err := json.Marshal(conversation)
if err != nil {
return "", utils.Wrap(err, "Marshal failed")
}
return string(bytes), nil
}
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "ownerUserID", ownerUserID, "conversationID", conversationID, "conversation", *conversation)
}()
conversationStr, err := db.DB.Rc.Fetch(conversationCache+ownerUserID+":"+conversationID, time.Second*30*60, getConversation)
if err != nil {
return nil, utils.Wrap(err, "Fetch failed")
}
conversation = &relation.Conversation{}
err = json.Unmarshal([]byte(conversationStr), &conversation)
return conversation, utils.Wrap(err, "Unmarshal failed")
}
func GetConversationsFromCache(ctx context.Context, ownerUserID string, conversationIDs []string) (conversations []relation.Conversation, err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "ownerUserID", ownerUserID, "conversationIDs", conversationIDs, "conversations", conversations)
}()
for _, conversationID := range conversationIDs {
conversation, err := GetConversationFromCache(ctx, ownerUserID, conversationID)
if err != nil {
return nil, utils.Wrap(err, "GetConversationFromCache failed")
}
conversations = append(conversations, *conversation)
}
return conversations, nil
}
func GetUserAllConversationList(ctx context.Context, ownerUserID string) (conversations []relation.Conversation, err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "ownerUserID", ownerUserID, "conversations", conversations)
}()
IDList, err := GetUserConversationIDListFromCache(ctx, ownerUserID)
if err != nil {
return nil, err
}
var conversationList []relation.Conversation
log.NewDebug("", utils.GetSelfFuncName(), IDList)
for _, conversationID := range IDList {
conversation, err := GetConversationFromCache(ctx, ownerUserID, conversationID)
if err != nil {
return nil, utils.Wrap(err, "GetConversationFromCache failed")
}
conversationList = append(conversationList, *conversation)
}
return conversationList, nil
}
func DelConversationFromCache(ctx context.Context, ownerUserID, conversationID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "ownerUserID", ownerUserID, "conversationID", conversationID)
}()
return utils.Wrap(db.DB.Rc.TagAsDeleted(conversationCache+ownerUserID+":"+conversationID), "DelConversationFromCache err")
}
+14 -11
View File
@@ -19,7 +19,10 @@ const (
userGlobalRecvMsgOptKey = "USER_GLOBAL_RECV_MSG_OPT_KEY:"
)
type UserCache struct {
type UserCache interface {
}
type UserCacheRedis struct {
userDB *relation.UserGorm
expireTime time.Duration
@@ -27,8 +30,8 @@ type UserCache struct {
rcClient *rockscache.Client
}
func NewUserCache(rdb redis.UniversalClient, userDB *relation.UserGorm, options rockscache.Options) *UserCache {
return &UserCache{
func NewUserCacheRedis(rdb redis.UniversalClient, userDB *relation.UserGorm, options rockscache.Options) *UserCacheRedis {
return &UserCacheRedis{
userDB: userDB,
expireTime: userExpireTime,
redisClient: NewRedisClient(rdb),
@@ -36,15 +39,15 @@ func NewUserCache(rdb redis.UniversalClient, userDB *relation.UserGorm, options
}
}
func (u *UserCache) getUserInfoKey(userID string) string {
func (u *UserCacheRedis) getUserInfoKey(userID string) string {
return userInfoKey + userID
}
func (u *UserCache) getUserGlobalRecvMsgOptKey(userID string) string {
func (u *UserCacheRedis) getUserGlobalRecvMsgOptKey(userID string) string {
return userGlobalRecvMsgOptKey + userID
}
func (u *UserCache) GetUserInfo(ctx context.Context, userID string) (userInfo *relationTb.UserModel, err error) {
func (u *UserCacheRedis) GetUserInfo(ctx context.Context, userID string) (userInfo *relationTb.UserModel, err error) {
getUserInfo := func() (string, error) {
userInfo, err := u.userDB.Take(ctx, userID)
if err != nil {
@@ -68,7 +71,7 @@ func (u *UserCache) GetUserInfo(ctx context.Context, userID string) (userInfo *r
return userInfo, utils.Wrap(err, "")
}
func (u *UserCache) GetUsersInfo(ctx context.Context, userIDs []string) ([]*relationTb.UserModel, error) {
func (u *UserCacheRedis) GetUsersInfo(ctx context.Context, userIDs []string) ([]*relationTb.UserModel, error) {
var users []*relationTb.UserModel
for _, userID := range userIDs {
user, err := GetUserInfoFromCache(ctx, userID)
@@ -80,14 +83,14 @@ func (u *UserCache) GetUsersInfo(ctx context.Context, userIDs []string) ([]*rela
return users, nil
}
func (u *UserCache) DelUserInfo(ctx context.Context, userID string) (err error) {
func (u *UserCacheRedis) DelUserInfo(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID)
}()
return u.rcClient.TagAsDeleted(u.getUserInfoKey(userID))
}
func (u *UserCache) DelUsersInfo(ctx context.Context, userIDs []string) (err error) {
func (u *UserCacheRedis) DelUsersInfo(ctx context.Context, userIDs []string) (err error) {
for _, userID := range userIDs {
if err := u.DelUserInfo(ctx, userID); err != nil {
return err
@@ -96,7 +99,7 @@ func (u *UserCache) DelUsersInfo(ctx context.Context, userIDs []string) (err err
return nil
}
func (u *UserCache) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error) {
func (u *UserCacheRedis) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string) (opt int, err error) {
getUserGlobalRecvMsgOpt := func() (string, error) {
userInfo, err := u.userDB.Take(ctx, userID)
if err != nil {
@@ -114,7 +117,7 @@ func (u *UserCache) GetUserGlobalRecvMsgOpt(ctx context.Context, userID string)
return strconv.Atoi(optStr)
}
func (u *UserCache) DelUserGlobalRecvMsgOpt(ctx context.Context, userID string) (err error) {
func (u *UserCacheRedis) DelUserGlobalRecvMsgOpt(ctx context.Context, userID string) (err error) {
defer func() {
tracelog.SetCtxDebug(ctx, utils.GetFuncName(1), err, "userID", userID)
}()
+6 -5
View File
@@ -2,13 +2,14 @@ package controller
import (
"Open_IM/pkg/common/db/relation"
relationTb "Open_IM/pkg/common/db/table/relation"
pbMsg "Open_IM/pkg/proto/msg"
"gorm.io/gorm"
)
type ChatLogInterface interface {
CreateChatLog(msg pbMsg.MsgDataToMQ) error
GetChatLog(chatLog *relation.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error)
GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error)
}
func NewChatLogController(db *gorm.DB) ChatLogInterface {
@@ -23,17 +24,17 @@ func (c *ChatLogController) CreateChatLog(msg pbMsg.MsgDataToMQ) error {
return c.database.CreateChatLog(msg)
}
func (c *ChatLogController) GetChatLog(chatLog *relation.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error) {
func (c *ChatLogController) GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error) {
return c.database.GetChatLog(chatLog, pageNumber, showNumber, contentTypeList)
}
type ChatLogDataBaseInterface interface {
CreateChatLog(msg pbMsg.MsgDataToMQ) error
GetChatLog(chatLog *relation.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error)
GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error)
}
type ChatLogDataBase struct {
chatLogDB *relation.ChatLog
chatLogDB *relationTb.ChatLogModelInterface
}
func NewChatLogDataBase(db *gorm.DB) ChatLogDataBaseInterface {
@@ -44,6 +45,6 @@ func (c *ChatLogDataBase) CreateChatLog(msg pbMsg.MsgDataToMQ) error {
return c.chatLogDB.Create(msg)
}
func (c *ChatLogDataBase) GetChatLog(chatLog *relation.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error) {
func (c *ChatLogDataBase) GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error) {
return c.chatLogDB.GetChatLog(chatLog, pageNumber, showNumber, contentTypeList)
}
+2 -2
View File
@@ -4,7 +4,7 @@ import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/table/relation"
pbMsg "Open_IM/pkg/proto/msg"
server_api_params "Open_IM/pkg/proto/sdk_ws"
sdkws "Open_IM/pkg/proto/sdkws"
"Open_IM/pkg/utils"
"fmt"
"github.com/golang/protobuf/jsonpb"
@@ -31,7 +31,7 @@ func (c *ChatLogGorm) Create(msg pbMsg.MsgDataToMQ) error {
chatLog.RecvID = msg.MsgData.RecvID
}
if msg.MsgData.ContentType >= constant.NotificationBegin && msg.MsgData.ContentType <= constant.NotificationEnd {
var tips server_api_params.TipsComm
var tips sdkws.TipsComm
_ = proto.Unmarshal(msg.MsgData.Content, &tips)
marshaler := jsonpb.Marshaler{
OrigName: true,
@@ -1,7 +1,7 @@
package unrelation
import (
common "Open_IM/pkg/proto/sdk_ws"
common "Open_IM/pkg/proto/sdkws"
"context"
"strconv"
"strings"
+65
View File
@@ -0,0 +1,65 @@
package unrelation
import "strconv"
const (
singleGocMsgNum = 5000
CChat = "msg"
)
type UserChatModel struct {
UID string `bson:"uid"`
Msg []MsgInfoModel `bson:"msg"`
}
type MsgInfoModel struct {
SendTime int64 `bson:"sendtime"`
Msg []byte `bson:"msg"`
}
func (UserChatModel) TableName() string {
return CChat
}
func (UserChatModel) GetSingleGocMsgNum() int {
return singleGocMsgNum
}
func (u UserChatModel) getSeqUid(uid string, seq uint32) string {
seqSuffix := seq / singleGocMsgNum
return u.indexGen(uid, seqSuffix)
}
func (u UserChatModel) getSeqUserIDList(userID string, maxSeq uint32) []string {
seqMaxSuffix := maxSeq / singleGocMsgNum
var seqUserIDList []string
for i := 0; i <= int(seqMaxSuffix); i++ {
seqUserID := u.indexGen(userID, uint32(i))
seqUserIDList = append(seqUserIDList, seqUserID)
}
return seqUserIDList
}
func (UserChatModel) getSeqSuperGroupID(groupID string, seq uint32) string {
seqSuffix := seq / singleGocMsgNum
return superGroupIndexGen(groupID, seqSuffix)
}
func (u UserChatModel) GetSeqUid(uid string, seq uint32) string {
return u.getSeqUid(uid, seq)
}
func (UserChatModel) getMsgIndex(seq uint32) int {
seqSuffix := seq / singleGocMsgNum
var index uint32
if seqSuffix == 0 {
index = (seq - seqSuffix*singleGocMsgNum) - 1
} else {
index = seq - seqSuffix*singleGocMsgNum
}
return int(index)
}
func (UserChatModel) indexGen(uid string, seqSuffix uint32) string {
return uid + ":" + strconv.FormatInt(int64(seqSuffix), 10)
}
+4 -10
View File
@@ -2,6 +2,7 @@ package unrelation
import (
"context"
"strconv"
)
const (
@@ -37,13 +38,6 @@ type SuperGroupModelInterface interface {
RemoveGroupFromUser(ctx context.Context, groupID string, userIDs []string, tx ...any) error
}
//type SuperGroupModelInterface interface {
// // tx is your transaction object
// CreateSuperGroup(ctx context.Context, groupID string, initMemberIDs []string, tx ...interface{}) error
// FindSuperGroup(ctx context.Context, groupIDs []string, tx ...interface{}) ([]*SuperGroupModel, error)
// //GetSuperGroup(ctx context.Context, groupID string) (SuperGroupModel, error)
// AddUserToSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...interface{}) error
// RemoverUserFromSuperGroup(ctx context.Context, groupID string, userIDs []string, tx ...interface{}) error
// GetSuperGroupByUserID(ctx context.Context, userID string, tx ...interface{}) (*UserToSuperGroupModel, error)
// DeleteSuperGroup(ctx context.Context, groupID string, tx ...interface{}) error
//}
func superGroupIndexGen(groupID string, seqSuffix uint32) string {
return "super_group_" + groupID + ":" + strconv.FormatInt(int64(seqSuffix), 10)
}
@@ -2,7 +2,7 @@ package unrelation
import (
"Open_IM/pkg/common/db/table/unrelation"
server_api_params "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/proto/sdkws"
"Open_IM/pkg/utils"
"context"
"errors"
@@ -99,7 +99,7 @@ func (e *ExtendMsgSetMongoDriver) InsertExtendMsg(ctx context.Context, sourceID
}
// insert or update
func (e *ExtendMsgSetMongoDriver) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*server_api_params.KeyValue) error {
func (e *ExtendMsgSetMongoDriver) InsertOrUpdateReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error {
var updateBson = bson.M{}
for _, v := range reactionExtensionList {
updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = v
@@ -120,7 +120,7 @@ func (e *ExtendMsgSetMongoDriver) InsertOrUpdateReactionExtendMsgSet(ctx context
}
// delete TypeKey
func (e *ExtendMsgSetMongoDriver) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*server_api_params.KeyValue) error {
func (e *ExtendMsgSetMongoDriver) DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error {
var updateBson = bson.M{}
for _, v := range reactionExtensionList {
updateBson[fmt.Sprintf("extend_msgs.%s.%s", clientMsgID, v.TypeKey)] = ""
File diff suppressed because it is too large Load Diff
+582
View File
@@ -0,0 +1,582 @@
package unrelation
import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/table/unrelation"
"Open_IM/pkg/proto/sdkws"
"Open_IM/pkg/utils"
"context"
"errors"
"github.com/go-redis/redis/v8"
"github.com/gogo/protobuf/sortkeys"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"sync"
"time"
)
var ErrMsgListNotExist = errors.New("user not have msg in mongoDB")
type MsgMongoDriver struct {
mgoDB *mongo.Database
MsgCollection *mongo.Collection
}
func NewMsgMongoDriver(mgoDB *mongo.Database) *MsgMongoDriver {
return &MsgMongoDriver{mgoDB: mgoDB, MsgCollection: mgoDB.Collection(unrelation.CChat)}
}
func (m *MsgMongoDriver) DelMsgBySeqList(ctx context.Context, userID string, seqList []uint32) (totalUnExistSeqList []uint32, err error) {
sortkeys.Uint32s(seqList)
suffixUserID2SubSeqList := func(uid string, seqList []uint32) map[string][]uint32 {
t := make(map[string][]uint32)
for i := 0; i < len(seqList); i++ {
seqUid := getSeqUid(uid, seqList[i])
if value, ok := t[seqUid]; !ok {
var temp []uint32
t[seqUid] = append(temp, seqList[i])
} else {
t[seqUid] = append(value, seqList[i])
}
}
return t
}(userID, seqList)
lock := sync.Mutex{}
var wg sync.WaitGroup
wg.Add(len(suffixUserID2SubSeqList))
for k, v := range suffixUserID2SubSeqList {
go func(suffixUserID string, subSeqList []uint32) {
defer wg.Done()
unexistSeqList, err := m.DelMsgBySeqListInOneDoc(ctx, suffixUserID, subSeqList)
if err != nil {
return
}
lock.Lock()
totalUnExistSeqList = append(totalUnExistSeqList, unexistSeqList...)
lock.Unlock()
}(k, v)
}
return totalUnExistSeqList, nil
}
func (m *MsgMongoDriver) DelMsgBySeqListInOneDoc(ctx context.Context, suffixUserID string, seqList []uint32) ([]uint32, error) {
seqMsgList, indexList, unexistSeqList, err := m.GetMsgAndIndexBySeqListInOneMongo2(suffixUserID, seqList)
if err != nil {
return nil, utils.Wrap(err, "")
}
for i, v := range seqMsgList {
if err := m.ReplaceMsgByIndex(suffixUserID, v, operationID, indexList[i]); err != nil {
return nil, utils.Wrap(err, "")
}
}
return unexistSeqList, nil
}
func (m *MsgMongoDriver) DelMsgLogic(ctx context.Context, uid string, seqList []uint32) error {
sortkeys.Uint32s(seqList)
seqMsgs, err := d.GetMsgBySeqListMongo2(ctx, uid, seqList)
if err != nil {
return utils.Wrap(err, "")
}
for _, seqMsg := range seqMsgs {
seqMsg.Status = constant.MsgDeleted
if err = d.ReplaceMsgBySeq(ctx, uid, seqMsg); err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "ReplaceMsgListBySeq error", err.Error())
}
}
return nil
}
func (m *MsgMongoDriver) ReplaceMsgByIndex(ctx context.Context, suffixUserID string, msg *sdkws.MsgData, seqIndex int) error {
log.NewInfo(operationID, utils.GetSelfFuncName(), suffixUserID, *msg)
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
s := fmt.Sprintf("msg.%d.msg", seqIndex)
log.NewDebug(operationID, utils.GetSelfFuncName(), seqIndex, s)
msg.Status = constant.MsgDeleted
bytes, err := proto.Marshal(msg)
if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "proto marshal failed ", err.Error(), msg.String())
return utils.Wrap(err, "")
}
updateResult, err := c.UpdateOne(ctx, bson.M{"uid": suffixUserID}, bson.M{"$set": bson.M{s: bytes}})
log.NewInfo(operationID, utils.GetSelfFuncName(), updateResult)
if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "UpdateOne", err.Error())
return utils.Wrap(err, "")
}
return nil
}
func (d *db.DataBases) ReplaceMsgBySeq(uid string, msg *open_im_sdk.MsgData, operationID string) error {
log.NewInfo(operationID, utils.GetSelfFuncName(), uid, *msg)
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
uid = getSeqUid(uid, msg.Seq)
seqIndex := getMsgIndex(msg.Seq)
s := fmt.Sprintf("msg.%d.msg", seqIndex)
log.NewDebug(operationID, utils.GetSelfFuncName(), seqIndex, s)
bytes, err := proto.Marshal(msg)
if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "proto marshal", err.Error())
return utils.Wrap(err, "")
}
updateResult, err := c.UpdateOne(
ctx, bson.M{"uid": uid},
bson.M{"$set": bson.M{s: bytes}})
log.NewInfo(operationID, utils.GetSelfFuncName(), updateResult)
if err != nil {
log.NewError(operationID, utils.GetSelfFuncName(), "UpdateOne", err.Error())
return utils.Wrap(err, "")
}
return nil
}
func (d *db.DataBases) UpdateOneMsgList(msg *UserChat) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
_, err := c.UpdateOne(ctx, bson.M{"uid": msg.UID}, bson.M{"$set": bson.M{"msg": msg.Msg}})
return err
}
func (d *db.DataBases) GetMsgBySeqList(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) {
log.NewInfo(operationID, utils.GetSelfFuncName(), uid, seqList)
var hasSeqList []uint32
singleCount := 0
session := d.mgoSession.Clone()
if session == nil {
return nil, errors.New("session == nil")
}
defer session.Close()
c := session.DB(config.Config.Mongo.DBDatabase).C(cChat)
m := func(uid string, seqList []uint32) map[string][]uint32 {
t := make(map[string][]uint32)
for i := 0; i < len(seqList); i++ {
seqUid := getSeqUid(uid, seqList[i])
if value, ok := t[seqUid]; !ok {
var temp []uint32
t[seqUid] = append(temp, seqList[i])
} else {
t[seqUid] = append(value, seqList[i])
}
}
return t
}(uid, seqList)
sChat := UserChat{}
for seqUid, value := range m {
if err = c.Find(bson.M{"uid": seqUid}).One(&sChat); err != nil {
log.NewError(operationID, "not find seqUid", seqUid, value, uid, seqList, err.Error())
continue
}
singleCount = 0
for i := 0; i < len(sChat.Msg); i++ {
msg := new(open_im_sdk.MsgData)
if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil {
log.NewError(operationID, "Unmarshal err", seqUid, value, uid, seqList, err.Error())
return nil, err
}
if isContainInt32(msg.Seq, value) {
seqMsg = append(seqMsg, msg)
hasSeqList = append(hasSeqList, msg.Seq)
singleCount++
if singleCount == len(value) {
break
}
}
}
}
if len(hasSeqList) != len(seqList) {
var diff []uint32
diff = utils.Difference(hasSeqList, seqList)
exceptionMSg := genExceptionMessageBySeqList(diff)
seqMsg = append(seqMsg, exceptionMSg...)
}
return seqMsg, nil
}
func (d *db.DataBases) GetUserMsgListByIndex(ID string, index int64) (*UserChat, error) {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
regex := fmt.Sprintf("^%s", ID)
findOpts := options.Find().SetLimit(1).SetSkip(index).SetSort(bson.M{"uid": 1})
var msgs []UserChat
//primitive.Regex{Pattern: regex}
cursor, err := c.Find(ctx, bson.M{"uid": primitive.Regex{Pattern: regex}}, findOpts)
if err != nil {
return nil, utils.Wrap(err, "")
}
err = cursor.All(context.Background(), &msgs)
if err != nil {
return nil, utils.Wrap(err, fmt.Sprintf("cursor is %s", cursor.Current.String()))
}
if len(msgs) > 0 {
return &msgs[0], nil
} else {
return nil, ErrMsgListNotExist
}
}
func (d *db.DataBases) DelMongoMsgs(IDList []string) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
_, err := c.DeleteMany(ctx, bson.M{"uid": bson.M{"$in": IDList}})
return err
}
func (d *db.DataBases) ReplaceMsgToBlankByIndex(suffixID string, index int) (replaceMaxSeq uint32, err error) {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
userChat := &UserChat{}
err = c.FindOne(ctx, bson.M{"uid": suffixID}).Decode(&userChat)
if err != nil {
return 0, err
}
for i, msg := range userChat.Msg {
if i <= index {
msgPb := &open_im_sdk.MsgData{}
if err = proto.Unmarshal(msg.Msg, msgPb); err != nil {
continue
}
newMsgPb := &open_im_sdk.MsgData{Seq: msgPb.Seq}
bytes, err := proto.Marshal(newMsgPb)
if err != nil {
continue
}
msg.Msg = bytes
msg.SendTime = 0
replaceMaxSeq = msgPb.Seq
}
}
_, err = c.UpdateOne(ctx, bson.M{"uid": suffixID}, bson.M{"$set": bson.M{"msg": userChat.Msg}})
return replaceMaxSeq, err
}
func (d *db.DataBases) GetNewestMsg(ID string) (msg *open_im_sdk.MsgData, err error) {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
regex := fmt.Sprintf("^%s", ID)
findOpts := options.Find().SetLimit(1).SetSort(bson.M{"uid": -1})
var userChats []UserChat
cursor, err := c.Find(ctx, bson.M{"uid": bson.M{"$regex": regex}}, findOpts)
if err != nil {
return nil, err
}
err = cursor.All(ctx, &userChats)
if err != nil {
return nil, utils.Wrap(err, "")
}
if len(userChats) > 0 {
if len(userChats[0].Msg) > 0 {
msgPb := &open_im_sdk.MsgData{}
err = proto.Unmarshal(userChats[0].Msg[len(userChats[0].Msg)-1].Msg, msgPb)
if err != nil {
return nil, utils.Wrap(err, "")
}
return msgPb, nil
}
return nil, errors.New("len(userChats[0].Msg) < 0")
}
return nil, nil
}
func (d *db.DataBases) GetOldestMsg(ID string) (msg *open_im_sdk.MsgData, err error) {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
regex := fmt.Sprintf("^%s", ID)
findOpts := options.Find().SetLimit(1).SetSort(bson.M{"uid": 1})
var userChats []UserChat
cursor, err := c.Find(ctx, bson.M{"uid": bson.M{"$regex": regex}}, findOpts)
if err != nil {
return nil, err
}
err = cursor.All(ctx, &userChats)
if err != nil {
return nil, utils.Wrap(err, "")
}
var oldestMsg []byte
if len(userChats) > 0 {
for _, v := range userChats[0].Msg {
if v.SendTime != 0 {
oldestMsg = v.Msg
break
}
}
if len(oldestMsg) == 0 {
oldestMsg = userChats[0].Msg[len(userChats[0].Msg)-1].Msg
}
msgPb := &open_im_sdk.MsgData{}
err = proto.Unmarshal(oldestMsg, msgPb)
if err != nil {
return nil, utils.Wrap(err, "")
}
return msgPb, nil
}
return nil, nil
}
func (d *db.DataBases) GetMsgBySeqListMongo2(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) {
var hasSeqList []uint32
singleCount := 0
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
m := func(uid string, seqList []uint32) map[string][]uint32 {
t := make(map[string][]uint32)
for i := 0; i < len(seqList); i++ {
seqUid := getSeqUid(uid, seqList[i])
if value, ok := t[seqUid]; !ok {
var temp []uint32
t[seqUid] = append(temp, seqList[i])
} else {
t[seqUid] = append(value, seqList[i])
}
}
return t
}(uid, seqList)
sChat := UserChat{}
for seqUid, value := range m {
if err = c.FindOne(ctx, bson.M{"uid": seqUid}).Decode(&sChat); err != nil {
log.NewError(operationID, "not find seqUid", seqUid, value, uid, seqList, err.Error())
continue
}
singleCount = 0
for i := 0; i < len(sChat.Msg); i++ {
msg := new(open_im_sdk.MsgData)
if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil {
log.NewError(operationID, "Unmarshal err", seqUid, value, uid, seqList, err.Error())
return nil, err
}
if isContainInt32(msg.Seq, value) {
seqMsg = append(seqMsg, msg)
hasSeqList = append(hasSeqList, msg.Seq)
singleCount++
if singleCount == len(value) {
break
}
}
}
}
if len(hasSeqList) != len(seqList) {
var diff []uint32
diff = utils.Difference(hasSeqList, seqList)
exceptionMSg := genExceptionMessageBySeqList(diff)
seqMsg = append(seqMsg, exceptionMSg...)
}
return seqMsg, nil
}
func (d *db.DataBases) GetSuperGroupMsgBySeqListMongo(groupID string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) {
var hasSeqList []uint32
singleCount := 0
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
m := func(uid string, seqList []uint32) map[string][]uint32 {
t := make(map[string][]uint32)
for i := 0; i < len(seqList); i++ {
seqUid := getSeqUid(uid, seqList[i])
if value, ok := t[seqUid]; !ok {
var temp []uint32
t[seqUid] = append(temp, seqList[i])
} else {
t[seqUid] = append(value, seqList[i])
}
}
return t
}(groupID, seqList)
sChat := UserChat{}
for seqUid, value := range m {
if err = c.FindOne(ctx, bson.M{"uid": seqUid}).Decode(&sChat); err != nil {
log.NewError(operationID, "not find seqGroupID", seqUid, value, groupID, seqList, err.Error())
continue
}
singleCount = 0
for i := 0; i < len(sChat.Msg); i++ {
msg := new(open_im_sdk.MsgData)
if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil {
log.NewError(operationID, "Unmarshal err", seqUid, value, groupID, seqList, err.Error())
return nil, err
}
if isContainInt32(msg.Seq, value) {
seqMsg = append(seqMsg, msg)
hasSeqList = append(hasSeqList, msg.Seq)
singleCount++
if singleCount == len(value) {
break
}
}
}
}
if len(hasSeqList) != len(seqList) {
var diff []uint32
diff = utils.Difference(hasSeqList, seqList)
exceptionMSg := genExceptionSuperGroupMessageBySeqList(diff, groupID)
seqMsg = append(seqMsg, exceptionMSg...)
}
return seqMsg, nil
}
func (d *db.DataBases) GetMsgAndIndexBySeqListInOneMongo2(suffixUserID string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, indexList []int, unexistSeqList []uint32, err error) {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
sChat := UserChat{}
if err = c.FindOne(ctx, bson.M{"uid": suffixUserID}).Decode(&sChat); err != nil {
log.NewError(operationID, "not find seqUid", suffixUserID, err.Error())
return nil, nil, nil, utils.Wrap(err, "")
}
singleCount := 0
var hasSeqList []uint32
for i := 0; i < len(sChat.Msg); i++ {
msg := new(open_im_sdk.MsgData)
if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil {
log.NewError(operationID, "Unmarshal err", msg.String(), err.Error())
return nil, nil, nil, err
}
if isContainInt32(msg.Seq, seqList) {
indexList = append(indexList, i)
seqMsg = append(seqMsg, msg)
hasSeqList = append(hasSeqList, msg.Seq)
singleCount++
if singleCount == len(seqList) {
break
}
}
}
for _, i := range seqList {
if isContainInt32(i, hasSeqList) {
continue
}
unexistSeqList = append(unexistSeqList, i)
}
return seqMsg, indexList, unexistSeqList, nil
}
func genExceptionMessageBySeqList(seqList []uint32) (exceptionMsg []*open_im_sdk.MsgData) {
for _, v := range seqList {
msg := new(open_im_sdk.MsgData)
msg.Seq = v
exceptionMsg = append(exceptionMsg, msg)
}
return exceptionMsg
}
func genExceptionSuperGroupMessageBySeqList(seqList []uint32, groupID string) (exceptionMsg []*open_im_sdk.MsgData) {
for _, v := range seqList {
msg := new(open_im_sdk.MsgData)
msg.Seq = v
msg.GroupID = groupID
msg.SessionType = constant.SuperGroupChatType
exceptionMsg = append(exceptionMsg, msg)
}
return exceptionMsg
}
func (d *db.DataBases) SaveUserChatMongo2(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
newTime := getCurrentTimestampByMill()
operationID := ""
seqUid := getSeqUid(uid, m.MsgData.Seq)
filter := bson.M{"uid": seqUid}
var err error
sMsg := MsgInfo{}
sMsg.SendTime = sendTime
if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil {
return utils.Wrap(err, "")
}
err = c.FindOneAndUpdate(ctx, filter, bson.M{"$push": bson.M{"msg": sMsg}}).Err()
log.NewWarn(operationID, "get mgoSession cost time", getCurrentTimestampByMill()-newTime)
if err != nil {
sChat := UserChat{}
sChat.UID = seqUid
sChat.Msg = append(sChat.Msg, sMsg)
if _, err = c.InsertOne(ctx, &sChat); err != nil {
log.NewDebug(operationID, "InsertOne failed", filter)
return utils.Wrap(err, "")
}
} else {
log.NewDebug(operationID, "FindOneAndUpdate ok", filter)
}
log.NewDebug(operationID, "find mgo uid cost time", getCurrentTimestampByMill()-newTime)
return nil
}
func (d *db.DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error {
var seqUid string
newTime := getCurrentTimestampByMill()
session := d.mgoSession.Clone()
if session == nil {
return errors.New("session == nil")
}
defer session.Close()
log.NewDebug("", "get mgoSession cost time", getCurrentTimestampByMill()-newTime)
c := session.DB(config.Config.Mongo.DBDatabase).C(cChat)
seqUid = getSeqUid(uid, m.MsgData.Seq)
n, err := c.Find(bson.M{"uid": seqUid}).Count()
if err != nil {
return err
}
log.NewDebug("", "find mgo uid cost time", getCurrentTimestampByMill()-newTime)
sMsg := MsgInfo{}
sMsg.SendTime = sendTime
if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil {
return err
}
if n == 0 {
sChat := UserChat{}
sChat.UID = seqUid
sChat.Msg = append(sChat.Msg, sMsg)
err = c.Insert(&sChat)
if err != nil {
return err
}
} else {
err = c.Update(bson.M{"uid": seqUid}, bson.M{"$push": bson.M{"msg": sMsg}})
if err != nil {
return err
}
}
log.NewDebug("", "insert mgo data cost time", getCurrentTimestampByMill()-newTime)
return nil
}
func (d *db.DataBases) DelUserChatMongo2(uid string) error {
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
filter := bson.M{"uid": uid}
delTime := time.Now().Unix() - int64(config.Config.Mongo.DBRetainChatRecords)*24*3600
if _, err := c.UpdateOne(ctx, filter, bson.M{"$pull": bson.M{"msg": bson.M{"sendtime": bson.M{"$lte": delTime}}}}); err != nil {
return utils.Wrap(err, "")
}
return nil
}
func (d *db.DataBases) MgoSkipUID(count int) (string, error) {
return "", nil
}
func (d *db.DataBases) CleanUpUserMsgFromMongo(userID string, operationID string) error {
ctx := context.Background()
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat)
maxSeq, err := d.GetUserMaxSeq(userID)
if err == redis.Nil {
return nil
}
if err != nil {
return utils.Wrap(err, "")
}
seqUsers := getSeqUserIDList(userID, uint32(maxSeq))
log.Error(operationID, "getSeqUserIDList", seqUsers)
_, err = c.DeleteMany(ctx, bson.M{"uid": bson.M{"$in": seqUsers}})
if err == mongo.ErrNoDocuments {
return nil
}
return utils.Wrap(err, "")
}
-14
View File
@@ -111,20 +111,6 @@ type SuperGroupMongoDriver struct {
// panic("implement me")
// }
func (s *SuperGroupMongoDriver) Transaction(ctx context.Context, fn func(s unrelation.SuperGroupModelInterface, tx any) error) error {
sess, err := s.MgoClient.StartSession()
if err != nil {
return err
}
txCtx := mongo.NewSessionContext(ctx, sess)
defer sess.EndSession(txCtx)
if err := fn(s, txCtx); err != nil {
_ = sess.AbortTransaction(txCtx)
return err
}
return utils.Wrap(sess.CommitTransaction(txCtx), "")
}
func (s *SuperGroupMongoDriver) getTxCtx(ctx context.Context, tx []any) context.Context {
if len(tx) > 0 {
if ctx, ok := tx[0].(mongo.SessionContext); ok {
+7
View File
@@ -7,6 +7,9 @@ import (
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"math/rand"
"strconv"
"time"
)
type TagMongoDriver struct {
@@ -19,6 +22,10 @@ func NewTagMongoDriver(mgoDB *mongo.Database) *TagMongoDriver {
return &TagMongoDriver{mgoDB: mgoDB, TagCollection: mgoDB.Collection(unrelation.CTag), TagSendLogCollection: mgoDB.Collection(unrelation.CSendLog)}
}
func (db *TagMongoDriver) generateTagID(tagName, userID string) string {
return utils.Md5(tagName + userID + strconv.Itoa(rand.Int()) + time.Now().String())
}
func (db *TagMongoDriver) GetUserTags(ctx context.Context, userID string) ([]unrelation.TagModel, error) {
var tags []unrelation.TagModel
cursor, err := db.TagCollection.Find(ctx, bson.M{"user_id": userID})
+12 -1
View File
@@ -4,10 +4,13 @@ import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/db/table/unrelation"
"Open_IM/pkg/utils"
"context"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"math/rand"
"strconv"
"time"
)
@@ -20,8 +23,16 @@ func NewWorkMomentMongoDriver(mgoDB *mongo.Database) *WorkMomentMongoDriver {
return &WorkMomentMongoDriver{mgoDB: mgoDB, WorkMomentCollection: mgoDB.Collection(unrelation.CWorkMoment)}
}
func (db *WorkMomentMongoDriver) generateWorkMomentID(userID string) string {
return utils.Md5(userID + strconv.Itoa(rand.Int()) + time.Now().String())
}
func (db *WorkMomentMongoDriver) generateWorkMomentCommentID(workMomentID string) string {
return utils.Md5(workMomentID + strconv.Itoa(rand.Int()) + time.Now().String())
}
func (db *WorkMomentMongoDriver) CreateOneWorkMoment(ctx context.Context, workMoment *unrelation.WorkMoment) error {
workMomentID := generateWorkMomentID(workMoment.UserID)
workMomentID := db.generateWorkMomentID(workMoment.UserID)
workMoment.WorkMomentID = workMomentID
workMoment.CreateTime = int32(time.Now().Unix())
_, err := db.WorkMomentCollection.InsertOne(ctx, workMoment)
@@ -1,12 +1,12 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: admin_cms/admin_cms.proto
package admin_cms // import "Open_IM/pkg/proto/admin_cms"
package admincms // import "Open_IM/pkg/proto/admin_cms"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
import sdkws "Open_IM/pkg/proto/sdkws"
import (
context "golang.org/x/net/context"
@@ -125,16 +125,16 @@ func (m *AdminLoginResp) GetFaceURL() string {
}
type GetChatLogsReq struct {
Content string `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"`
SendID string `protobuf:"bytes,2,opt,name=sendID" json:"sendID,omitempty"`
RecvID string `protobuf:"bytes,3,opt,name=recvID" json:"recvID,omitempty"`
SendTime string `protobuf:"bytes,4,opt,name=sendTime" json:"sendTime,omitempty"`
SessionType int32 `protobuf:"varint,5,opt,name=sessionType" json:"sessionType,omitempty"`
ContentType int32 `protobuf:"varint,6,opt,name=contentType" json:"contentType,omitempty"`
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,7,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Content string `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"`
SendID string `protobuf:"bytes,2,opt,name=sendID" json:"sendID,omitempty"`
RecvID string `protobuf:"bytes,3,opt,name=recvID" json:"recvID,omitempty"`
SendTime string `protobuf:"bytes,4,opt,name=sendTime" json:"sendTime,omitempty"`
SessionType int32 `protobuf:"varint,5,opt,name=sessionType" json:"sessionType,omitempty"`
ContentType int32 `protobuf:"varint,6,opt,name=contentType" json:"contentType,omitempty"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,7,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetChatLogsReq) Reset() { *m = GetChatLogsReq{} }
@@ -203,7 +203,7 @@ func (m *GetChatLogsReq) GetContentType() int32 {
return 0
}
func (m *GetChatLogsReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetChatLogsReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -1107,14 +1107,14 @@ func (m *GetUserStatisticsResp) GetTotalUserNumList() []*DateNumList {
}
type GetUserFriendsReq struct {
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
FriendUserID string `protobuf:"bytes,3,opt,name=friendUserID" json:"friendUserID,omitempty"`
FriendUserName string `protobuf:"bytes,4,opt,name=friendUserName" json:"friendUserName,omitempty"`
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,5,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
FriendUserID string `protobuf:"bytes,3,opt,name=friendUserID" json:"friendUserID,omitempty"`
FriendUserName string `protobuf:"bytes,4,opt,name=friendUserName" json:"friendUserName,omitempty"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,5,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetUserFriendsReq) Reset() { *m = GetUserFriendsReq{} }
@@ -1169,7 +1169,7 @@ func (m *GetUserFriendsReq) GetFriendUserName() string {
return ""
}
func (m *GetUserFriendsReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetUserFriendsReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -1177,11 +1177,11 @@ func (m *GetUserFriendsReq) GetPagination() *sdk_ws.RequestPagination {
}
type GetUserFriendsResp struct {
FriendInfoList []*sdk_ws.FriendInfo `protobuf:"bytes,2,rep,name=friendInfoList" json:"friendInfoList,omitempty"`
FriendNums int32 `protobuf:"varint,3,opt,name=friendNums" json:"friendNums,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
FriendInfoList []*sdkws.FriendInfo `protobuf:"bytes,2,rep,name=friendInfoList" json:"friendInfoList,omitempty"`
FriendNums int32 `protobuf:"varint,3,opt,name=friendNums" json:"friendNums,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetUserFriendsResp) Reset() { *m = GetUserFriendsResp{} }
@@ -1208,7 +1208,7 @@ func (m *GetUserFriendsResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetUserFriendsResp proto.InternalMessageInfo
func (m *GetUserFriendsResp) GetFriendInfoList() []*sdk_ws.FriendInfo {
func (m *GetUserFriendsResp) GetFriendInfoList() []*sdkws.FriendInfo {
if m != nil {
return m.FriendInfoList
}
@@ -1,7 +1,7 @@
syntax = "proto3";
option go_package = "Open_IM/pkg/proto/admin_cms;admin_cms";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
package admin_cms;
option go_package = "Open_IM/pkg/proto/admincms;admincms";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
package admincms;
message AdminLoginReq {
string adminID = 2;
@@ -21,7 +21,7 @@ message GetChatLogsReq {
string sendTime = 4;
int32 sessionType = 5;
int32 contentType = 6;
server_api_params.RequestPagination pagination = 7;
sdkws.RequestPagination pagination = 7;
}
message ChatLog {
@@ -134,11 +134,11 @@ message GetUserFriendsReq {
string userID = 2;
string friendUserID = 3;
string friendUserName = 4;
server_api_params.RequestPagination pagination = 5;
sdkws.RequestPagination pagination = 5;
}
message GetUserFriendsResp {
repeated server_api_params.FriendInfo friendInfoList = 2;
repeated sdkws.FriendInfo friendInfoList = 2;
int32 friendNums = 3;
}
+1 -1
View File
@@ -6,7 +6,7 @@ package pbAuth // import "Open_IM/pkg/proto/auth"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "Open_IM/pkg/proto/sdk_ws"
import _ "Open_IM/pkg/proto/sdkws"
import (
context "golang.org/x/net/context"
+1 -1
View File
@@ -1,5 +1,5 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
package pbAuth;
option go_package = "Open_IM/pkg/proto/auth;pbAuth";
+1 -1
View File
@@ -22,7 +22,7 @@ for ((i = 0; i < ${#filelist[*]}; i++)); do
cp $proto ${proto#*./Open_IM/pkg/proto/}
done
rm Open_IM -rf
#find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdk_ws\"/\"Open_IM\/pkg\/proto\/sdk_ws\"/g'
#find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdkws\"/\"Open_IM\/pkg\/proto\/sdkws\"/g'
+54 -54
View File
@@ -6,7 +6,7 @@ package friend // import "Open_IM/pkg/proto/friend"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
import sdkws "Open_IM/pkg/proto/sdkws"
import (
context "golang.org/x/net/context"
@@ -71,10 +71,10 @@ func (m *GetPaginationFriendsReq) GetFriendUserIDs() []string {
}
type GetPaginationFriendsResp struct {
FriendsInfo []*sdk_ws.FriendInfo `protobuf:"bytes,1,rep,name=friendsInfo" json:"friendsInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
FriendsInfo []*sdkws.FriendInfo `protobuf:"bytes,1,rep,name=friendsInfo" json:"friendsInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationFriendsResp) Reset() { *m = GetPaginationFriendsResp{} }
@@ -101,7 +101,7 @@ func (m *GetPaginationFriendsResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetPaginationFriendsResp proto.InternalMessageInfo
func (m *GetPaginationFriendsResp) GetFriendsInfo() []*sdk_ws.FriendInfo {
func (m *GetPaginationFriendsResp) GetFriendsInfo() []*sdkws.FriendInfo {
if m != nil {
return m.FriendsInfo
}
@@ -277,11 +277,11 @@ func (m *ImportFriendResp) XXX_DiscardUnknown() {
var xxx_messageInfo_ImportFriendResp proto.InternalMessageInfo
type GetPaginationFriendsApplyToReq struct {
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationFriendsApplyToReq) Reset() { *m = GetPaginationFriendsApplyToReq{} }
@@ -315,7 +315,7 @@ func (m *GetPaginationFriendsApplyToReq) GetUserID() string {
return ""
}
func (m *GetPaginationFriendsApplyToReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetPaginationFriendsApplyToReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -323,11 +323,11 @@ func (m *GetPaginationFriendsApplyToReq) GetPagination() *sdk_ws.RequestPaginati
}
type GetPaginationFriendsApplyToResp struct {
FriendRequests []*sdk_ws.FriendRequest `protobuf:"bytes,1,rep,name=FriendRequests" json:"FriendRequests,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
FriendRequests []*sdkws.FriendRequest `protobuf:"bytes,1,rep,name=FriendRequests" json:"FriendRequests,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationFriendsApplyToResp) Reset() { *m = GetPaginationFriendsApplyToResp{} }
@@ -354,7 +354,7 @@ func (m *GetPaginationFriendsApplyToResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetPaginationFriendsApplyToResp proto.InternalMessageInfo
func (m *GetPaginationFriendsApplyToResp) GetFriendRequests() []*sdk_ws.FriendRequest {
func (m *GetPaginationFriendsApplyToResp) GetFriendRequests() []*sdkws.FriendRequest {
if m != nil {
return m.FriendRequests
}
@@ -369,11 +369,11 @@ func (m *GetPaginationFriendsApplyToResp) GetTotal() int32 {
}
type GetDesignatedFriendsReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetDesignatedFriendsReq) Reset() { *m = GetDesignatedFriendsReq{} }
@@ -400,7 +400,7 @@ func (m *GetDesignatedFriendsReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetDesignatedFriendsReq proto.InternalMessageInfo
func (m *GetDesignatedFriendsReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetDesignatedFriendsReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -415,11 +415,11 @@ func (m *GetDesignatedFriendsReq) GetUserID() string {
}
type GetDesignatedFriendsResp struct {
FriendsInfo []*sdk_ws.FriendInfo `protobuf:"bytes,1,rep,name=FriendsInfo" json:"FriendsInfo,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
FriendsInfo []*sdkws.FriendInfo `protobuf:"bytes,1,rep,name=FriendsInfo" json:"FriendsInfo,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetDesignatedFriendsResp) Reset() { *m = GetDesignatedFriendsResp{} }
@@ -446,7 +446,7 @@ func (m *GetDesignatedFriendsResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetDesignatedFriendsResp proto.InternalMessageInfo
func (m *GetDesignatedFriendsResp) GetFriendsInfo() []*sdk_ws.FriendInfo {
func (m *GetDesignatedFriendsResp) GetFriendsInfo() []*sdkws.FriendInfo {
if m != nil {
return m.FriendsInfo
}
@@ -613,11 +613,11 @@ func (m *RemoveBlackResp) XXX_DiscardUnknown() {
var xxx_messageInfo_RemoveBlackResp proto.InternalMessageInfo
type GetPaginationBlacksReq struct {
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationBlacksReq) Reset() { *m = GetPaginationBlacksReq{} }
@@ -651,7 +651,7 @@ func (m *GetPaginationBlacksReq) GetUserID() string {
return ""
}
func (m *GetPaginationBlacksReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetPaginationBlacksReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -659,11 +659,11 @@ func (m *GetPaginationBlacksReq) GetPagination() *sdk_ws.RequestPagination {
}
type GetPaginationBlacksResp struct {
Blacks []*sdk_ws.BlackInfo `protobuf:"bytes,1,rep,name=blacks" json:"blacks,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Blacks []*sdkws.BlackInfo `protobuf:"bytes,1,rep,name=blacks" json:"blacks,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationBlacksResp) Reset() { *m = GetPaginationBlacksResp{} }
@@ -690,7 +690,7 @@ func (m *GetPaginationBlacksResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetPaginationBlacksResp proto.InternalMessageInfo
func (m *GetPaginationBlacksResp) GetBlacks() []*sdk_ws.BlackInfo {
func (m *GetPaginationBlacksResp) GetBlacks() []*sdkws.BlackInfo {
if m != nil {
return m.Blacks
}
@@ -1142,11 +1142,11 @@ func (m *SetFriendRemarkResp) XXX_DiscardUnknown() {
var xxx_messageInfo_SetFriendRemarkResp proto.InternalMessageInfo
type GetPaginationFriendsApplyFromReq struct {
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationFriendsApplyFromReq) Reset() { *m = GetPaginationFriendsApplyFromReq{} }
@@ -1180,7 +1180,7 @@ func (m *GetPaginationFriendsApplyFromReq) GetUserID() string {
return ""
}
func (m *GetPaginationFriendsApplyFromReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetPaginationFriendsApplyFromReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -1188,11 +1188,11 @@ func (m *GetPaginationFriendsApplyFromReq) GetPagination() *sdk_ws.RequestPagina
}
type GetPaginationFriendsApplyFromResp struct {
FriendRequests []*sdk_ws.FriendRequest `protobuf:"bytes,1,rep,name=friendRequests" json:"friendRequests,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
FriendRequests []*sdkws.FriendRequest `protobuf:"bytes,1,rep,name=friendRequests" json:"friendRequests,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total" json:"total,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationFriendsApplyFromResp) Reset() { *m = GetPaginationFriendsApplyFromResp{} }
@@ -1219,7 +1219,7 @@ func (m *GetPaginationFriendsApplyFromResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetPaginationFriendsApplyFromResp proto.InternalMessageInfo
func (m *GetPaginationFriendsApplyFromResp) GetFriendRequests() []*sdk_ws.FriendRequest {
func (m *GetPaginationFriendsApplyFromResp) GetFriendRequests() []*sdkws.FriendRequest {
if m != nil {
return m.FriendRequests
}
+10 -10
View File
@@ -1,5 +1,5 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
option go_package = "Open_IM/pkg/proto/friend;friend";
package friend;
@@ -8,7 +8,7 @@ message getPaginationFriendsReq{
repeated string friendUserIDs = 2;
}
message getPaginationFriendsResp{
repeated server_api_params.FriendInfo friendsInfo = 1;
repeated sdkws.FriendInfo friendsInfo = 1;
}
@@ -33,21 +33,21 @@ message importFriendResp{
message getPaginationFriendsApplyToReq{
string userID = 1;
server_api_params.RequestPagination pagination = 2;
sdkws.RequestPagination pagination = 2;
}
message getPaginationFriendsApplyToResp{
repeated server_api_params.FriendRequest FriendRequests = 1;
repeated sdkws.FriendRequest FriendRequests = 1;
int32 total = 2;
}
message getDesignatedFriendsReq{
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
string userID = 2;
}
message getDesignatedFriendsResp{
repeated server_api_params.FriendInfo FriendsInfo = 1;
repeated sdkws.FriendInfo FriendsInfo = 1;
int32 total = 2;
}
@@ -69,10 +69,10 @@ message removeBlackResp{
message getPaginationBlacksReq{
string userID = 1;
server_api_params.RequestPagination pagination = 2;
sdkws.RequestPagination pagination = 2;
}
message getPaginationBlacksResp{
repeated server_api_params.BlackInfo blacks= 1;
repeated sdkws.BlackInfo blacks= 1;
int32 total = 2;
}
@@ -124,10 +124,10 @@ message setFriendRemarkResp{
message getPaginationFriendsApplyFromReq{
string userID = 1;
server_api_params.RequestPagination pagination = 2;
sdkws.RequestPagination pagination = 2;
}
message getPaginationFriendsApplyFromResp{
repeated server_api_params.FriendRequest friendRequests = 1;
repeated sdkws.FriendRequest friendRequests = 1;
int32 total = 2;
}
+131 -131
View File
@@ -6,7 +6,7 @@ package group // import "Open_IM/pkg/proto/group"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
import sdkws "Open_IM/pkg/proto/sdkws"
import wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
import (
@@ -26,13 +26,13 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type CreateGroupReq struct {
InitMembers []string `protobuf:"bytes,1,rep,name=initMembers" json:"initMembers,omitempty"`
GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,2,opt,name=groupInfo" json:"groupInfo,omitempty"`
AdminUserIDs []string `protobuf:"bytes,3,rep,name=adminUserIDs" json:"adminUserIDs,omitempty"`
OwnerUserID string `protobuf:"bytes,4,opt,name=ownerUserID" json:"ownerUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
InitMembers []string `protobuf:"bytes,1,rep,name=initMembers" json:"initMembers,omitempty"`
GroupInfo *sdkws.GroupInfo `protobuf:"bytes,2,opt,name=groupInfo" json:"groupInfo,omitempty"`
AdminUserIDs []string `protobuf:"bytes,3,rep,name=adminUserIDs" json:"adminUserIDs,omitempty"`
OwnerUserID string `protobuf:"bytes,4,opt,name=ownerUserID" json:"ownerUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateGroupReq) Reset() { *m = CreateGroupReq{} }
@@ -66,7 +66,7 @@ func (m *CreateGroupReq) GetInitMembers() []string {
return nil
}
func (m *CreateGroupReq) GetGroupInfo() *sdk_ws.GroupInfo {
func (m *CreateGroupReq) GetGroupInfo() *sdkws.GroupInfo {
if m != nil {
return m.GroupInfo
}
@@ -88,10 +88,10 @@ func (m *CreateGroupReq) GetOwnerUserID() string {
}
type CreateGroupResp struct {
GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,1,opt,name=groupInfo" json:"groupInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
GroupInfo *sdkws.GroupInfo `protobuf:"bytes,1,opt,name=groupInfo" json:"groupInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateGroupResp) Reset() { *m = CreateGroupResp{} }
@@ -118,7 +118,7 @@ func (m *CreateGroupResp) XXX_DiscardUnknown() {
var xxx_messageInfo_CreateGroupResp proto.InternalMessageInfo
func (m *CreateGroupResp) GetGroupInfo() *sdk_ws.GroupInfo {
func (m *CreateGroupResp) GetGroupInfo() *sdkws.GroupInfo {
if m != nil {
return m.GroupInfo
}
@@ -164,10 +164,10 @@ func (m *GetGroupsInfoReq) GetGroupIDs() []string {
}
type GetGroupsInfoResp struct {
GroupInfos []*sdk_ws.GroupInfo `protobuf:"bytes,1,rep,name=groupInfos" json:"groupInfos,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
GroupInfos []*sdkws.GroupInfo `protobuf:"bytes,1,rep,name=groupInfos" json:"groupInfos,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupsInfoResp) Reset() { *m = GetGroupsInfoResp{} }
@@ -194,7 +194,7 @@ func (m *GetGroupsInfoResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetGroupsInfoResp proto.InternalMessageInfo
func (m *GetGroupsInfoResp) GetGroupInfos() []*sdk_ws.GroupInfo {
func (m *GetGroupsInfoResp) GetGroupInfos() []*sdkws.GroupInfo {
if m != nil {
return m.GroupInfos
}
@@ -202,10 +202,10 @@ func (m *GetGroupsInfoResp) GetGroupInfos() []*sdk_ws.GroupInfo {
}
type SetGroupInfoReq struct {
GroupInfoForSet *sdk_ws.GroupInfoForSet `protobuf:"bytes,1,opt,name=groupInfoForSet" json:"groupInfoForSet,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
GroupInfoForSet *sdkws.GroupInfoForSet `protobuf:"bytes,1,opt,name=groupInfoForSet" json:"groupInfoForSet,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SetGroupInfoReq) Reset() { *m = SetGroupInfoReq{} }
@@ -232,7 +232,7 @@ func (m *SetGroupInfoReq) XXX_DiscardUnknown() {
var xxx_messageInfo_SetGroupInfoReq proto.InternalMessageInfo
func (m *SetGroupInfoReq) GetGroupInfoForSet() *sdk_ws.GroupInfoForSet {
func (m *SetGroupInfoReq) GetGroupInfoForSet() *sdkws.GroupInfoForSet {
if m != nil {
return m.GroupInfoForSet
}
@@ -270,11 +270,11 @@ func (m *SetGroupInfoResp) XXX_DiscardUnknown() {
var xxx_messageInfo_SetGroupInfoResp proto.InternalMessageInfo
type GetGroupApplicationListReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
FromUserID string `protobuf:"bytes,2,opt,name=fromUserID" json:"fromUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
FromUserID string `protobuf:"bytes,2,opt,name=fromUserID" json:"fromUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupApplicationListReq) Reset() { *m = GetGroupApplicationListReq{} }
@@ -301,7 +301,7 @@ func (m *GetGroupApplicationListReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetGroupApplicationListReq proto.InternalMessageInfo
func (m *GetGroupApplicationListReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetGroupApplicationListReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -316,11 +316,11 @@ func (m *GetGroupApplicationListReq) GetFromUserID() string {
}
type GetGroupApplicationListResp struct {
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
GroupRequests []*sdk_ws.GroupRequest `protobuf:"bytes,2,rep,name=groupRequests" json:"groupRequests,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
GroupRequests []*sdkws.GroupRequest `protobuf:"bytes,2,rep,name=groupRequests" json:"groupRequests,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupApplicationListResp) Reset() { *m = GetGroupApplicationListResp{} }
@@ -354,7 +354,7 @@ func (m *GetGroupApplicationListResp) GetTotal() uint32 {
return 0
}
func (m *GetGroupApplicationListResp) GetGroupRequests() []*sdk_ws.GroupRequest {
func (m *GetGroupApplicationListResp) GetGroupRequests() []*sdkws.GroupRequest {
if m != nil {
return m.GroupRequests
}
@@ -362,11 +362,11 @@ func (m *GetGroupApplicationListResp) GetGroupRequests() []*sdk_ws.GroupRequest
}
type GetUserReqApplicationListReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetUserReqApplicationListReq) Reset() { *m = GetUserReqApplicationListReq{} }
@@ -393,7 +393,7 @@ func (m *GetUserReqApplicationListReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetUserReqApplicationListReq proto.InternalMessageInfo
func (m *GetUserReqApplicationListReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetUserReqApplicationListReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -408,11 +408,11 @@ func (m *GetUserReqApplicationListReq) GetUserID() string {
}
type GetUserReqApplicationListResp struct {
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
GroupRequests []*sdk_ws.GroupRequest `protobuf:"bytes,2,rep,name=groupRequests" json:"groupRequests,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
GroupRequests []*sdkws.GroupRequest `protobuf:"bytes,2,rep,name=groupRequests" json:"groupRequests,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetUserReqApplicationListResp) Reset() { *m = GetUserReqApplicationListResp{} }
@@ -446,7 +446,7 @@ func (m *GetUserReqApplicationListResp) GetTotal() uint32 {
return 0
}
func (m *GetUserReqApplicationListResp) GetGroupRequests() []*sdk_ws.GroupRequest {
func (m *GetUserReqApplicationListResp) GetGroupRequests() []*sdkws.GroupRequest {
if m != nil {
return m.GroupRequests
}
@@ -790,12 +790,12 @@ func (m *QuitGroupResp) XXX_DiscardUnknown() {
var xxx_messageInfo_QuitGroupResp proto.InternalMessageInfo
type GetGroupMemberListReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"`
Filter int32 `protobuf:"varint,3,opt,name=filter" json:"filter,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"`
Filter int32 `protobuf:"varint,3,opt,name=filter" json:"filter,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupMemberListReq) Reset() { *m = GetGroupMemberListReq{} }
@@ -822,7 +822,7 @@ func (m *GetGroupMemberListReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetGroupMemberListReq proto.InternalMessageInfo
func (m *GetGroupMemberListReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetGroupMemberListReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -844,11 +844,11 @@ func (m *GetGroupMemberListReq) GetFilter() int32 {
}
type GetGroupMemberListResp struct {
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Members []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupMemberListResp) Reset() { *m = GetGroupMemberListResp{} }
@@ -882,7 +882,7 @@ func (m *GetGroupMemberListResp) GetTotal() uint32 {
return 0
}
func (m *GetGroupMemberListResp) GetMembers() []*sdk_ws.GroupMemberFullInfo {
func (m *GetGroupMemberListResp) GetMembers() []*sdkws.GroupMemberFullInfo {
if m != nil {
return m.Members
}
@@ -936,10 +936,10 @@ func (m *GetGroupMembersInfoReq) GetMembers() []string {
}
type GetGroupMembersInfoResp struct {
Members []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupMembersInfoResp) Reset() { *m = GetGroupMembersInfoResp{} }
@@ -966,7 +966,7 @@ func (m *GetGroupMembersInfoResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetGroupMembersInfoResp proto.InternalMessageInfo
func (m *GetGroupMembersInfoResp) GetMembers() []*sdk_ws.GroupMemberFullInfo {
func (m *GetGroupMembersInfoResp) GetMembers() []*sdkws.GroupMemberFullInfo {
if m != nil {
return m.Members
}
@@ -1058,11 +1058,11 @@ func (m *KickGroupMemberResp) XXX_DiscardUnknown() {
var xxx_messageInfo_KickGroupMemberResp proto.InternalMessageInfo
type GetJoinedGroupListReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
FromUserID string `protobuf:"bytes,2,opt,name=fromUserID" json:"fromUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
FromUserID string `protobuf:"bytes,2,opt,name=fromUserID" json:"fromUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetJoinedGroupListReq) Reset() { *m = GetJoinedGroupListReq{} }
@@ -1089,7 +1089,7 @@ func (m *GetJoinedGroupListReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetJoinedGroupListReq proto.InternalMessageInfo
func (m *GetJoinedGroupListReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetJoinedGroupListReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -1104,11 +1104,11 @@ func (m *GetJoinedGroupListReq) GetFromUserID() string {
}
type GetJoinedGroupListResp struct {
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Groups []*sdk_ws.GroupInfo `protobuf:"bytes,2,rep,name=groups" json:"groups,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Groups []*sdkws.GroupInfo `protobuf:"bytes,2,rep,name=groups" json:"groups,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetJoinedGroupListResp) Reset() { *m = GetJoinedGroupListResp{} }
@@ -1142,7 +1142,7 @@ func (m *GetJoinedGroupListResp) GetTotal() uint32 {
return 0
}
func (m *GetJoinedGroupListResp) GetGroups() []*sdk_ws.GroupInfo {
func (m *GetJoinedGroupListResp) GetGroups() []*sdkws.GroupInfo {
if m != nil {
return m.Groups
}
@@ -1234,11 +1234,11 @@ func (m *InviteUserToGroupResp) XXX_DiscardUnknown() {
var xxx_messageInfo_InviteUserToGroupResp proto.InternalMessageInfo
type GetGroupAllMemberReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupAllMemberReq) Reset() { *m = GetGroupAllMemberReq{} }
@@ -1265,7 +1265,7 @@ func (m *GetGroupAllMemberReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetGroupAllMemberReq proto.InternalMessageInfo
func (m *GetGroupAllMemberReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetGroupAllMemberReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -1280,10 +1280,10 @@ func (m *GetGroupAllMemberReq) GetGroupID() string {
}
type GetGroupAllMemberResp struct {
Members []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupAllMemberResp) Reset() { *m = GetGroupAllMemberResp{} }
@@ -1310,7 +1310,7 @@ func (m *GetGroupAllMemberResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetGroupAllMemberResp proto.InternalMessageInfo
func (m *GetGroupAllMemberResp) GetMembers() []*sdk_ws.GroupMemberFullInfo {
func (m *GetGroupAllMemberResp) GetMembers() []*sdkws.GroupMemberFullInfo {
if m != nil {
return m.Members
}
@@ -1318,12 +1318,12 @@ func (m *GetGroupAllMemberResp) GetMembers() []*sdk_ws.GroupMemberFullInfo {
}
type CMSGroup struct {
GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,1,opt,name=groupInfo" json:"groupInfo,omitempty"`
GroupOwnerUserName string `protobuf:"bytes,2,opt,name=groupOwnerUserName" json:"groupOwnerUserName,omitempty"`
GroupOwnerUserID string `protobuf:"bytes,3,opt,name=groupOwnerUserID" json:"groupOwnerUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
GroupInfo *sdkws.GroupInfo `protobuf:"bytes,1,opt,name=groupInfo" json:"groupInfo,omitempty"`
GroupOwnerUserName string `protobuf:"bytes,2,opt,name=groupOwnerUserName" json:"groupOwnerUserName,omitempty"`
GroupOwnerUserID string `protobuf:"bytes,3,opt,name=groupOwnerUserID" json:"groupOwnerUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CMSGroup) Reset() { *m = CMSGroup{} }
@@ -1350,7 +1350,7 @@ func (m *CMSGroup) XXX_DiscardUnknown() {
var xxx_messageInfo_CMSGroup proto.InternalMessageInfo
func (m *CMSGroup) GetGroupInfo() *sdk_ws.GroupInfo {
func (m *CMSGroup) GetGroupInfo() *sdkws.GroupInfo {
if m != nil {
return m.GroupInfo
}
@@ -1372,12 +1372,12 @@ func (m *CMSGroup) GetGroupOwnerUserID() string {
}
type GetGroupsReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"`
GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"`
GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupsReq) Reset() { *m = GetGroupsReq{} }
@@ -1404,7 +1404,7 @@ func (m *GetGroupsReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetGroupsReq proto.InternalMessageInfo
func (m *GetGroupsReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetGroupsReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -1510,12 +1510,12 @@ func (m *GetGroupMemberReq) GetGroupID() string {
}
type GetGroupMembersCMSReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"`
UserName string `protobuf:"bytes,3,opt,name=userName" json:"userName,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
GroupID string `protobuf:"bytes,2,opt,name=groupID" json:"groupID,omitempty"`
UserName string `protobuf:"bytes,3,opt,name=userName" json:"userName,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupMembersCMSReq) Reset() { *m = GetGroupMembersCMSReq{} }
@@ -1542,7 +1542,7 @@ func (m *GetGroupMembersCMSReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetGroupMembersCMSReq proto.InternalMessageInfo
func (m *GetGroupMembersCMSReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetGroupMembersCMSReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -1564,11 +1564,11 @@ func (m *GetGroupMembersCMSReq) GetUserName() string {
}
type GetGroupMembersCMSResp struct {
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Members []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetGroupMembersCMSResp) Reset() { *m = GetGroupMembersCMSResp{} }
@@ -1602,7 +1602,7 @@ func (m *GetGroupMembersCMSResp) GetTotal() uint32 {
return 0
}
func (m *GetGroupMembersCMSResp) GetMembers() []*sdk_ws.GroupMemberFullInfo {
func (m *GetGroupMembersCMSResp) GetMembers() []*sdkws.GroupMemberFullInfo {
if m != nil {
return m.Members
}
@@ -2096,10 +2096,10 @@ func (m *GetJoinedSuperGroupListReq) GetUserID() string {
}
type GetJoinedSuperGroupListResp struct {
Groups []*sdk_ws.GroupInfo `protobuf:"bytes,1,rep,name=groups" json:"groups,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Groups []*sdkws.GroupInfo `protobuf:"bytes,1,rep,name=groups" json:"groups,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetJoinedSuperGroupListResp) Reset() { *m = GetJoinedSuperGroupListResp{} }
@@ -2126,7 +2126,7 @@ func (m *GetJoinedSuperGroupListResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetJoinedSuperGroupListResp proto.InternalMessageInfo
func (m *GetJoinedSuperGroupListResp) GetGroups() []*sdk_ws.GroupInfo {
func (m *GetJoinedSuperGroupListResp) GetGroups() []*sdkws.GroupInfo {
if m != nil {
return m.Groups
}
@@ -2172,10 +2172,10 @@ func (m *GetSuperGroupsInfoReq) GetGroupIDs() []string {
}
type GetSuperGroupsInfoResp struct {
GroupInfos []*sdk_ws.GroupInfo `protobuf:"bytes,1,rep,name=groupInfos" json:"groupInfos,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
GroupInfos []*sdkws.GroupInfo `protobuf:"bytes,1,rep,name=groupInfos" json:"groupInfos,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetSuperGroupsInfoResp) Reset() { *m = GetSuperGroupsInfoResp{} }
@@ -2202,7 +2202,7 @@ func (m *GetSuperGroupsInfoResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetSuperGroupsInfoResp proto.InternalMessageInfo
func (m *GetSuperGroupsInfoResp) GetGroupInfos() []*sdk_ws.GroupInfo {
func (m *GetSuperGroupsInfoResp) GetGroupInfos() []*sdkws.GroupInfo {
if m != nil {
return m.GroupInfos
}
@@ -2494,10 +2494,10 @@ func (m *GetUserInGroupMembersReq) GetGroupIDs() []string {
}
type GetUserInGroupMembersResp struct {
Members []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Members []*sdkws.GroupMemberFullInfo `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetUserInGroupMembersResp) Reset() { *m = GetUserInGroupMembersResp{} }
@@ -2524,7 +2524,7 @@ func (m *GetUserInGroupMembersResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetUserInGroupMembersResp proto.InternalMessageInfo
func (m *GetUserInGroupMembersResp) GetMembers() []*sdk_ws.GroupMemberFullInfo {
func (m *GetUserInGroupMembersResp) GetMembers() []*sdkws.GroupMemberFullInfo {
if m != nil {
return m.Members
}
+24 -24
View File
@@ -1,6 +1,6 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
import "Open-IM-Server/pkg/proto/sdkws/wrappers.proto";
option go_package = "Open_IM/pkg/proto/group;group";
package group;
@@ -8,12 +8,12 @@ package group;
message CreateGroupReq{
repeated string initMembers = 1;
server_api_params.GroupInfo groupInfo = 2;
sdkws.GroupInfo groupInfo = 2;
repeated string adminUserIDs = 3;
string ownerUserID = 4; //owner
}
message CreateGroupResp{
server_api_params.GroupInfo groupInfo = 1;
sdkws.GroupInfo groupInfo = 1;
}
@@ -21,34 +21,34 @@ message GetGroupsInfoReq{
repeated string groupIDs = 1;
}
message GetGroupsInfoResp{
repeated server_api_params.GroupInfo groupInfos = 1;
repeated sdkws.GroupInfo groupInfos = 1;
}
message SetGroupInfoReq{
server_api_params.GroupInfoForSet groupInfoForSet = 1;
sdkws.GroupInfoForSet groupInfoForSet = 1;
}
message SetGroupInfoResp{
}
message GetGroupApplicationListReq {
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
string fromUserID = 2; //owner or admin
}
message GetGroupApplicationListResp {
uint32 total = 1;
repeated server_api_params.GroupRequest groupRequests = 2;
repeated sdkws.GroupRequest groupRequests = 2;
}
message GetUserReqApplicationListReq{
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
string userID = 2;
}
message GetUserReqApplicationListResp{
uint32 total = 1;
repeated server_api_params.GroupRequest groupRequests = 2;
repeated sdkws.GroupRequest groupRequests = 2;
}
@@ -91,14 +91,14 @@ message QuitGroupResp{
message GetGroupMemberListReq {
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
string groupID = 2;
int32 filter = 3;
}
message GetGroupMemberListResp {
uint32 total = 1;
repeated server_api_params.GroupMemberFullInfo members = 2;
repeated sdkws.GroupMemberFullInfo members = 2;
}
@@ -108,7 +108,7 @@ message GetGroupMembersInfoReq {
}
message GetGroupMembersInfoResp {
repeated server_api_params.GroupMemberFullInfo members = 1;
repeated sdkws.GroupMemberFullInfo members = 1;
}
message KickGroupMemberReq {
@@ -123,12 +123,12 @@ message KickGroupMemberResp {
message GetJoinedGroupListReq {
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
string fromUserID = 2;
}
message GetJoinedGroupListResp{
uint32 total = 1;
repeated server_api_params.GroupInfo groups = 2;
repeated sdkws.GroupInfo groups = 2;
}
@@ -143,22 +143,22 @@ message InviteUserToGroupResp {
message GetGroupAllMemberReq {
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
string groupID = 2;
}
message GetGroupAllMemberResp {
repeated server_api_params.GroupMemberFullInfo members = 1;
repeated sdkws.GroupMemberFullInfo members = 1;
}
message CMSGroup {
server_api_params.GroupInfo groupInfo = 1;
sdkws.GroupInfo groupInfo = 1;
string groupOwnerUserName = 2;
string groupOwnerUserID = 3;
}
message GetGroupsReq {
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
string groupName = 2;
string groupID = 3;
}
@@ -173,14 +173,14 @@ message GetGroupMemberReq {
}
message GetGroupMembersCMSReq {
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
string groupID = 2;
string userName = 3;
}
message GetGroupMembersCMSResp {
uint32 total = 1;
repeated server_api_params.GroupMemberFullInfo members = 2;
repeated sdkws.GroupMemberFullInfo members = 2;
}
message DismissGroupReq{
@@ -243,7 +243,7 @@ message GetJoinedSuperGroupListReq {
}
message GetJoinedSuperGroupListResp {
repeated server_api_params.GroupInfo groups = 1;
repeated sdkws.GroupInfo groups = 1;
}
message GetSuperGroupsInfoReq {
@@ -251,7 +251,7 @@ message GetSuperGroupsInfoReq {
}
message GetSuperGroupsInfoResp {
repeated server_api_params.GroupInfo groupInfos = 1;
repeated sdkws.GroupInfo groupInfos = 1;
}
message SetGroupMemberInfoReq{
@@ -286,7 +286,7 @@ message getUserInGroupMembersReq {
repeated string groupIDs = 2;
}
message getUserInGroupMembersResp{
repeated server_api_params.GroupMemberFullInfo members = 1;
repeated sdkws.GroupMemberFullInfo members = 1;
}
service group{
+120 -120
View File
@@ -6,7 +6,7 @@ package msg // import "Open_IM/pkg/proto/msg"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
import sdkws "Open_IM/pkg/proto/sdkws"
import wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
import (
@@ -26,12 +26,12 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type MsgDataToMQ struct {
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
MsgData *sdkws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} }
@@ -72,7 +72,7 @@ func (m *MsgDataToMQ) GetOperationID() string {
return ""
}
func (m *MsgDataToMQ) GetMsgData() *sdk_ws.MsgData {
func (m *MsgDataToMQ) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
@@ -80,11 +80,11 @@ func (m *MsgDataToMQ) GetMsgData() *sdk_ws.MsgData {
}
type MsgDataToDB struct {
MsgData *sdk_ws.MsgData `protobuf:"bytes,1,opt,name=msgData" json:"msgData,omitempty"`
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
MsgData *sdkws.MsgData `protobuf:"bytes,1,opt,name=msgData" json:"msgData,omitempty"`
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MsgDataToDB) Reset() { *m = MsgDataToDB{} }
@@ -111,7 +111,7 @@ func (m *MsgDataToDB) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgDataToDB proto.InternalMessageInfo
func (m *MsgDataToDB) GetMsgData() *sdk_ws.MsgData {
func (m *MsgDataToDB) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
@@ -126,12 +126,12 @@ func (m *MsgDataToDB) GetOperationID() string {
}
type PushMsgDataToMQ struct {
OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"`
MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"`
MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} }
@@ -165,7 +165,7 @@ func (m *PushMsgDataToMQ) GetOperationID() string {
return ""
}
func (m *PushMsgDataToMQ) GetMsgData() *sdk_ws.MsgData {
func (m *PushMsgDataToMQ) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
@@ -370,12 +370,12 @@ func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 {
}
type SendMsgReq struct {
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"`
MsgData *sdkws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SendMsgReq) Reset() { *m = SendMsgReq{} }
@@ -416,7 +416,7 @@ func (m *SendMsgReq) GetOperationID() string {
return ""
}
func (m *SendMsgReq) GetMsgData() *sdk_ws.MsgData {
func (m *SendMsgReq) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
@@ -1056,12 +1056,12 @@ func (m *GetSuperGroupMsgReq) GetGroupID() string {
}
type GetSuperGroupMsgResp struct {
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
MsgData *sdkws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetSuperGroupMsgResp) Reset() { *m = GetSuperGroupMsgResp{} }
@@ -1102,7 +1102,7 @@ func (m *GetSuperGroupMsgResp) GetErrMsg() string {
return ""
}
func (m *GetSuperGroupMsgResp) GetMsgData() *sdk_ws.MsgData {
func (m *GetSuperGroupMsgResp) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
@@ -1156,12 +1156,12 @@ func (m *GetWriteDiffMsgReq) GetSeq() uint32 {
}
type GetWriteDiffMsgResp struct {
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
MsgData *sdkws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetWriteDiffMsgResp) Reset() { *m = GetWriteDiffMsgResp{} }
@@ -1202,7 +1202,7 @@ func (m *GetWriteDiffMsgResp) GetErrMsg() string {
return ""
}
func (m *GetWriteDiffMsgResp) GetMsgData() *sdk_ws.MsgData {
func (m *GetWriteDiffMsgResp) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
@@ -1210,20 +1210,20 @@ func (m *GetWriteDiffMsgResp) GetMsgData() *sdk_ws.MsgData {
}
type ModifyMessageReactionExtensionsReq struct {
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"`
OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"`
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"`
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"`
IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"`
OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"`
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
ReactionExtensionList map[string]*sdkws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"`
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"`
IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ModifyMessageReactionExtensionsReq) Reset() { *m = ModifyMessageReactionExtensionsReq{} }
@@ -1278,7 +1278,7 @@ func (m *ModifyMessageReactionExtensionsReq) GetSessionType() int32 {
return 0
}
func (m *ModifyMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdk_ws.KeyValue {
func (m *ModifyMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdkws.KeyValue {
if m != nil {
return m.ReactionExtensionList
}
@@ -1328,20 +1328,20 @@ func (m *ModifyMessageReactionExtensionsReq) GetMsgFirstModifyTime() int64 {
}
type SetMessageReactionExtensionsReq struct {
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"`
OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"`
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"`
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"`
IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
SourceID string `protobuf:"bytes,2,opt,name=sourceID" json:"sourceID,omitempty"`
OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"`
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
ReactionExtensionList map[string]*sdkws.KeyValue `protobuf:"bytes,5,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
ClientMsgID string `protobuf:"bytes,6,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
Ex *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"`
AttachedInfo *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=attachedInfo" json:"attachedInfo,omitempty"`
IsReact bool `protobuf:"varint,9,opt,name=isReact" json:"isReact,omitempty"`
IsExternalExtensions bool `protobuf:"varint,10,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
MsgFirstModifyTime int64 `protobuf:"varint,11,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SetMessageReactionExtensionsReq) Reset() { *m = SetMessageReactionExtensionsReq{} }
@@ -1396,7 +1396,7 @@ func (m *SetMessageReactionExtensionsReq) GetSessionType() int32 {
return 0
}
func (m *SetMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdk_ws.KeyValue {
func (m *SetMessageReactionExtensionsReq) GetReactionExtensionList() map[string]*sdkws.KeyValue {
if m != nil {
return m.ReactionExtensionList
}
@@ -1698,13 +1698,13 @@ func (m *GetMessageListReactionExtensionsResp) GetSingleMessageResult() []*Singl
}
type SingleMessageExtensionResult struct {
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
ReactionExtensionList map[string]*sdk_ws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"`
ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"`
ReactionExtensionList map[string]*sdkws.KeyValue `protobuf:"bytes,3,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SingleMessageExtensionResult) Reset() { *m = SingleMessageExtensionResult{} }
@@ -1745,7 +1745,7 @@ func (m *SingleMessageExtensionResult) GetErrMsg() string {
return ""
}
func (m *SingleMessageExtensionResult) GetReactionExtensionList() map[string]*sdk_ws.KeyValue {
func (m *SingleMessageExtensionResult) GetReactionExtensionList() map[string]*sdkws.KeyValue {
if m != nil {
return m.ReactionExtensionList
}
@@ -1822,17 +1822,17 @@ func (m *ModifyMessageReactionExtensionsResp) GetFailedList() []*ExtendMsgResp {
}
type DeleteMessageListReactionExtensionsReq struct {
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"`
SourceID string `protobuf:"bytes,3,opt,name=sourceID" json:"sourceID,omitempty"`
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
IsExternalExtensions bool `protobuf:"varint,6,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
MsgFirstModifyTime int64 `protobuf:"varint,7,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
ReactionExtensionList []*sdk_ws.KeyValue `protobuf:"bytes,8,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
OpUserID string `protobuf:"bytes,2,opt,name=opUserID" json:"opUserID,omitempty"`
SourceID string `protobuf:"bytes,3,opt,name=sourceID" json:"sourceID,omitempty"`
SessionType int32 `protobuf:"varint,4,opt,name=sessionType" json:"sessionType,omitempty"`
ClientMsgID string `protobuf:"bytes,5,opt,name=clientMsgID" json:"clientMsgID,omitempty"`
IsExternalExtensions bool `protobuf:"varint,6,opt,name=isExternalExtensions" json:"isExternalExtensions,omitempty"`
MsgFirstModifyTime int64 `protobuf:"varint,7,opt,name=msgFirstModifyTime" json:"msgFirstModifyTime,omitempty"`
ReactionExtensionList []*sdkws.KeyValue `protobuf:"bytes,8,rep,name=reactionExtensionList" json:"reactionExtensionList,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteMessageListReactionExtensionsReq) Reset() {
@@ -1910,7 +1910,7 @@ func (m *DeleteMessageListReactionExtensionsReq) GetMsgFirstModifyTime() int64 {
return 0
}
func (m *DeleteMessageListReactionExtensionsReq) GetReactionExtensionList() []*sdk_ws.KeyValue {
func (m *DeleteMessageListReactionExtensionsReq) GetReactionExtensionList() []*sdkws.KeyValue {
if m != nil {
return m.ReactionExtensionList
}
@@ -2098,12 +2098,12 @@ func (m *ExtendMsg) GetEx() string {
}
type KeyValueResp struct {
KeyValue *sdk_ws.KeyValue `protobuf:"bytes,1,opt,name=keyValue" json:"keyValue,omitempty"`
ErrCode int32 `protobuf:"varint,2,opt,name=errCode" json:"errCode,omitempty"`
ErrMsg string `protobuf:"bytes,3,opt,name=errMsg" json:"errMsg,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
KeyValue *sdkws.KeyValue `protobuf:"bytes,1,opt,name=keyValue" json:"keyValue,omitempty"`
ErrCode int32 `protobuf:"varint,2,opt,name=errCode" json:"errCode,omitempty"`
ErrMsg string `protobuf:"bytes,3,opt,name=errMsg" json:"errMsg,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *KeyValueResp) Reset() { *m = KeyValueResp{} }
@@ -2130,7 +2130,7 @@ func (m *KeyValueResp) XXX_DiscardUnknown() {
var xxx_messageInfo_KeyValueResp proto.InternalMessageInfo
func (m *KeyValueResp) GetKeyValue() *sdk_ws.KeyValue {
func (m *KeyValueResp) GetKeyValue() *sdkws.KeyValue {
if m != nil {
return m.KeyValue
}
@@ -2229,15 +2229,15 @@ func init() {
proto.RegisterType((*GetWriteDiffMsgReq)(nil), "msg.GetWriteDiffMsgReq")
proto.RegisterType((*GetWriteDiffMsgResp)(nil), "msg.GetWriteDiffMsgResp")
proto.RegisterType((*ModifyMessageReactionExtensionsReq)(nil), "msg.ModifyMessageReactionExtensionsReq")
proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.ModifyMessageReactionExtensionsReq.ReactionExtensionListEntry")
proto.RegisterMapType((map[string]*sdkws.KeyValue)(nil), "msg.ModifyMessageReactionExtensionsReq.ReactionExtensionListEntry")
proto.RegisterType((*SetMessageReactionExtensionsReq)(nil), "msg.SetMessageReactionExtensionsReq")
proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.SetMessageReactionExtensionsReq.ReactionExtensionListEntry")
proto.RegisterMapType((map[string]*sdkws.KeyValue)(nil), "msg.SetMessageReactionExtensionsReq.ReactionExtensionListEntry")
proto.RegisterType((*SetMessageReactionExtensionsResp)(nil), "msg.SetMessageReactionExtensionsResp")
proto.RegisterType((*GetMessageListReactionExtensionsReq)(nil), "msg.GetMessageListReactionExtensionsReq")
proto.RegisterType((*GetMessageListReactionExtensionsReq_MessageReactionKey)(nil), "msg.GetMessageListReactionExtensionsReq.MessageReactionKey")
proto.RegisterType((*GetMessageListReactionExtensionsResp)(nil), "msg.GetMessageListReactionExtensionsResp")
proto.RegisterType((*SingleMessageExtensionResult)(nil), "msg.SingleMessageExtensionResult")
proto.RegisterMapType((map[string]*sdk_ws.KeyValue)(nil), "msg.SingleMessageExtensionResult.ReactionExtensionListEntry")
proto.RegisterMapType((map[string]*sdkws.KeyValue)(nil), "msg.SingleMessageExtensionResult.ReactionExtensionListEntry")
proto.RegisterType((*ModifyMessageReactionExtensionsResp)(nil), "msg.ModifyMessageReactionExtensionsResp")
proto.RegisterType((*DeleteMessageListReactionExtensionsReq)(nil), "msg.DeleteMessageListReactionExtensionsReq")
proto.RegisterType((*DeleteMessageListReactionExtensionsResp)(nil), "msg.DeleteMessageListReactionExtensionsResp")
@@ -2259,10 +2259,10 @@ const _ = grpc.SupportPackageIsVersion4
// Client API for Msg service
type MsgClient interface {
GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error)
PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error)
GetMaxAndMinSeq(ctx context.Context, in *sdkws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdkws.GetMaxAndMinSeqResp, error)
PullMessageBySeqList(ctx context.Context, in *sdkws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdkws.PullMessageBySeqListResp, error)
SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error)
DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error)
DelMsgList(ctx context.Context, in *sdkws.DelMsgListReq, opts ...grpc.CallOption) (*sdkws.DelMsgListResp, error)
DelSuperGroupMsg(ctx context.Context, in *DelSuperGroupMsgReq, opts ...grpc.CallOption) (*DelSuperGroupMsgResp, error)
ClearMsg(ctx context.Context, in *ClearMsgReq, opts ...grpc.CallOption) (*ClearMsgResp, error)
SetMsgMinSeq(ctx context.Context, in *SetMsgMinSeqReq, opts ...grpc.CallOption) (*SetMsgMinSeqResp, error)
@@ -2285,8 +2285,8 @@ func NewMsgClient(cc *grpc.ClientConn) MsgClient {
return &msgClient{cc}
}
func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdk_ws.GetMaxAndMinSeqResp, error) {
out := new(sdk_ws.GetMaxAndMinSeqResp)
func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdkws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdkws.GetMaxAndMinSeqResp, error) {
out := new(sdkws.GetMaxAndMinSeqResp)
err := grpc.Invoke(ctx, "/msg.msg/GetMaxAndMinSeq", in, out, c.cc, opts...)
if err != nil {
return nil, err
@@ -2294,8 +2294,8 @@ func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdk_ws.GetMaxAndMin
return out, nil
}
func (c *msgClient) PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) {
out := new(sdk_ws.PullMessageBySeqListResp)
func (c *msgClient) PullMessageBySeqList(ctx context.Context, in *sdkws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdkws.PullMessageBySeqListResp, error) {
out := new(sdkws.PullMessageBySeqListResp)
err := grpc.Invoke(ctx, "/msg.msg/PullMessageBySeqList", in, out, c.cc, opts...)
if err != nil {
return nil, err
@@ -2312,8 +2312,8 @@ func (c *msgClient) SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.Ca
return out, nil
}
func (c *msgClient) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) {
out := new(sdk_ws.DelMsgListResp)
func (c *msgClient) DelMsgList(ctx context.Context, in *sdkws.DelMsgListReq, opts ...grpc.CallOption) (*sdkws.DelMsgListResp, error) {
out := new(sdkws.DelMsgListResp)
err := grpc.Invoke(ctx, "/msg.msg/DelMsgList", in, out, c.cc, opts...)
if err != nil {
return nil, err
@@ -2423,10 +2423,10 @@ func (c *msgClient) DeleteMessageReactionExtensions(ctx context.Context, in *Del
// Server API for Msg service
type MsgServer interface {
GetMaxAndMinSeq(context.Context, *sdk_ws.GetMaxAndMinSeqReq) (*sdk_ws.GetMaxAndMinSeqResp, error)
PullMessageBySeqList(context.Context, *sdk_ws.PullMessageBySeqListReq) (*sdk_ws.PullMessageBySeqListResp, error)
GetMaxAndMinSeq(context.Context, *sdkws.GetMaxAndMinSeqReq) (*sdkws.GetMaxAndMinSeqResp, error)
PullMessageBySeqList(context.Context, *sdkws.PullMessageBySeqListReq) (*sdkws.PullMessageBySeqListResp, error)
SendMsg(context.Context, *SendMsgReq) (*SendMsgResp, error)
DelMsgList(context.Context, *sdk_ws.DelMsgListReq) (*sdk_ws.DelMsgListResp, error)
DelMsgList(context.Context, *sdkws.DelMsgListReq) (*sdkws.DelMsgListResp, error)
DelSuperGroupMsg(context.Context, *DelSuperGroupMsgReq) (*DelSuperGroupMsgResp, error)
ClearMsg(context.Context, *ClearMsgReq) (*ClearMsgResp, error)
SetMsgMinSeq(context.Context, *SetMsgMinSeqReq) (*SetMsgMinSeqResp, error)
@@ -2446,7 +2446,7 @@ func RegisterMsgServer(s *grpc.Server, srv MsgServer) {
}
func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sdk_ws.GetMaxAndMinSeqReq)
in := new(sdkws.GetMaxAndMinSeqReq)
if err := dec(in); err != nil {
return nil, err
}
@@ -2458,13 +2458,13 @@ func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func
FullMethod: "/msg.msg/GetMaxAndMinSeq",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).GetMaxAndMinSeq(ctx, req.(*sdk_ws.GetMaxAndMinSeqReq))
return srv.(MsgServer).GetMaxAndMinSeq(ctx, req.(*sdkws.GetMaxAndMinSeqReq))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sdk_ws.PullMessageBySeqListReq)
in := new(sdkws.PullMessageBySeqListReq)
if err := dec(in); err != nil {
return nil, err
}
@@ -2476,7 +2476,7 @@ func _Msg_PullMessageBySeqList_Handler(srv interface{}, ctx context.Context, dec
FullMethod: "/msg.msg/PullMessageBySeqList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).PullMessageBySeqList(ctx, req.(*sdk_ws.PullMessageBySeqListReq))
return srv.(MsgServer).PullMessageBySeqList(ctx, req.(*sdkws.PullMessageBySeqListReq))
}
return interceptor(ctx, in, info, handler)
}
@@ -2500,7 +2500,7 @@ func _Msg_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interfa
}
func _Msg_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sdk_ws.DelMsgListReq)
in := new(sdkws.DelMsgListReq)
if err := dec(in); err != nil {
return nil, err
}
@@ -2512,7 +2512,7 @@ func _Msg_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(inte
FullMethod: "/msg.msg/DelMsgList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).DelMsgList(ctx, req.(*sdk_ws.DelMsgListReq))
return srv.(MsgServer).DelMsgList(ctx, req.(*sdkws.DelMsgListReq))
}
return interceptor(ctx, in, info, handler)
}
+16 -16
View File
@@ -1,24 +1,24 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
import "Open-IM-Server/pkg/proto/sdkws/wrappers.proto";
option go_package = "Open_IM/pkg/proto/msg;msg";
package msg;
message MsgDataToMQ{
string token =1;
string operationID = 2;
server_api_params.MsgData msgData = 3;
sdkws.MsgData msgData = 3;
}
message MsgDataToDB {
server_api_params.MsgData msgData = 1;
sdkws.MsgData msgData = 1;
string operationID = 2;
}
message PushMsgDataToMQ{
string OperationID = 1;
server_api_params.MsgData msgData = 2;
sdkws.MsgData msgData = 2;
string pushToUserID = 3;
}
message MsgDataToMongoByMQ{
@@ -65,7 +65,7 @@ message SendMsgReq {
string token =1;
string operationID = 2;
server_api_params.MsgData msgData = 3;
sdkws.MsgData msgData = 3;
}
@@ -141,7 +141,7 @@ message GetSuperGroupMsgReq{
message GetSuperGroupMsgResp{
int32 errCode = 1;
string errMsg = 2;
server_api_params.MsgData msgData = 3;
sdkws.MsgData msgData = 3;
}
message GetWriteDiffMsgReq{
string operationID = 1;
@@ -151,7 +151,7 @@ message GetWriteDiffMsgReq{
message GetWriteDiffMsgResp{
int32 errCode = 1;
string errMsg = 2;
server_api_params.MsgData msgData = 3;
sdkws.MsgData msgData = 3;
}
message ModifyMessageReactionExtensionsReq {
@@ -159,7 +159,7 @@ message ModifyMessageReactionExtensionsReq {
string sourceID = 2;
string opUserID = 3;
int32 sessionType = 4;
map <string, server_api_params.KeyValue>reactionExtensionList = 5;
map <string, sdkws.KeyValue>reactionExtensionList = 5;
string clientMsgID = 6;
google.protobuf.StringValue ex = 7;
google.protobuf.StringValue attachedInfo = 8;
@@ -172,7 +172,7 @@ message SetMessageReactionExtensionsReq {
string sourceID = 2;
string opUserID = 3;
int32 sessionType = 4;
map <string, server_api_params.KeyValue>reactionExtensionList = 5;
map <string, sdkws.KeyValue>reactionExtensionList = 5;
string clientMsgID = 6;
google.protobuf.StringValue ex = 7;
google.protobuf.StringValue attachedInfo = 8;
@@ -210,7 +210,7 @@ message GetMessageListReactionExtensionsResp{
message SingleMessageExtensionResult {
int32 errCode = 1;
string errMsg = 2;
map <string, server_api_params.KeyValue>reactionExtensionList = 3;
map <string, sdkws.KeyValue>reactionExtensionList = 3;
string clientMsgID = 4;
}
@@ -230,7 +230,7 @@ message DeleteMessageListReactionExtensionsReq {
string clientMsgID = 5;
bool isExternalExtensions = 6;
int64 msgFirstModifyTime = 7;
repeated server_api_params.KeyValue reactionExtensionList = 8;
repeated sdkws.KeyValue reactionExtensionList = 8;
}
message DeleteMessageListReactionExtensionsResp {
@@ -254,7 +254,7 @@ message ExtendMsg {
}
message KeyValueResp {
server_api_params.KeyValue keyValue = 1;
sdkws.KeyValue keyValue = 1;
int32 errCode = 2;
string errMsg = 3;
}
@@ -267,10 +267,10 @@ message MsgDataToModifyByMQ{
service msg {
rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp);
rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp);
rpc GetMaxAndMinSeq(sdkws.GetMaxAndMinSeqReq) returns(sdkws.GetMaxAndMinSeqResp);
rpc PullMessageBySeqList(sdkws.PullMessageBySeqListReq) returns(sdkws.PullMessageBySeqListResp);
rpc SendMsg(SendMsgReq) returns(SendMsgResp);
rpc DelMsgList(server_api_params.DelMsgListReq) returns(server_api_params.DelMsgListResp);
rpc DelMsgList(sdkws.DelMsgListReq) returns(sdkws.DelMsgListResp);
rpc DelSuperGroupMsg(DelSuperGroupMsgReq) returns(DelSuperGroupMsgResp);
rpc ClearMsg(ClearMsgReq) returns(ClearMsgResp);
rpc SetMsgMinSeq(SetMsgMinSeqReq) returns(SetMsgMinSeqResp);
+34 -34
View File
@@ -7,7 +7,7 @@
package office
import (
sdk_ws "Open_IM/pkg/proto/sdk_ws"
sdkws "Open_IM/pkg/proto/sdkws"
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@@ -817,9 +817,9 @@ type GetTagSendLogsReq struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"`
OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID,omitempty"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"`
OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID,omitempty"`
}
func (x *GetTagSendLogsReq) Reset() {
@@ -854,7 +854,7 @@ func (*GetTagSendLogsReq) Descriptor() ([]byte, []int) {
return file_office_office_proto_rawDescGZIP(), []int{13}
}
func (x *GetTagSendLogsReq) GetPagination() *sdk_ws.RequestPagination {
func (x *GetTagSendLogsReq) GetPagination() *sdkws.RequestPagination {
if x != nil {
return x.Pagination
}
@@ -943,9 +943,9 @@ type GetTagSendLogsResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"`
Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
TagSendLogs []*TagSendLog `protobuf:"bytes,3,rep,name=tagSendLogs,proto3" json:"tagSendLogs,omitempty"`
CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"`
Pagination *sdkws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
TagSendLogs []*TagSendLog `protobuf:"bytes,3,rep,name=tagSendLogs,proto3" json:"tagSendLogs,omitempty"`
}
func (x *GetTagSendLogsResp) Reset() {
@@ -987,7 +987,7 @@ func (x *GetTagSendLogsResp) GetCommonResp() *CommonResp {
return nil
}
func (x *GetTagSendLogsResp) GetPagination() *sdk_ws.ResponsePagination {
func (x *GetTagSendLogsResp) GetPagination() *sdkws.ResponsePagination {
if x != nil {
return x.Pagination
}
@@ -2392,10 +2392,10 @@ type GetUserWorkMomentsReq struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"`
OpUserID string `protobuf:"bytes,2,opt,name=opUserID,proto3" json:"opUserID,omitempty"`
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
OperationID string `protobuf:"bytes,4,opt,name=operationID,proto3" json:"operationID,omitempty"`
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"`
OpUserID string `protobuf:"bytes,2,opt,name=opUserID,proto3" json:"opUserID,omitempty"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
OperationID string `protobuf:"bytes,4,opt,name=operationID,proto3" json:"operationID,omitempty"`
}
func (x *GetUserWorkMomentsReq) Reset() {
@@ -2444,7 +2444,7 @@ func (x *GetUserWorkMomentsReq) GetOpUserID() string {
return ""
}
func (x *GetUserWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination {
func (x *GetUserWorkMomentsReq) GetPagination() *sdkws.RequestPagination {
if x != nil {
return x.Pagination
}
@@ -2463,9 +2463,9 @@ type GetUserWorkMomentsResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"`
WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments,proto3" json:"workMoments,omitempty"`
Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"`
WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments,proto3" json:"workMoments,omitempty"`
Pagination *sdkws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
}
func (x *GetUserWorkMomentsResp) Reset() {
@@ -2514,7 +2514,7 @@ func (x *GetUserWorkMomentsResp) GetWorkMoments() []*WorkMoment {
return nil
}
func (x *GetUserWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination {
func (x *GetUserWorkMomentsResp) GetPagination() *sdkws.ResponsePagination {
if x != nil {
return x.Pagination
}
@@ -2526,9 +2526,9 @@ type GetUserFriendWorkMomentsReq struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"`
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID,omitempty"`
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
OperationID string `protobuf:"bytes,3,opt,name=operationID,proto3" json:"operationID,omitempty"`
}
func (x *GetUserFriendWorkMomentsReq) Reset() {
@@ -2570,7 +2570,7 @@ func (x *GetUserFriendWorkMomentsReq) GetUserID() string {
return ""
}
func (x *GetUserFriendWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination {
func (x *GetUserFriendWorkMomentsReq) GetPagination() *sdkws.RequestPagination {
if x != nil {
return x.Pagination
}
@@ -2589,9 +2589,9 @@ type GetUserFriendWorkMomentsResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"`
WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments,proto3" json:"workMoments,omitempty"`
Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"`
WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments,proto3" json:"workMoments,omitempty"`
Pagination *sdkws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination,proto3" json:"Pagination,omitempty"`
}
func (x *GetUserFriendWorkMomentsResp) Reset() {
@@ -2640,7 +2640,7 @@ func (x *GetUserFriendWorkMomentsResp) GetWorkMoments() []*WorkMoment {
return nil
}
func (x *GetUserFriendWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination {
func (x *GetUserFriendWorkMomentsResp) GetPagination() *sdkws.ResponsePagination {
if x != nil {
return x.Pagination
}
@@ -3419,8 +3419,8 @@ var file_office_office_proto_goTypes = []interface{}{
(*WorkMomentNotificationMsg)(nil), // 42: office.WorkMomentNotificationMsg
(*SetUserWorkMomentsLevelReq)(nil), // 43: office.SetUserWorkMomentsLevelReq
(*SetUserWorkMomentsLevelResp)(nil), // 44: office.SetUserWorkMomentsLevelResp
(*sdk_ws.RequestPagination)(nil), // 45: server_api_params.RequestPagination
(*sdk_ws.ResponsePagination)(nil), // 46: server_api_params.ResponsePagination
(*sdkws.RequestPagination)(nil), // 45: sdkws.RequestPagination
(*sdkws.ResponsePagination)(nil), // 46: sdkws.ResponsePagination
}
var file_office_office_proto_depIdxs = []int32{
1, // 0: office.Tag.userList:type_name -> office.TagUser
@@ -3430,10 +3430,10 @@ var file_office_office_proto_depIdxs = []int32{
0, // 4: office.DeleteTagResp.commonResp:type_name -> office.CommonResp
0, // 5: office.SetTagResp.commonResp:type_name -> office.CommonResp
0, // 6: office.SendMsg2TagResp.commonResp:type_name -> office.CommonResp
45, // 7: office.GetTagSendLogsReq.Pagination:type_name -> server_api_params.RequestPagination
45, // 7: office.GetTagSendLogsReq.Pagination:type_name -> sdkws.RequestPagination
1, // 8: office.TagSendLog.userList:type_name -> office.TagUser
0, // 9: office.GetTagSendLogsResp.commonResp:type_name -> office.CommonResp
46, // 10: office.GetTagSendLogsResp.Pagination:type_name -> server_api_params.ResponsePagination
46, // 10: office.GetTagSendLogsResp.Pagination:type_name -> sdkws.ResponsePagination
14, // 11: office.GetTagSendLogsResp.tagSendLogs:type_name -> office.TagSendLog
0, // 12: office.GetUserTagByIDResp.commonResp:type_name -> office.CommonResp
2, // 13: office.GetUserTagByIDResp.tag:type_name -> office.Tag
@@ -3451,14 +3451,14 @@ var file_office_office_proto_depIdxs = []int32{
0, // 25: office.GetWorkMomentByIDResp.commonResp:type_name -> office.CommonResp
23, // 26: office.GetWorkMomentByIDResp.workMoment:type_name -> office.WorkMoment
0, // 27: office.ChangeWorkMomentPermissionResp.commonResp:type_name -> office.CommonResp
45, // 28: office.GetUserWorkMomentsReq.Pagination:type_name -> server_api_params.RequestPagination
45, // 28: office.GetUserWorkMomentsReq.Pagination:type_name -> sdkws.RequestPagination
0, // 29: office.GetUserWorkMomentsResp.commonResp:type_name -> office.CommonResp
23, // 30: office.GetUserWorkMomentsResp.workMoments:type_name -> office.WorkMoment
46, // 31: office.GetUserWorkMomentsResp.Pagination:type_name -> server_api_params.ResponsePagination
45, // 32: office.GetUserFriendWorkMomentsReq.Pagination:type_name -> server_api_params.RequestPagination
46, // 31: office.GetUserWorkMomentsResp.Pagination:type_name -> sdkws.ResponsePagination
45, // 32: office.GetUserFriendWorkMomentsReq.Pagination:type_name -> sdkws.RequestPagination
0, // 33: office.GetUserFriendWorkMomentsResp.commonResp:type_name -> office.CommonResp
23, // 34: office.GetUserFriendWorkMomentsResp.workMoments:type_name -> office.WorkMoment
46, // 35: office.GetUserFriendWorkMomentsResp.Pagination:type_name -> server_api_params.ResponsePagination
46, // 35: office.GetUserFriendWorkMomentsResp.Pagination:type_name -> sdkws.ResponsePagination
0, // 36: office.SetUserWorkMomentsLevelResp.commonResp:type_name -> office.CommonResp
3, // 37: office.OfficeService.GetUserTags:input_type -> office.GetUserTagsReq
5, // 38: office.OfficeService.CreateTag:input_type -> office.CreateTagReq
+7 -7
View File
@@ -1,5 +1,5 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
option go_package = "Open_IM/pkg/proto/office;office";
package office;
@@ -78,7 +78,7 @@ message SendMsg2TagResp {
}
message GetTagSendLogsReq {
server_api_params.RequestPagination Pagination = 1;
sdkws.RequestPagination Pagination = 1;
string userID = 2;
string operationID = 3;
}
@@ -91,7 +91,7 @@ message TagSendLog {
message GetTagSendLogsResp {
CommonResp commonResp = 1;
server_api_params.ResponsePagination Pagination = 2;
sdkws.ResponsePagination Pagination = 2;
repeated TagSendLog tagSendLogs = 3;
}
@@ -232,26 +232,26 @@ message ChangeWorkMomentPermissionResp {
message GetUserWorkMomentsReq {
string userID = 1;
string opUserID = 2;
server_api_params.RequestPagination Pagination = 3;
sdkws.RequestPagination Pagination = 3;
string operationID = 4;
}
message GetUserWorkMomentsResp {
CommonResp commonResp = 1;
repeated WorkMoment workMoments = 2;
server_api_params.ResponsePagination Pagination = 3;
sdkws.ResponsePagination Pagination = 3;
}
message GetUserFriendWorkMomentsReq {
string userID = 1;
server_api_params.RequestPagination Pagination = 2;
sdkws.RequestPagination Pagination = 2;
string operationID = 3;
}
message GetUserFriendWorkMomentsResp {
CommonResp commonResp = 1;
repeated WorkMoment workMoments = 2;
server_api_params.ResponsePagination Pagination = 3;
sdkws.ResponsePagination Pagination = 3;
}
message WorkMomentNotificationMsg {
+1 -3
View File
@@ -9,9 +9,7 @@ all_proto=(
msg/msg.proto
push/push.proto
relay/relay.proto
sdk_ws/ws.proto
sdkws/ws.proto
conversation/conversation.proto
office/office.proto
cache/cache.proto
organization/organization.proto
)
+8 -8
View File
@@ -6,7 +6,7 @@ package pbPush // import "Open_IM/pkg/proto/push"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
import sdkws "Open_IM/pkg/proto/sdkws"
import (
context "golang.org/x/net/context"
@@ -25,12 +25,12 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type PushMsgReq struct {
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"`
MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PushMsgReq) Reset() { *m = PushMsgReq{} }
@@ -64,7 +64,7 @@ func (m *PushMsgReq) GetOperationID() string {
return ""
}
func (m *PushMsgReq) GetMsgData() *sdk_ws.MsgData {
func (m *PushMsgReq) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
+2 -2
View File
@@ -1,11 +1,11 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
option go_package = "Open_IM/pkg/proto/push;pbPush";
package push;
message PushMsgReq {
string operationID = 1;
server_api_params.MsgData msgData = 2;
sdkws.MsgData msgData = 2;
string pushToUserID = 3;
}
message PushMsgResp{
+15 -15
View File
@@ -6,7 +6,7 @@ package pbRelay // import "Open_IM/pkg/proto/relay"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
import sdkws "Open_IM/pkg/proto/sdkws"
import (
context "golang.org/x/net/context"
@@ -25,12 +25,12 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type OnlinePushMsgReq struct {
OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"`
MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"`
MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} }
@@ -64,7 +64,7 @@ func (m *OnlinePushMsgReq) GetOperationID() string {
return ""
}
func (m *OnlinePushMsgReq) GetMsgData() *sdk_ws.MsgData {
func (m *OnlinePushMsgReq) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
@@ -171,12 +171,12 @@ func (m *SingelMsgToUserResultList) GetOnlinePush() bool {
}
type OnlineBatchPushOneMsgReq struct {
OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"`
MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
PushToUserIDList []string `protobuf:"bytes,3,rep,name=pushToUserIDList" json:"pushToUserIDList,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"`
MsgData *sdkws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"`
PushToUserIDList []string `protobuf:"bytes,3,rep,name=pushToUserIDList" json:"pushToUserIDList,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *OnlineBatchPushOneMsgReq) Reset() { *m = OnlineBatchPushOneMsgReq{} }
@@ -210,7 +210,7 @@ func (m *OnlineBatchPushOneMsgReq) GetOperationID() string {
return ""
}
func (m *OnlineBatchPushOneMsgReq) GetMsgData() *sdk_ws.MsgData {
func (m *OnlineBatchPushOneMsgReq) GetMsgData() *sdkws.MsgData {
if m != nil {
return m.MsgData
}
+3 -3
View File
@@ -1,11 +1,11 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
option go_package = "Open_IM/pkg/proto/relay;pbRelay";
package relay;
message OnlinePushMsgReq {
string OperationID = 1;
server_api_params.MsgData msgData = 2;
sdkws.MsgData msgData = 2;
string pushToUserID = 3;
}
message OnlinePushMsgResp{
@@ -19,7 +19,7 @@ message SingelMsgToUserResultList{
}
message OnlineBatchPushOneMsgReq{
string OperationID = 1;
server_api_params.MsgData msgData = 2;
sdkws.MsgData msgData = 2;
repeated string pushToUserIDList = 3;
}
message OnlineBatchPushOneMsgResp{
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: sdk_ws/ws.proto
// source: sdkws/ws.proto
package server_api_params // import "Open_IM/pkg/proto/sdk_ws"
package sdkws // import "Open_IM/pkg/proto/sdkws"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
@@ -6227,102 +6227,102 @@ func (m *ResponsePagination) GetShowNumber() int32 {
}
func init() {
proto.RegisterType((*GroupInfo)(nil), "server_api_params.GroupInfo")
proto.RegisterType((*GroupInfoForSet)(nil), "server_api_params.GroupInfoForSet")
proto.RegisterType((*GroupMemberFullInfo)(nil), "server_api_params.GroupMemberFullInfo")
proto.RegisterType((*PublicUserInfo)(nil), "server_api_params.PublicUserInfo")
proto.RegisterType((*UserInfo)(nil), "server_api_params.UserInfo")
proto.RegisterType((*FriendInfo)(nil), "server_api_params.FriendInfo")
proto.RegisterType((*BlackInfo)(nil), "server_api_params.BlackInfo")
proto.RegisterType((*GroupRequest)(nil), "server_api_params.GroupRequest")
proto.RegisterType((*FriendRequest)(nil), "server_api_params.FriendRequest")
proto.RegisterType((*Department)(nil), "server_api_params.Department")
proto.RegisterType((*OrganizationUser)(nil), "server_api_params.OrganizationUser")
proto.RegisterType((*DepartmentMember)(nil), "server_api_params.DepartmentMember")
proto.RegisterType((*UserDepartmentMember)(nil), "server_api_params.UserDepartmentMember")
proto.RegisterType((*UserInDepartment)(nil), "server_api_params.UserInDepartment")
proto.RegisterType((*PullMessageBySeqListReq)(nil), "server_api_params.PullMessageBySeqListReq")
proto.RegisterMapType((map[string]*SeqList)(nil), "server_api_params.PullMessageBySeqListReq.GroupSeqListEntry")
proto.RegisterType((*SeqList)(nil), "server_api_params.seqList")
proto.RegisterType((*MsgDataList)(nil), "server_api_params.MsgDataList")
proto.RegisterType((*PullMessageBySeqListResp)(nil), "server_api_params.PullMessageBySeqListResp")
proto.RegisterMapType((map[string]*MsgDataList)(nil), "server_api_params.PullMessageBySeqListResp.GroupMsgDataListEntry")
proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "server_api_params.GetMaxAndMinSeqReq")
proto.RegisterType((*MaxAndMinSeq)(nil), "server_api_params.MaxAndMinSeq")
proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "server_api_params.GetMaxAndMinSeqResp")
proto.RegisterMapType((map[string]*MaxAndMinSeq)(nil), "server_api_params.GetMaxAndMinSeqResp.GroupMaxAndMinSeqEntry")
proto.RegisterType((*UserSendMsgResp)(nil), "server_api_params.UserSendMsgResp")
proto.RegisterType((*MsgData)(nil), "server_api_params.MsgData")
proto.RegisterMapType((map[string]bool)(nil), "server_api_params.MsgData.OptionsEntry")
proto.RegisterType((*OfflinePushInfo)(nil), "server_api_params.OfflinePushInfo")
proto.RegisterType((*TipsComm)(nil), "server_api_params.TipsComm")
proto.RegisterType((*GroupCreatedTips)(nil), "server_api_params.GroupCreatedTips")
proto.RegisterType((*GroupInfoSetTips)(nil), "server_api_params.GroupInfoSetTips")
proto.RegisterType((*JoinGroupApplicationTips)(nil), "server_api_params.JoinGroupApplicationTips")
proto.RegisterType((*MemberQuitTips)(nil), "server_api_params.MemberQuitTips")
proto.RegisterType((*GroupApplicationAcceptedTips)(nil), "server_api_params.GroupApplicationAcceptedTips")
proto.RegisterType((*GroupApplicationRejectedTips)(nil), "server_api_params.GroupApplicationRejectedTips")
proto.RegisterType((*GroupOwnerTransferredTips)(nil), "server_api_params.GroupOwnerTransferredTips")
proto.RegisterType((*MemberKickedTips)(nil), "server_api_params.MemberKickedTips")
proto.RegisterType((*MemberInvitedTips)(nil), "server_api_params.MemberInvitedTips")
proto.RegisterType((*MemberEnterTips)(nil), "server_api_params.MemberEnterTips")
proto.RegisterType((*GroupDismissedTips)(nil), "server_api_params.GroupDismissedTips")
proto.RegisterType((*GroupMemberMutedTips)(nil), "server_api_params.GroupMemberMutedTips")
proto.RegisterType((*GroupMemberCancelMutedTips)(nil), "server_api_params.GroupMemberCancelMutedTips")
proto.RegisterType((*GroupMutedTips)(nil), "server_api_params.GroupMutedTips")
proto.RegisterType((*GroupCancelMutedTips)(nil), "server_api_params.GroupCancelMutedTips")
proto.RegisterType((*GroupMemberInfoSetTips)(nil), "server_api_params.GroupMemberInfoSetTips")
proto.RegisterType((*OrganizationChangedTips)(nil), "server_api_params.OrganizationChangedTips")
proto.RegisterType((*FriendApplication)(nil), "server_api_params.FriendApplication")
proto.RegisterType((*FromToUserID)(nil), "server_api_params.FromToUserID")
proto.RegisterType((*FriendApplicationTips)(nil), "server_api_params.FriendApplicationTips")
proto.RegisterType((*FriendApplicationApprovedTips)(nil), "server_api_params.FriendApplicationApprovedTips")
proto.RegisterType((*FriendApplicationRejectedTips)(nil), "server_api_params.FriendApplicationRejectedTips")
proto.RegisterType((*FriendAddedTips)(nil), "server_api_params.FriendAddedTips")
proto.RegisterType((*FriendDeletedTips)(nil), "server_api_params.FriendDeletedTips")
proto.RegisterType((*BlackAddedTips)(nil), "server_api_params.BlackAddedTips")
proto.RegisterType((*BlackDeletedTips)(nil), "server_api_params.BlackDeletedTips")
proto.RegisterType((*FriendInfoChangedTips)(nil), "server_api_params.FriendInfoChangedTips")
proto.RegisterType((*UserInfoUpdatedTips)(nil), "server_api_params.UserInfoUpdatedTips")
proto.RegisterType((*ConversationUpdateTips)(nil), "server_api_params.ConversationUpdateTips")
proto.RegisterType((*ConversationSetPrivateTips)(nil), "server_api_params.ConversationSetPrivateTips")
proto.RegisterType((*DeleteMessageTips)(nil), "server_api_params.DeleteMessageTips")
proto.RegisterType((*RequestPagination)(nil), "server_api_params.RequestPagination")
proto.RegisterType((*SignalReq)(nil), "server_api_params.SignalReq")
proto.RegisterType((*SignalResp)(nil), "server_api_params.SignalResp")
proto.RegisterType((*InvitationInfo)(nil), "server_api_params.InvitationInfo")
proto.RegisterType((*ParticipantMetaData)(nil), "server_api_params.ParticipantMetaData")
proto.RegisterType((*SignalInviteReq)(nil), "server_api_params.SignalInviteReq")
proto.RegisterType((*SignalInviteReply)(nil), "server_api_params.SignalInviteReply")
proto.RegisterType((*SignalInviteInGroupReq)(nil), "server_api_params.SignalInviteInGroupReq")
proto.RegisterType((*SignalInviteInGroupReply)(nil), "server_api_params.SignalInviteInGroupReply")
proto.RegisterType((*SignalCancelReq)(nil), "server_api_params.SignalCancelReq")
proto.RegisterType((*SignalCancelReply)(nil), "server_api_params.SignalCancelReply")
proto.RegisterType((*SignalAcceptReq)(nil), "server_api_params.SignalAcceptReq")
proto.RegisterType((*SignalAcceptReply)(nil), "server_api_params.SignalAcceptReply")
proto.RegisterType((*SignalHungUpReq)(nil), "server_api_params.SignalHungUpReq")
proto.RegisterType((*SignalHungUpReply)(nil), "server_api_params.SignalHungUpReply")
proto.RegisterType((*SignalRejectReq)(nil), "server_api_params.SignalRejectReq")
proto.RegisterType((*SignalRejectReply)(nil), "server_api_params.SignalRejectReply")
proto.RegisterType((*SignalGetRoomByGroupIDReq)(nil), "server_api_params.SignalGetRoomByGroupIDReq")
proto.RegisterType((*SignalGetRoomByGroupIDReply)(nil), "server_api_params.SignalGetRoomByGroupIDReply")
proto.RegisterType((*SignalOnRoomParticipantConnectedReq)(nil), "server_api_params.SignalOnRoomParticipantConnectedReq")
proto.RegisterType((*SignalOnRoomParticipantDisconnectedReq)(nil), "server_api_params.SignalOnRoomParticipantDisconnectedReq")
proto.RegisterType((*SignalGetTokenByRoomIDReq)(nil), "server_api_params.SignalGetTokenByRoomIDReq")
proto.RegisterType((*SignalGetTokenByRoomIDReply)(nil), "server_api_params.SignalGetTokenByRoomIDReply")
proto.RegisterType((*DelMsgListReq)(nil), "server_api_params.DelMsgListReq")
proto.RegisterType((*DelMsgListResp)(nil), "server_api_params.DelMsgListResp")
proto.RegisterType((*SetAppBackgroundStatusReq)(nil), "server_api_params.SetAppBackgroundStatusReq")
proto.RegisterType((*SetAppBackgroundStatusResp)(nil), "server_api_params.SetAppBackgroundStatusResp")
proto.RegisterType((*ExtendMsgSet)(nil), "server_api_params.ExtendMsgSet")
proto.RegisterMapType((map[string]*ExtendMsg)(nil), "server_api_params.ExtendMsgSet.ExtendMsgsEntry")
proto.RegisterType((*ExtendMsg)(nil), "server_api_params.ExtendMsg")
proto.RegisterMapType((map[string]*KeyValue)(nil), "server_api_params.ExtendMsg.ReactionExtensionListEntry")
proto.RegisterType((*KeyValue)(nil), "server_api_params.KeyValue")
proto.RegisterType((*ResponsePagination)(nil), "server_api_params.ResponsePagination")
proto.RegisterType((*GroupInfo)(nil), "sdkws.GroupInfo")
proto.RegisterType((*GroupInfoForSet)(nil), "sdkws.GroupInfoForSet")
proto.RegisterType((*GroupMemberFullInfo)(nil), "sdkws.GroupMemberFullInfo")
proto.RegisterType((*PublicUserInfo)(nil), "sdkws.PublicUserInfo")
proto.RegisterType((*UserInfo)(nil), "sdkws.UserInfo")
proto.RegisterType((*FriendInfo)(nil), "sdkws.FriendInfo")
proto.RegisterType((*BlackInfo)(nil), "sdkws.BlackInfo")
proto.RegisterType((*GroupRequest)(nil), "sdkws.GroupRequest")
proto.RegisterType((*FriendRequest)(nil), "sdkws.FriendRequest")
proto.RegisterType((*Department)(nil), "sdkws.Department")
proto.RegisterType((*OrganizationUser)(nil), "sdkws.OrganizationUser")
proto.RegisterType((*DepartmentMember)(nil), "sdkws.DepartmentMember")
proto.RegisterType((*UserDepartmentMember)(nil), "sdkws.UserDepartmentMember")
proto.RegisterType((*UserInDepartment)(nil), "sdkws.UserInDepartment")
proto.RegisterType((*PullMessageBySeqListReq)(nil), "sdkws.PullMessageBySeqListReq")
proto.RegisterMapType((map[string]*SeqList)(nil), "sdkws.PullMessageBySeqListReq.GroupSeqListEntry")
proto.RegisterType((*SeqList)(nil), "sdkws.seqList")
proto.RegisterType((*MsgDataList)(nil), "sdkws.MsgDataList")
proto.RegisterType((*PullMessageBySeqListResp)(nil), "sdkws.PullMessageBySeqListResp")
proto.RegisterMapType((map[string]*MsgDataList)(nil), "sdkws.PullMessageBySeqListResp.GroupMsgDataListEntry")
proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "sdkws.GetMaxAndMinSeqReq")
proto.RegisterType((*MaxAndMinSeq)(nil), "sdkws.MaxAndMinSeq")
proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "sdkws.GetMaxAndMinSeqResp")
proto.RegisterMapType((map[string]*MaxAndMinSeq)(nil), "sdkws.GetMaxAndMinSeqResp.GroupMaxAndMinSeqEntry")
proto.RegisterType((*UserSendMsgResp)(nil), "sdkws.UserSendMsgResp")
proto.RegisterType((*MsgData)(nil), "sdkws.MsgData")
proto.RegisterMapType((map[string]bool)(nil), "sdkws.MsgData.OptionsEntry")
proto.RegisterType((*OfflinePushInfo)(nil), "sdkws.OfflinePushInfo")
proto.RegisterType((*TipsComm)(nil), "sdkws.TipsComm")
proto.RegisterType((*GroupCreatedTips)(nil), "sdkws.GroupCreatedTips")
proto.RegisterType((*GroupInfoSetTips)(nil), "sdkws.GroupInfoSetTips")
proto.RegisterType((*JoinGroupApplicationTips)(nil), "sdkws.JoinGroupApplicationTips")
proto.RegisterType((*MemberQuitTips)(nil), "sdkws.MemberQuitTips")
proto.RegisterType((*GroupApplicationAcceptedTips)(nil), "sdkws.GroupApplicationAcceptedTips")
proto.RegisterType((*GroupApplicationRejectedTips)(nil), "sdkws.GroupApplicationRejectedTips")
proto.RegisterType((*GroupOwnerTransferredTips)(nil), "sdkws.GroupOwnerTransferredTips")
proto.RegisterType((*MemberKickedTips)(nil), "sdkws.MemberKickedTips")
proto.RegisterType((*MemberInvitedTips)(nil), "sdkws.MemberInvitedTips")
proto.RegisterType((*MemberEnterTips)(nil), "sdkws.MemberEnterTips")
proto.RegisterType((*GroupDismissedTips)(nil), "sdkws.GroupDismissedTips")
proto.RegisterType((*GroupMemberMutedTips)(nil), "sdkws.GroupMemberMutedTips")
proto.RegisterType((*GroupMemberCancelMutedTips)(nil), "sdkws.GroupMemberCancelMutedTips")
proto.RegisterType((*GroupMutedTips)(nil), "sdkws.GroupMutedTips")
proto.RegisterType((*GroupCancelMutedTips)(nil), "sdkws.GroupCancelMutedTips")
proto.RegisterType((*GroupMemberInfoSetTips)(nil), "sdkws.GroupMemberInfoSetTips")
proto.RegisterType((*OrganizationChangedTips)(nil), "sdkws.OrganizationChangedTips")
proto.RegisterType((*FriendApplication)(nil), "sdkws.FriendApplication")
proto.RegisterType((*FromToUserID)(nil), "sdkws.FromToUserID")
proto.RegisterType((*FriendApplicationTips)(nil), "sdkws.FriendApplicationTips")
proto.RegisterType((*FriendApplicationApprovedTips)(nil), "sdkws.FriendApplicationApprovedTips")
proto.RegisterType((*FriendApplicationRejectedTips)(nil), "sdkws.FriendApplicationRejectedTips")
proto.RegisterType((*FriendAddedTips)(nil), "sdkws.FriendAddedTips")
proto.RegisterType((*FriendDeletedTips)(nil), "sdkws.FriendDeletedTips")
proto.RegisterType((*BlackAddedTips)(nil), "sdkws.BlackAddedTips")
proto.RegisterType((*BlackDeletedTips)(nil), "sdkws.BlackDeletedTips")
proto.RegisterType((*FriendInfoChangedTips)(nil), "sdkws.FriendInfoChangedTips")
proto.RegisterType((*UserInfoUpdatedTips)(nil), "sdkws.UserInfoUpdatedTips")
proto.RegisterType((*ConversationUpdateTips)(nil), "sdkws.ConversationUpdateTips")
proto.RegisterType((*ConversationSetPrivateTips)(nil), "sdkws.ConversationSetPrivateTips")
proto.RegisterType((*DeleteMessageTips)(nil), "sdkws.DeleteMessageTips")
proto.RegisterType((*RequestPagination)(nil), "sdkws.RequestPagination")
proto.RegisterType((*SignalReq)(nil), "sdkws.SignalReq")
proto.RegisterType((*SignalResp)(nil), "sdkws.SignalResp")
proto.RegisterType((*InvitationInfo)(nil), "sdkws.InvitationInfo")
proto.RegisterType((*ParticipantMetaData)(nil), "sdkws.ParticipantMetaData")
proto.RegisterType((*SignalInviteReq)(nil), "sdkws.SignalInviteReq")
proto.RegisterType((*SignalInviteReply)(nil), "sdkws.SignalInviteReply")
proto.RegisterType((*SignalInviteInGroupReq)(nil), "sdkws.SignalInviteInGroupReq")
proto.RegisterType((*SignalInviteInGroupReply)(nil), "sdkws.SignalInviteInGroupReply")
proto.RegisterType((*SignalCancelReq)(nil), "sdkws.SignalCancelReq")
proto.RegisterType((*SignalCancelReply)(nil), "sdkws.SignalCancelReply")
proto.RegisterType((*SignalAcceptReq)(nil), "sdkws.SignalAcceptReq")
proto.RegisterType((*SignalAcceptReply)(nil), "sdkws.SignalAcceptReply")
proto.RegisterType((*SignalHungUpReq)(nil), "sdkws.SignalHungUpReq")
proto.RegisterType((*SignalHungUpReply)(nil), "sdkws.SignalHungUpReply")
proto.RegisterType((*SignalRejectReq)(nil), "sdkws.SignalRejectReq")
proto.RegisterType((*SignalRejectReply)(nil), "sdkws.SignalRejectReply")
proto.RegisterType((*SignalGetRoomByGroupIDReq)(nil), "sdkws.SignalGetRoomByGroupIDReq")
proto.RegisterType((*SignalGetRoomByGroupIDReply)(nil), "sdkws.SignalGetRoomByGroupIDReply")
proto.RegisterType((*SignalOnRoomParticipantConnectedReq)(nil), "sdkws.SignalOnRoomParticipantConnectedReq")
proto.RegisterType((*SignalOnRoomParticipantDisconnectedReq)(nil), "sdkws.SignalOnRoomParticipantDisconnectedReq")
proto.RegisterType((*SignalGetTokenByRoomIDReq)(nil), "sdkws.SignalGetTokenByRoomIDReq")
proto.RegisterType((*SignalGetTokenByRoomIDReply)(nil), "sdkws.SignalGetTokenByRoomIDReply")
proto.RegisterType((*DelMsgListReq)(nil), "sdkws.DelMsgListReq")
proto.RegisterType((*DelMsgListResp)(nil), "sdkws.DelMsgListResp")
proto.RegisterType((*SetAppBackgroundStatusReq)(nil), "sdkws.SetAppBackgroundStatusReq")
proto.RegisterType((*SetAppBackgroundStatusResp)(nil), "sdkws.SetAppBackgroundStatusResp")
proto.RegisterType((*ExtendMsgSet)(nil), "sdkws.ExtendMsgSet")
proto.RegisterMapType((map[string]*ExtendMsg)(nil), "sdkws.ExtendMsgSet.ExtendMsgsEntry")
proto.RegisterType((*ExtendMsg)(nil), "sdkws.ExtendMsg")
proto.RegisterMapType((map[string]*KeyValue)(nil), "sdkws.ExtendMsg.ReactionExtensionListEntry")
proto.RegisterType((*KeyValue)(nil), "sdkws.KeyValue")
proto.RegisterType((*ResponsePagination)(nil), "sdkws.ResponsePagination")
}
func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_e08a07288a333e78) }
func init() { proto.RegisterFile("sdkws/ws.proto", fileDescriptor_ws_e08a07288a333e78) }
var fileDescriptor_ws_e08a07288a333e78 = []byte{
// 4125 bytes of a gzipped FileDescriptorProto
@@ -1,7 +1,7 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto";
option go_package = "Open_IM/pkg/proto/sdk_ws;server_api_params";
package server_api_params;
import "Open-IM-Server/pkg/proto/sdkws/wrappers.proto";
option go_package = "Open_IM/pkg/proto/sdkws;sdkws";
package sdkws;
////////////////////////////////base///////////////////////////////
@@ -128,70 +128,6 @@ message FriendRequest{
string ex = 15;
}
///////////////////////////////////organization/////////////////////////////////////
message Department {
string departmentID = 1;
string faceURL = 2;
string name = 3;
string parentID = 4;
int32 order = 5;
int32 departmentType = 6;
int64 createTime = 7;
uint32 subDepartmentNum = 8;
uint32 memberNum = 9;
string ex = 10;
}
message OrganizationUser {
string userID = 1;
string nickname = 2;
string englishName = 3;
string faceURL = 4;
int32 gender = 5;
string mobile = 6;
string telephone = 7;
uint32 birth = 8;
string email = 9;
int64 createTime = 10;
string ex = 11;
string birthStr = 12;
}
message DepartmentMember {
string userID = 1;
string departmentID = 2;
int32 order = 3;
string position = 4;
int32 leader = 5;
int32 status = 6;
string ex = 7;
}
message UserDepartmentMember {
OrganizationUser organizationUser = 1;
DepartmentMember departmentMember = 2;
}
message UserInDepartment {
OrganizationUser organizationUser = 1;
repeated DepartmentMember departmentMemberList = 2;
}
///////////////////////////////////organization end//////////////////////////////////
///////////////////////////////////base end/////////////////////////////////////
message PullMessageBySeqListReq{
+32 -32
View File
@@ -7,7 +7,7 @@ import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import conversation "Open_IM/pkg/proto/conversation"
import sdk_ws "Open_IM/pkg/proto/sdk_ws"
import sdkws "Open_IM/pkg/proto/sdkws"
import (
context "golang.org/x/net/context"
@@ -26,10 +26,10 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type GetAllUserIDReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetAllUserIDReq) Reset() { *m = GetAllUserIDReq{} }
@@ -56,7 +56,7 @@ func (m *GetAllUserIDReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetAllUserIDReq proto.InternalMessageInfo
func (m *GetAllUserIDReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetAllUserIDReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -270,10 +270,10 @@ func (m *GetDesignateUsersReq) GetUserIDs() []string {
}
type GetDesignateUsersResp struct {
UsersInfo []*sdk_ws.UserInfo `protobuf:"bytes,1,rep,name=usersInfo" json:"usersInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
UsersInfo []*sdkws.UserInfo `protobuf:"bytes,1,rep,name=usersInfo" json:"usersInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetDesignateUsersResp) Reset() { *m = GetDesignateUsersResp{} }
@@ -300,7 +300,7 @@ func (m *GetDesignateUsersResp) XXX_DiscardUnknown() {
var xxx_messageInfo_GetDesignateUsersResp proto.InternalMessageInfo
func (m *GetDesignateUsersResp) GetUsersInfo() []*sdk_ws.UserInfo {
func (m *GetDesignateUsersResp) GetUsersInfo() []*sdkws.UserInfo {
if m != nil {
return m.UsersInfo
}
@@ -308,10 +308,10 @@ func (m *GetDesignateUsersResp) GetUsersInfo() []*sdk_ws.UserInfo {
}
type UpdateUserInfoReq struct {
UserInfo *sdk_ws.UserInfo `protobuf:"bytes,1,opt,name=userInfo" json:"userInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
UserInfo *sdkws.UserInfo `protobuf:"bytes,1,opt,name=userInfo" json:"userInfo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UpdateUserInfoReq) Reset() { *m = UpdateUserInfoReq{} }
@@ -338,7 +338,7 @@ func (m *UpdateUserInfoReq) XXX_DiscardUnknown() {
var xxx_messageInfo_UpdateUserInfoReq proto.InternalMessageInfo
func (m *UpdateUserInfoReq) GetUserInfo() *sdk_ws.UserInfo {
func (m *UpdateUserInfoReq) GetUserInfo() *sdkws.UserInfo {
if m != nil {
return m.UserInfo
}
@@ -1012,10 +1012,10 @@ func (m *BatchSetConversationsResp) GetFailed() []string {
}
type GetPaginationUsersReq struct {
Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination" json:"pagination,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationUsersReq) Reset() { *m = GetPaginationUsersReq{} }
@@ -1042,7 +1042,7 @@ func (m *GetPaginationUsersReq) XXX_DiscardUnknown() {
var xxx_messageInfo_GetPaginationUsersReq proto.InternalMessageInfo
func (m *GetPaginationUsersReq) GetPagination() *sdk_ws.RequestPagination {
func (m *GetPaginationUsersReq) GetPagination() *sdkws.RequestPagination {
if m != nil {
return m.Pagination
}
@@ -1050,11 +1050,11 @@ func (m *GetPaginationUsersReq) GetPagination() *sdk_ws.RequestPagination {
}
type GetPaginationUsersResp struct {
Total int32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Users []*sdk_ws.UserInfo `protobuf:"bytes,2,rep,name=users" json:"users,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Total int32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Users []*sdkws.UserInfo `protobuf:"bytes,2,rep,name=users" json:"users,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPaginationUsersResp) Reset() { *m = GetPaginationUsersResp{} }
@@ -1088,7 +1088,7 @@ func (m *GetPaginationUsersResp) GetTotal() int32 {
return 0
}
func (m *GetPaginationUsersResp) GetUsers() []*sdk_ws.UserInfo {
func (m *GetPaginationUsersResp) GetUsers() []*sdkws.UserInfo {
if m != nil {
return m.Users
}
@@ -1096,10 +1096,10 @@ func (m *GetPaginationUsersResp) GetUsers() []*sdk_ws.UserInfo {
}
type UserRegisterReq struct {
Users []*sdk_ws.UserInfo `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Users []*sdkws.UserInfo `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UserRegisterReq) Reset() { *m = UserRegisterReq{} }
@@ -1126,7 +1126,7 @@ func (m *UserRegisterReq) XXX_DiscardUnknown() {
var xxx_messageInfo_UserRegisterReq proto.InternalMessageInfo
func (m *UserRegisterReq) GetUsers() []*sdk_ws.UserInfo {
func (m *UserRegisterReq) GetUsers() []*sdkws.UserInfo {
if m != nil {
return m.Users
}
+7 -7
View File
@@ -1,5 +1,5 @@
syntax = "proto3";
import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto";
import "Open-IM-Server/pkg/proto/sdkws/ws.proto";
import "Open-IM-Server/pkg/proto/conversation/conversation.proto";
option go_package = "Open_IM/pkg/proto/user;user";
package user;
@@ -8,7 +8,7 @@ package user;
message getAllUserIDReq{
server_api_params.RequestPagination pagination = 1;
sdkws.RequestPagination pagination = 1;
}
message getAllUserIDResp{
int32 total = 1;
@@ -32,11 +32,11 @@ message getDesignateUsersReq{
repeated string userIDs = 1;
}
message getDesignateUsersResp{
repeated server_api_params.UserInfo usersInfo = 1;
repeated sdkws.UserInfo usersInfo = 1;
}
message updateUserInfoReq{
server_api_params.UserInfo userInfo = 1;
sdkws.UserInfo userInfo = 1;
}
message updateUserInfoResp{
}
@@ -113,16 +113,16 @@ message batchSetConversationsResp{
message getPaginationUsersReq {
server_api_params.RequestPagination pagination = 2;
sdkws.RequestPagination pagination = 2;
}
message getPaginationUsersResp{
int32 total = 1;
repeated server_api_params.UserInfo users = 2;
repeated sdkws.UserInfo users = 2;
}
message userRegisterReq {
repeated server_api_params.UserInfo users = 1;
repeated sdkws.UserInfo users = 1;
}
message userRegisterResp {
}
+3 -3
View File
@@ -2,13 +2,13 @@ package utils
import (
"Open_IM/pkg/common/constant"
server_api_params "Open_IM/pkg/proto/sdk_ws"
sdkws "Open_IM/pkg/proto/sdkws"
"github.com/golang/protobuf/proto"
)
func GetContent(msg *server_api_params.MsgData) string {
func GetContent(msg *sdkws.MsgData) string {
if msg.ContentType >= constant.NotificationBegin && msg.ContentType <= constant.NotificationEnd {
var tips server_api_params.TipsComm
var tips sdkws.TipsComm
_ = proto.Unmarshal(msg.Content, &tips)
content := tips.JsonDetail
return content