mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 17:15:58 +08:00
Merge remote-tracking branch 'origin/errcode' into errcode
This commit is contained in:
@@ -13,7 +13,6 @@ type UserTokenInfo struct {
|
||||
ExpiredTime int64 `json:"expiredTime"`
|
||||
}
|
||||
type UserRegisterResp struct {
|
||||
CommResp
|
||||
UserToken UserTokenInfo `json:"data"`
|
||||
}
|
||||
|
||||
@@ -25,7 +24,6 @@ type UserTokenReq struct {
|
||||
}
|
||||
|
||||
type UserTokenResp struct {
|
||||
CommResp
|
||||
UserToken UserTokenInfo `json:"data"`
|
||||
}
|
||||
|
||||
@@ -36,7 +34,6 @@ type ForceLogoutReq struct {
|
||||
}
|
||||
|
||||
type ForceLogoutResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type ParseTokenReq struct {
|
||||
@@ -44,7 +41,7 @@ type ParseTokenReq struct {
|
||||
}
|
||||
|
||||
//type ParseTokenResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// ExpireTime int64 `json:"expireTime" binding:"required"`
|
||||
//}
|
||||
|
||||
@@ -53,7 +50,6 @@ type ExpireTime struct {
|
||||
}
|
||||
|
||||
type ParseTokenResp struct {
|
||||
CommResp
|
||||
Data map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
ExpireTime ExpireTime `json:"-"`
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ type AwsStorageCredentialRespData struct {
|
||||
}
|
||||
|
||||
type AwsStorageCredentialResp struct {
|
||||
CommResp
|
||||
CosData AwsStorageCredentialRespData
|
||||
Data map[string]interface{} `json:"data"`
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package apistruct
|
||||
|
||||
type RequestPagination struct {
|
||||
PageNumber int `json:"pageNumber" binding:"required"`
|
||||
ShowNumber int `json:"showNumber" binding:"required"`
|
||||
}
|
||||
@@ -9,7 +9,6 @@ type GetAllConversationMessageOptReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetAllConversationMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
type GetReceiveMessageOptReq struct {
|
||||
@@ -18,7 +17,6 @@ type GetReceiveMessageOptReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetReceiveMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
type SetReceiveMessageOptReq struct {
|
||||
@@ -28,7 +26,6 @@ type SetReceiveMessageOptReq struct {
|
||||
ConversationIDList []string `json:"conversationIDList" binding:"required"`
|
||||
}
|
||||
type SetReceiveMessageOptResp struct {
|
||||
CommResp
|
||||
ConversationOptResultList []*OptResult `json:"data"`
|
||||
}
|
||||
|
||||
@@ -58,7 +55,6 @@ type SetConversationReq struct {
|
||||
}
|
||||
|
||||
type SetConversationResp struct {
|
||||
CommResp
|
||||
}
|
||||
type ModifyConversationFieldReq struct {
|
||||
Conversation
|
||||
@@ -67,7 +63,6 @@ type ModifyConversationFieldReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type ModifyConversationFieldResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type BatchSetConversationsReq struct {
|
||||
@@ -78,7 +73,6 @@ type BatchSetConversationsReq struct {
|
||||
}
|
||||
|
||||
type BatchSetConversationsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
Success []string `json:"success"`
|
||||
Failed []string `json:"failed"`
|
||||
@@ -92,7 +86,6 @@ type GetConversationReq struct {
|
||||
}
|
||||
|
||||
type GetConversationResp struct {
|
||||
CommResp
|
||||
Conversation Conversation `json:"data"`
|
||||
}
|
||||
|
||||
@@ -102,7 +95,6 @@ type GetAllConversationsReq struct {
|
||||
}
|
||||
|
||||
type GetAllConversationsResp struct {
|
||||
CommResp
|
||||
Conversations []Conversation `json:"data"`
|
||||
}
|
||||
|
||||
@@ -113,7 +105,6 @@ type GetConversationsReq struct {
|
||||
}
|
||||
|
||||
type GetConversationsResp struct {
|
||||
CommResp
|
||||
Conversations []Conversation `json:"data"`
|
||||
}
|
||||
|
||||
@@ -126,5 +117,4 @@ type SetRecvMsgOptReq struct {
|
||||
}
|
||||
|
||||
type SetRecvMsgOptResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ type TencentCloudStorageCredentialRespData struct {
|
||||
}
|
||||
|
||||
type TencentCloudStorageCredentialResp struct {
|
||||
CommResp
|
||||
CosData TencentCloudStorageCredentialRespData `json:"-"`
|
||||
|
||||
Data map[string]interface{} `json:"data"`
|
||||
|
||||
+15
-15
@@ -10,7 +10,7 @@ package apistruct
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type AddBlacklistResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type ImportFriendReq struct {
|
||||
@@ -23,7 +23,7 @@ package apistruct
|
||||
// Result int32 `json:"result"`
|
||||
//}
|
||||
//type ImportFriendResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// UserIDResultList []UserIDResult `json:"data"`
|
||||
//}
|
||||
//
|
||||
@@ -32,7 +32,7 @@ package apistruct
|
||||
// ReqMsg string `json:"reqMsg"`
|
||||
//}
|
||||
//type AddFriendResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type AddFriendResponseReq struct {
|
||||
@@ -41,14 +41,14 @@ package apistruct
|
||||
// HandleMsg string `json:"handleMsg"`
|
||||
//}
|
||||
//type AddFriendResponseResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type DeleteFriendReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type DeleteFriendResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type GetBlackListReq struct {
|
||||
@@ -56,7 +56,7 @@ package apistruct
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetBlackListResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// BlackUserInfoList []*sdkws.PublicUserInfo `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@@ -73,14 +73,14 @@ package apistruct
|
||||
// Remark string `json:"remark"`
|
||||
//}
|
||||
//type SetFriendRemarkResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type RemoveBlacklistReq struct {
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type RemoveBlacklistResp struct {
|
||||
// CommResp
|
||||
//
|
||||
//}
|
||||
//
|
||||
//type IsFriendReq struct {
|
||||
@@ -90,7 +90,7 @@ package apistruct
|
||||
// Friend bool `json:"isFriend"`
|
||||
//}
|
||||
//type IsFriendResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// Response Response `json:"data"`
|
||||
//}
|
||||
//
|
||||
@@ -98,7 +98,7 @@ package apistruct
|
||||
// ParamsCommFriend
|
||||
//}
|
||||
//type GetFriendsInfoResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// FriendInfoList []*sdkws.FriendInfo `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@@ -108,7 +108,7 @@ package apistruct
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetFriendListResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// FriendInfoList []*sdkws.FriendInfo `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@@ -118,7 +118,7 @@ package apistruct
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetFriendApplyListResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// FriendRequestList []*sdkws.FriendRequest `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@@ -128,7 +128,7 @@ package apistruct
|
||||
// FromUserID string `json:"fromUserID" binding:"required"`
|
||||
//}
|
||||
//type GetSelfApplyListResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// FriendRequestList []*sdkws.FriendRequest `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@@ -180,7 +180,7 @@ type ImportFriendReq struct {
|
||||
}
|
||||
|
||||
type ImportFriendResp struct {
|
||||
//CommResp
|
||||
//
|
||||
}
|
||||
|
||||
type AddFriendReq struct {
|
||||
@@ -189,7 +189,7 @@ type AddFriendReq struct {
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
}
|
||||
type AddFriendResp struct {
|
||||
//CommResp
|
||||
//
|
||||
}
|
||||
|
||||
type AddFriendResponseReq struct {
|
||||
|
||||
+3
-33
@@ -4,16 +4,6 @@ import (
|
||||
sdkws "OpenIM/pkg/proto/sdkws"
|
||||
)
|
||||
|
||||
type CommResp struct {
|
||||
ErrCode int32 `json:"errCode"`
|
||||
ErrMsg string `json:"errMsg"`
|
||||
}
|
||||
|
||||
type CommDataResp struct {
|
||||
CommResp
|
||||
Data []map[string]interface{} `json:"data"`
|
||||
}
|
||||
|
||||
type KickGroupMemberReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
KickedUserIDList []string `json:"kickedUserIDList" binding:"required"`
|
||||
@@ -21,7 +11,7 @@ type KickGroupMemberReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type KickGroupMemberResp struct {
|
||||
CommResp
|
||||
|
||||
//UserIDResultList []*UserIDResult `json:"data"`
|
||||
}
|
||||
|
||||
@@ -31,7 +21,6 @@ type GetGroupMembersInfoReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetGroupMembersInfoResp struct {
|
||||
CommResp
|
||||
MemberList []*sdkws.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@@ -43,7 +32,7 @@ type InviteUserToGroupReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type InviteUserToGroupResp struct {
|
||||
CommResp
|
||||
|
||||
//UserIDResultList []*UserIDResult `json:"data"`
|
||||
}
|
||||
|
||||
@@ -52,7 +41,6 @@ type GetJoinedGroupListReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"`
|
||||
}
|
||||
type GetJoinedGroupListResp struct {
|
||||
CommResp
|
||||
GroupInfoList []*sdkws.GroupInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@@ -64,7 +52,6 @@ type GetGroupMemberListReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
}
|
||||
type GetGroupMemberListResp struct {
|
||||
CommResp
|
||||
NextSeq int32 `json:"nextSeq"`
|
||||
MemberList []*sdkws.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
@@ -77,7 +64,6 @@ type GetGroupAllMemberReq struct {
|
||||
Count int32 `json:"count"`
|
||||
}
|
||||
type GetGroupAllMemberResp struct {
|
||||
CommResp
|
||||
MemberList []*sdkws.GroupMemberFullInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@@ -90,7 +76,7 @@ type GetGroupAllMemberResp struct {
|
||||
// Count int32 `json:"count" binding:"required"`
|
||||
//}
|
||||
//type GetGroupAllMemberListBySplitResp struct {
|
||||
// CommResp
|
||||
//
|
||||
// MemberList []*sdkws.GroupMemberFullInfo `json:"-"`
|
||||
// Map []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
//}
|
||||
@@ -108,7 +94,6 @@ type CreateGroupReq struct {
|
||||
GroupID string `json:"groupID"`
|
||||
}
|
||||
type CreateGroupResp struct {
|
||||
CommResp
|
||||
GroupInfo sdkws.GroupInfo `json:"-"`
|
||||
Data map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@@ -118,7 +103,6 @@ type GetGroupApplicationListReq struct {
|
||||
FromUserID string `json:"fromUserID" binding:"required"` //作为管理员或群主收到的 进群申请
|
||||
}
|
||||
type GetGroupApplicationListResp struct {
|
||||
CommResp
|
||||
GroupRequestList []*sdkws.GroupRequest `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@@ -137,7 +121,6 @@ type GetGroupInfoReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetGroupInfoResp struct {
|
||||
CommResp
|
||||
GroupInfoList []*sdkws.GroupInfo `json:"-"`
|
||||
Data []map[string]interface{} `json:"data" swaggerignore:"true"`
|
||||
}
|
||||
@@ -171,7 +154,6 @@ type ApplicationGroupResponseReq struct {
|
||||
HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"`
|
||||
}
|
||||
type ApplicationGroupResponseResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type JoinGroupReq struct {
|
||||
@@ -183,7 +165,6 @@ type JoinGroupReq struct {
|
||||
}
|
||||
|
||||
type JoinGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type QuitGroupReq struct {
|
||||
@@ -191,7 +172,6 @@ type QuitGroupReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type QuitGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type SetGroupInfoReq struct {
|
||||
@@ -208,7 +188,6 @@ type SetGroupInfoReq struct {
|
||||
}
|
||||
|
||||
type SetGroupInfoResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type TransferGroupOwnerReq struct {
|
||||
@@ -218,7 +197,6 @@ type TransferGroupOwnerReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type TransferGroupOwnerResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type DismissGroupReq struct {
|
||||
@@ -226,7 +204,6 @@ type DismissGroupReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type DismissGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type MuteGroupMemberReq struct {
|
||||
@@ -236,7 +213,6 @@ type MuteGroupMemberReq struct {
|
||||
MutedSeconds uint32 `json:"mutedSeconds" binding:"required"`
|
||||
}
|
||||
type MuteGroupMemberResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type CancelMuteGroupMemberReq struct {
|
||||
@@ -245,7 +221,6 @@ type CancelMuteGroupMemberReq struct {
|
||||
UserID string `json:"userID" binding:"required"`
|
||||
}
|
||||
type CancelMuteGroupMemberResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type MuteGroupReq struct {
|
||||
@@ -253,7 +228,6 @@ type MuteGroupReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
}
|
||||
type MuteGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type CancelMuteGroupReq struct {
|
||||
@@ -261,7 +235,6 @@ type CancelMuteGroupReq struct {
|
||||
GroupID string `json:"groupID" binding:"required"`
|
||||
}
|
||||
type CancelMuteGroupResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type SetGroupMemberNicknameReq struct {
|
||||
@@ -272,7 +245,6 @@ type SetGroupMemberNicknameReq struct {
|
||||
}
|
||||
|
||||
type SetGroupMemberNicknameResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type SetGroupMemberInfoReq struct {
|
||||
@@ -286,7 +258,6 @@ type SetGroupMemberInfoReq struct {
|
||||
}
|
||||
|
||||
type SetGroupMemberInfoResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetGroupAbstractInfoReq struct {
|
||||
@@ -295,7 +266,6 @@ type GetGroupAbstractInfoReq struct {
|
||||
}
|
||||
|
||||
type GetGroupAbstractInfoResp struct {
|
||||
CommResp
|
||||
GroupMemberNumber int32 `json:"groupMemberNumber"`
|
||||
GroupMemberListHash uint64 `json:"groupMemberListHash"`
|
||||
}
|
||||
|
||||
@@ -9,14 +9,12 @@ type DeleteUsersReq struct {
|
||||
DeleteUserIDList []string `json:"deleteUserIDList" binding:"required"`
|
||||
}
|
||||
type DeleteUsersResp struct {
|
||||
CommResp
|
||||
FailedUserIDList []string `json:"data"`
|
||||
}
|
||||
type GetAllUsersUidReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
}
|
||||
type GetAllUsersUidResp struct {
|
||||
CommResp
|
||||
UserIDList []string `json:"data"`
|
||||
}
|
||||
type GetUsersOnlineStatusReq struct {
|
||||
@@ -24,7 +22,7 @@ type GetUsersOnlineStatusReq struct {
|
||||
UserIDList []string `json:"userIDList" binding:"required,lte=200"`
|
||||
}
|
||||
type GetUsersOnlineStatusResp struct {
|
||||
CommResp
|
||||
|
||||
//SuccessResult []*msggateway.GetUsersOnlineStatusResp_SuccessResult `json:"data"`
|
||||
}
|
||||
type AccountCheckReq struct {
|
||||
@@ -32,7 +30,7 @@ type AccountCheckReq struct {
|
||||
CheckUserIDList []string `json:"checkUserIDList" binding:"required,lte=100"`
|
||||
}
|
||||
type AccountCheckResp struct {
|
||||
CommResp
|
||||
|
||||
//ResultList []*pbUser.AccountCheckResp_SingleUserStatus `json:"data"`
|
||||
}
|
||||
|
||||
@@ -69,7 +67,6 @@ type ManagementBatchSendMsgReq struct {
|
||||
}
|
||||
|
||||
type ManagementBatchSendMsgResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
ResultList []*SingleReturnResult `json:"resultList"`
|
||||
FailedIDList []string
|
||||
@@ -87,7 +84,6 @@ type CheckMsgIsSendSuccessReq struct {
|
||||
}
|
||||
|
||||
type CheckMsgIsSendSuccessResp struct {
|
||||
CommResp
|
||||
Status int32 `json:"status"`
|
||||
}
|
||||
|
||||
@@ -119,7 +115,6 @@ type CMSUser struct {
|
||||
}
|
||||
|
||||
type GetUsersResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
UserList []*CMSUser `json:"userList"`
|
||||
TotalNum int32 `json:"totalNum"`
|
||||
|
||||
@@ -12,7 +12,6 @@ type DelMsgReq struct {
|
||||
}
|
||||
|
||||
type DelMsgResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type CleanUpMsgReq struct {
|
||||
@@ -21,7 +20,6 @@ type CleanUpMsgReq struct {
|
||||
}
|
||||
|
||||
type CleanUpMsgResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type DelSuperGroupMsgReq struct {
|
||||
@@ -33,7 +31,6 @@ type DelSuperGroupMsgReq struct {
|
||||
}
|
||||
|
||||
type DelSuperGroupMsgResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type MsgDeleteNotificationElem struct {
|
||||
@@ -50,7 +47,6 @@ type SetMsgMinSeqReq struct {
|
||||
}
|
||||
|
||||
type SetMsgMinSeqResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type ModifyMessageReactionExtensionsReq struct {
|
||||
@@ -67,7 +63,6 @@ type ModifyMessageReactionExtensionsReq struct {
|
||||
}
|
||||
|
||||
type ModifyMessageReactionExtensionsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
ResultKeyValue []*msg.KeyValueResp `json:"result"`
|
||||
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
|
||||
@@ -83,7 +78,6 @@ type ModifyMessageReactionExtensionsResp struct {
|
||||
//}
|
||||
|
||||
type OperateMessageListReactionExtensionsResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
SuccessList []*msg.ExtendMsgResp `json:"successList"`
|
||||
FailedList []*msg.ExtendMsgResp `json:"failedList"`
|
||||
@@ -97,7 +91,6 @@ type SetMessageReactionExtensionsCallbackResp ModifyMessageReactionExtensionsRes
|
||||
//type GetMessageListReactionExtensionsReq OperateMessageListReactionExtensionsReq
|
||||
|
||||
type GetMessageListReactionExtensionsResp struct {
|
||||
CommResp
|
||||
Data []*msg.SingleMessageExtensionResult `json:"data"`
|
||||
}
|
||||
|
||||
@@ -116,7 +109,6 @@ type DeleteMessageReactionExtensionsReq struct {
|
||||
}
|
||||
|
||||
type DeleteMessageReactionExtensionsResp struct {
|
||||
CommResp
|
||||
Data []*msg.KeyValueResp
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ type OSSCredentialRespData struct {
|
||||
}
|
||||
|
||||
type OSSCredentialResp struct {
|
||||
CommResp
|
||||
OssData OSSCredentialRespData `json:"-"`
|
||||
Data map[string]interface{} `json:"data"`
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ type MinioUploadFile struct {
|
||||
}
|
||||
|
||||
type MinioUploadFileResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
MinioUploadFile
|
||||
} `json:"data"`
|
||||
@@ -46,7 +45,6 @@ type UploadUpdateAppReq struct {
|
||||
}
|
||||
|
||||
type UploadUpdateAppResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
type GetDownloadURLReq struct {
|
||||
@@ -56,7 +54,6 @@ type GetDownloadURLReq struct {
|
||||
}
|
||||
|
||||
type GetDownloadURLResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
HasNewVersion bool `json:"hasNewVersion"`
|
||||
ForceUpdate bool `json:"forceUpdate"`
|
||||
@@ -73,7 +70,6 @@ type GetRTCInvitationInfoReq struct {
|
||||
}
|
||||
|
||||
type GetRTCInvitationInfoResp struct {
|
||||
CommResp
|
||||
Data struct {
|
||||
OpUserID string `json:"opUserID"`
|
||||
Invitation struct {
|
||||
@@ -110,7 +106,6 @@ type FcmUpdateTokenReq struct {
|
||||
}
|
||||
|
||||
type FcmUpdateTokenResp struct {
|
||||
CommResp
|
||||
}
|
||||
type SetAppBadgeReq struct {
|
||||
OperationID string `json:"operationID" binding:"required"`
|
||||
@@ -119,5 +114,4 @@ type SetAppBadgeReq struct {
|
||||
}
|
||||
|
||||
type SetAppBadgeResp struct {
|
||||
CommResp
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"OpenIM/internal/msggateway"
|
||||
//"OpenIM/internal/msggateway"
|
||||
"OpenIM/pkg/common/constant"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -23,14 +24,13 @@ func (m *MsgGatewayCmd) getWsPortFlag(cmd *cobra.Command) int {
|
||||
return port
|
||||
}
|
||||
|
||||
func (m *MsgGatewayCmd) addRun() {
|
||||
m.Command.Run = func(cmd *cobra.Command, args []string) {
|
||||
msggateway.Init(m.getPortFlag(cmd), m.getWsPortFlag(cmd))
|
||||
msggateway.Run(m.getPrometheusPortFlag(cmd))
|
||||
func (m *MsgGatewayCmd) addRunE() {
|
||||
m.Command.RunE = func(cmd *cobra.Command, args []string) error {
|
||||
return msggateway.RunWsAndServer(m.getPortFlag(cmd), m.getWsPortFlag(cmd), m.getPrometheusPortFlag(cmd))
|
||||
}
|
||||
}
|
||||
|
||||
func (m *MsgGatewayCmd) Exec() error {
|
||||
m.addRun()
|
||||
m.addRunE()
|
||||
return m.Execute()
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@ import (
|
||||
)
|
||||
|
||||
type PushCmd struct {
|
||||
*RpcCmd
|
||||
*AuthCmd
|
||||
}
|
||||
|
||||
func NewPushCmd() *PushCmd {
|
||||
return &PushCmd{NewRpcCmd(config.Config.RpcRegisterName.OpenImPushName)}
|
||||
return &PushCmd{NewAuthCmd()}
|
||||
}
|
||||
|
||||
func (r *RpcCmd) AddPush() {
|
||||
func (r *PushCmd) AddPush() {
|
||||
r.Command.RunE = func(cmd *cobra.Command, args []string) error {
|
||||
return startrpc.Start(r.getPortFlag(cmd), r.rpcRegisterName, r.getPrometheusPortFlag(cmd), push.Start)
|
||||
return startrpc.Start(r.getPortFlag(cmd), config.Config.RpcRegisterName.OpenImPushName, r.getPrometheusPortFlag(cmd), push.Start)
|
||||
}
|
||||
}
|
||||
|
||||
+12
-2
@@ -7,7 +7,9 @@ import (
|
||||
)
|
||||
|
||||
type RootCmd struct {
|
||||
Command cobra.Command
|
||||
Command cobra.Command
|
||||
port int
|
||||
prometheusPort int
|
||||
}
|
||||
|
||||
func NewRootCmd() (rootCmd *RootCmd) {
|
||||
@@ -50,8 +52,12 @@ func (r *RootCmd) getPortFlag(cmd *cobra.Command) int {
|
||||
return port
|
||||
}
|
||||
|
||||
func (r *RootCmd) GetPortFlag() int {
|
||||
return r.port
|
||||
}
|
||||
|
||||
func (r *RootCmd) AddPrometheusPortFlag() {
|
||||
r.Command.Flags().StringP(constant.FlagPrometheusPort, "pp", "", "server prometheus listen port")
|
||||
r.Command.Flags().String(constant.FlagPrometheusPort, "", "server prometheus listen port")
|
||||
}
|
||||
|
||||
func (r *RootCmd) getPrometheusPortFlag(cmd *cobra.Command) int {
|
||||
@@ -59,6 +65,10 @@ func (r *RootCmd) getPrometheusPortFlag(cmd *cobra.Command) int {
|
||||
return port
|
||||
}
|
||||
|
||||
func (r *RootCmd) GetPrometheusPortFlag() int {
|
||||
return r.prometheusPort
|
||||
}
|
||||
|
||||
func (r *RootCmd) getConfFromCmdAndInit(cmdLines *cobra.Command) error {
|
||||
configFolderPath, _ := cmdLines.Flags().GetString(constant.FlagConf)
|
||||
return config.InitConfig(configFolderPath)
|
||||
|
||||
+11
-10
@@ -7,22 +7,23 @@ import (
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type RpcCmd struct {
|
||||
type AuthCmd struct {
|
||||
*RootCmd
|
||||
rpcRegisterName string
|
||||
}
|
||||
|
||||
func NewRpcCmd(rpcRegisterName string) *RpcCmd {
|
||||
return &RpcCmd{NewRootCmd(), rpcRegisterName}
|
||||
func NewAuthCmd() *AuthCmd {
|
||||
authCmd := &AuthCmd{NewRootCmd()}
|
||||
return authCmd
|
||||
}
|
||||
|
||||
func (r *RpcCmd) AddRpc(rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error) {
|
||||
r.Command.RunE = func(cmd *cobra.Command, args []string) error {
|
||||
return startrpc.Start(r.getPortFlag(cmd), r.rpcRegisterName, r.getPrometheusPortFlag(cmd), rpcFn)
|
||||
func (a *AuthCmd) Exec() error {
|
||||
a.Command.Run = func(cmd *cobra.Command, args []string) {
|
||||
a.port = a.getPortFlag(cmd)
|
||||
a.prometheusPort = a.getPrometheusPortFlag(cmd)
|
||||
}
|
||||
return a.Execute()
|
||||
}
|
||||
|
||||
func (r *RpcCmd) Exec(rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error) error {
|
||||
r.AddRpc(rpcFn)
|
||||
return r.Execute()
|
||||
func (a *AuthCmd) StartSvr(name string, rpcFn func(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error) error {
|
||||
return startrpc.Start(a.GetPortFlag(), name, a.GetPrometheusPortFlag(), rpcFn)
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ type config struct {
|
||||
ZkAddr []string `yaml:"zkAddr"`
|
||||
UserName string `yaml:"userName"`
|
||||
Password string `yaml:"password"`
|
||||
}
|
||||
} `yaml:"zookeeper"`
|
||||
Log struct {
|
||||
StorageLocation string `yaml:"storageLocation"`
|
||||
RotationTime int `yaml:"rotationTime"`
|
||||
@@ -515,9 +515,10 @@ func (c *config) initConfig(config interface{}, configName, configFolderPath str
|
||||
return err
|
||||
}
|
||||
configPath = filepath.Join(Root, "config", configName)
|
||||
fmt.Println(configPath, "not exist, use", configPath)
|
||||
fmt.Println("use", configPath)
|
||||
} else {
|
||||
Root = filepath.Dir(configPath)
|
||||
}
|
||||
Root = filepath.Dir(configPath)
|
||||
return c.unmarshalConfig(config, configPath)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
package constant
|
||||
|
||||
const (
|
||||
//Websocket Protocol
|
||||
WSGetNewestSeq = 1001
|
||||
WSPullMsgBySeqList = 1002
|
||||
WSSendMsg = 1003
|
||||
WSSendSignalMsg = 1004
|
||||
WSPushMsg = 2001
|
||||
WSKickOnlineMsg = 2002
|
||||
WsLogoutMsg = 2003
|
||||
WsSetBackgroundStatus = 2004
|
||||
WSDataError = 3001
|
||||
|
||||
///ContentType
|
||||
//UserRelated
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// for mongoDB
|
||||
type ExtendMsgDatabase interface {
|
||||
CreateExtendMsgSet(ctx context.Context, set *unRelationTb.ExtendMsgSetModel) error
|
||||
GetAllExtendMsgSet(ctx context.Context, ID string, opts *unRelationTb.GetAllExtendMsgSetOpts) (sets []*unRelationTb.ExtendMsgSetModel, err error)
|
||||
|
||||
@@ -76,6 +76,9 @@ func NewGroupDatabase(
|
||||
}
|
||||
|
||||
func InitGroupDatabase(db *gorm.DB, rdb redis.UniversalClient, database *mongo.Database) GroupDatabase {
|
||||
rcOptions := rockscache.NewDefaultOptions()
|
||||
rcOptions.StrongConsistency = true
|
||||
rcOptions.RandomExpireAdjustment = 0.2
|
||||
return NewGroupDatabase(
|
||||
relation.NewGroupDB(db),
|
||||
relation.NewGroupMemberDB(db),
|
||||
@@ -83,10 +86,7 @@ func InitGroupDatabase(db *gorm.DB, rdb redis.UniversalClient, database *mongo.D
|
||||
tx.NewGorm(db),
|
||||
tx.NewMongo(database.Client()),
|
||||
unrelation.NewSuperGroupMongoDriver(database),
|
||||
cache.NewGroupCacheRedis(rdb, relation.NewGroupDB(db), relation.NewGroupMemberDB(db), relation.NewGroupRequest(db), unrelation.NewSuperGroupMongoDriver(database), rockscache.Options{
|
||||
StrongConsistency: true,
|
||||
RandomExpireAdjustment: 2.0,
|
||||
}),
|
||||
cache.NewGroupCacheRedis(rdb, relation.NewGroupDB(db), relation.NewGroupMemberDB(db), relation.NewGroupRequest(db), unrelation.NewSuperGroupMongoDriver(database), rcOptions),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/common/constant"
|
||||
"OpenIM/pkg/common/db/cache"
|
||||
unRelationTb "OpenIM/pkg/common/db/table/unrelation"
|
||||
"OpenIM/pkg/common/db/unrelation"
|
||||
"OpenIM/pkg/common/kafka"
|
||||
"OpenIM/pkg/common/log"
|
||||
"OpenIM/pkg/common/prome"
|
||||
"OpenIM/pkg/common/tracelog"
|
||||
@@ -68,7 +70,7 @@ type MsgDatabase interface {
|
||||
DeleteReactionExtendMsgSet(ctx context.Context, sourceID string, sessionType int32, clientMsgID string, msgFirstModifyTime int64, reactionExtensionList map[string]*sdkws.KeyValue) error
|
||||
SetSendMsgStatus(ctx context.Context, id string, status int32) error
|
||||
GetSendMsgStatus(ctx context.Context, id string) (int32, error)
|
||||
MsgToMQ(ctx context.Context, key string, mq *pbMsg.MsgDataToMQ) error
|
||||
MsgToMQ(ctx context.Context, key string, msg2mq *pbMsg.MsgDataToMQ) error
|
||||
GetUserMaxSeq(ctx context.Context, userID string) (int64, error)
|
||||
GetUserMinSeq(ctx context.Context, userID string) (int64, error)
|
||||
GetGroupMaxSeq(ctx context.Context, groupID string) (int64, error)
|
||||
@@ -79,6 +81,7 @@ func NewMsgDatabase(msgDocModel unRelationTb.MsgDocModelInterface, cacheModel ca
|
||||
return &msgDatabase{
|
||||
msgDocDatabase: msgDocModel,
|
||||
cache: cacheModel,
|
||||
producer: kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +96,8 @@ type msgDatabase struct {
|
||||
msgDocDatabase unRelationTb.MsgDocModelInterface
|
||||
extendMsgDatabase unRelationTb.ExtendMsgSetModelInterface
|
||||
cache cache.Model
|
||||
producer *kafka.Producer
|
||||
// model
|
||||
msg unRelationTb.MsgDocModel
|
||||
extendMsgSetModel unRelationTb.ExtendMsgSetModel
|
||||
}
|
||||
@@ -165,9 +170,9 @@ func (db *msgDatabase) GetSendMsgStatus(ctx context.Context, id string) (int32,
|
||||
return db.cache.GetSendMsgStatus(ctx, id)
|
||||
}
|
||||
|
||||
func (db *msgDatabase) MsgToMQ(ctx context.Context, key string, mq *pbMsg.MsgDataToMQ) error {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
func (db *msgDatabase) MsgToMQ(ctx context.Context, key string, msg2mq *pbMsg.MsgDataToMQ) error {
|
||||
_, _, err := db.producer.SendMessage(ctx, key, msg2mq)
|
||||
return err
|
||||
}
|
||||
|
||||
func (db *msgDatabase) GetUserMaxSeq(ctx context.Context, userID string) (int64, error) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
const (
|
||||
singleGocMsgNum = 5000
|
||||
CChat = "msg"
|
||||
Msg = "msg"
|
||||
OldestList = 0
|
||||
NewestList = -1
|
||||
)
|
||||
@@ -38,7 +38,7 @@ type MsgDocModelInterface interface {
|
||||
}
|
||||
|
||||
func (MsgDocModel) TableName() string {
|
||||
return CChat
|
||||
return Msg
|
||||
}
|
||||
|
||||
func (MsgDocModel) GetSingleGocMsgNum() int64 {
|
||||
|
||||
@@ -61,7 +61,7 @@ func (m *Mongo) GetDatabase() *mongo.Database {
|
||||
}
|
||||
|
||||
func (m *Mongo) CreateMsgIndex() error {
|
||||
return m.createMongoIndex(unrelation.CChat, false, "uid")
|
||||
return m.createMongoIndex(unrelation.Msg, false, "uid")
|
||||
}
|
||||
|
||||
func (m *Mongo) CreateSuperGroupIndex() error {
|
||||
|
||||
@@ -46,7 +46,7 @@ func NewKafkaProducer(addr []string, topic string) *Producer {
|
||||
return &p
|
||||
}
|
||||
|
||||
func (p *Producer) SendMessage(ctx context.Context, m proto.Message, key string) (int32, int64, error) {
|
||||
func (p *Producer) SendMessage(ctx context.Context, key string, m proto.Message) (int32, int64, error) {
|
||||
operationID := tracelog.GetOperationID(ctx)
|
||||
log.Info(operationID, "SendMessage", "key ", key, m.String(), p.producer)
|
||||
kMsg := &sarama.ProducerMessage{}
|
||||
|
||||
@@ -90,3 +90,6 @@ func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) {
|
||||
func IsManagerUserID(opUserID string) bool {
|
||||
return utils.IsContain(opUserID, config.Config.Manager.AppManagerUid)
|
||||
}
|
||||
func WsVerifyToken(token, userID, platformID string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ type SvcDiscoveryRegistry interface {
|
||||
UnRegister() error
|
||||
GetConns(serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error)
|
||||
GetConn(serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
|
||||
AddOption(opts ...grpc.DialOption)
|
||||
|
||||
RegisterConf2Registry(key string, conf []byte) error
|
||||
GetConfFromRegistry(key string) ([]byte, error)
|
||||
|
||||
+3
-6
@@ -22,22 +22,19 @@ func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error
|
||||
}
|
||||
|
||||
func Wrap1(err error) error {
|
||||
if err != nil {
|
||||
return Wrap(err, "")
|
||||
}
|
||||
return nil
|
||||
return errors.Wrap(err, "==> " + printCallerNameAndLine())
|
||||
}
|
||||
|
||||
func Wrap2[T any](a T, err error) (T, error) {
|
||||
if err != nil {
|
||||
return a, Wrap(err, "")
|
||||
return a, errors.Wrap(err, "==> " + printCallerNameAndLine())
|
||||
}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
func Wrap3[T any, V any](a T, b V, err error) (T, V, error) {
|
||||
if err != nil {
|
||||
return a, b, Wrap(err, "")
|
||||
return a, b, errors.Wrap(err, "==> " + printCallerNameAndLine())
|
||||
}
|
||||
return a, b, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user