feat: use robot to migrate code

Signed-off-by: kubbot & kubecub <3293172751ysy@gmail.com>
This commit is contained in:
kubbot & kubecub
2023-06-30 09:45:02 +08:00
parent 2d41819008
commit 539e0fdfb6
529 changed files with 64588 additions and 54413 deletions
+72
View File
@@ -0,0 +1,72 @@
package callbackstruct
import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
)
type CommonCallbackReq struct {
SendID string `json:"sendID"`
CallbackCommand string `json:"callbackCommand"`
ServerMsgID string `json:"serverMsgID"`
ClientMsgID string `json:"clientMsgID"`
OperationID string `json:"operationID"`
SenderPlatformID int32 `json:"senderPlatformID"`
SenderNickname string `json:"senderNickname"`
SessionType int32 `json:"sessionType"`
MsgFrom int32 `json:"msgFrom"`
ContentType int32 `json:"contentType"`
Status int32 `json:"status"`
CreateTime int64 `json:"createTime"`
Content string `json:"content"`
Seq uint32 `json:"seq"`
AtUserIDList []string `json:"atUserList"`
SenderFaceURL string `json:"faceURL"`
Ex string `json:"ex"`
}
func (c *CommonCallbackReq) GetCallbackCommand() string {
return c.CallbackCommand
}
type CallbackReq interface {
GetCallbackCommand() string
}
type CallbackResp interface {
Parse() (err error)
}
type CommonCallbackResp struct {
ActionCode int `json:"actionCode"`
ErrCode int32 `json:"errCode"`
ErrMsg string `json:"errMsg"`
ErrDlt string `json:"errDlt"`
}
func (c CommonCallbackResp) Parse() error {
if c.ActionCode != errs.NoError || c.ErrCode != errs.NoError {
return errs.NewCodeError(int(c.ErrCode), c.ErrMsg).WithDetail(c.ErrDlt)
}
return nil
}
type UserStatusBaseCallback struct {
CallbackCommand string `json:"callbackCommand"`
OperationID string `json:"operationID"`
PlatformID int `json:"platformID"`
Platform string `json:"platform"`
}
func (c UserStatusBaseCallback) GetCallbackCommand() string {
return c.CallbackCommand
}
type UserStatusCallbackReq struct {
UserStatusBaseCallback
UserID string `json:"userID"`
}
type UserStatusBatchCallbackReq struct {
UserStatusBaseCallback
UserIDList []string `json:"userIDList"`
}
+13
View File
@@ -0,0 +1,13 @@
package callbackstruct
type CallbackBeforeAddFriendReq struct {
CallbackCommand `json:"callbackCommand"`
FromUserID string `json:"fromUserID" `
ToUserID string `json:"toUserID"`
ReqMsg string `json:"reqMsg"`
OperationID string `json:"operationID"`
}
type CallbackBeforeAddFriendResp struct {
CommonCallbackResp
}
+73
View File
@@ -0,0 +1,73 @@
package callbackstruct
import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
common "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
)
type CallbackCommand string
func (c CallbackCommand) GetCallbackCommand() string {
return string(c)
}
type CallbackBeforeCreateGroupReq struct {
OperationID string `json:"operationID"`
CallbackCommand `json:"callbackCommand"`
*common.GroupInfo
InitMemberList []*apistruct.GroupAddMemberInfo `json:"initMemberList"`
}
type CallbackBeforeCreateGroupResp struct {
CommonCallbackResp
GroupID *string `json:"groupID"`
GroupName *string `json:"groupName"`
Notification *string `json:"notification"`
Introduction *string `json:"introduction"`
FaceURL *string `json:"faceURL"`
OwnerUserID *string `json:"ownerUserID"`
Ex *string `json:"ex"`
Status *int32 `json:"status"`
CreatorUserID *string `json:"creatorUserID"`
GroupType *int32 `json:"groupType"`
NeedVerification *int32 `json:"needVerification"`
LookMemberInfo *int32 `json:"lookMemberInfo"`
ApplyMemberFriend *int32 `json:"applyMemberFriend"`
}
type CallbackBeforeMemberJoinGroupReq struct {
CallbackCommand `json:"callbackCommand"`
OperationID string `json:"operationID"`
GroupID string `json:"groupID"`
UserID string `json:"userID"`
Ex string `json:"ex"`
GroupEx string `json:"groupEx"`
}
type CallbackBeforeMemberJoinGroupResp struct {
CommonCallbackResp
Nickname *string `json:"nickname"`
FaceURL *string `json:"faceURL"`
RoleLevel *int32 `json:"roleLevel"`
MuteEndTime *int64 `json:"muteEndTime"`
Ex *string `json:"ex"`
}
type CallbackBeforeSetGroupMemberInfoReq struct {
CallbackCommand `json:"callbackCommand"`
OperationID string `json:"operationID"`
GroupID string `json:"groupID"`
UserID string `json:"userID"`
Nickname *string `json:"nickName"`
FaceURL *string `json:"faceURL"`
RoleLevel *int32 `json:"roleLevel"`
Ex *string `json:"ex"`
}
type CallbackBeforeSetGroupMemberInfoResp struct {
CommonCallbackResp
Ex *string `json:"ex"`
Nickname *string `json:"nickName"`
FaceURL *string `json:"faceURL"`
RoleLevel *int32 `json:"roleLevel"`
}
+136
View File
@@ -0,0 +1,136 @@
package callbackstruct
import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
)
type CallbackBeforeSendSingleMsgReq struct {
CommonCallbackReq
RecvID string `json:"recvID"`
}
type CallbackBeforeSendSingleMsgResp struct {
CommonCallbackResp
}
type CallbackAfterSendSingleMsgReq struct {
CommonCallbackReq
RecvID string `json:"recvID"`
}
type CallbackAfterSendSingleMsgResp struct {
CommonCallbackResp
}
type CallbackBeforeSendGroupMsgReq struct {
CommonCallbackReq
GroupID string `json:"groupID"`
}
type CallbackBeforeSendGroupMsgResp struct {
CommonCallbackResp
}
type CallbackAfterSendGroupMsgReq struct {
CommonCallbackReq
GroupID string `json:"groupID"`
}
type CallbackAfterSendGroupMsgResp struct {
CommonCallbackResp
}
type CallbackMsgModifyCommandReq struct {
CommonCallbackReq
}
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 *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 `json:"callbackCommand"`
ConversationID string `json:"conversationID"`
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
ResultReactionExtensionList []*msg.KeyValueResp `json:"resultReactionExtensionList"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackDeleteMessageReactionExtReq struct {
CallbackCommand `json:"callbackCommand"`
OperationID string `json:"operationID"`
ConversationID string `json:"conversationID"`
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
ResultReactionExtensionList []*msg.KeyValueResp `json:"resultReactionExtensionList"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
type CallbackGetMessageListReactionExtReq struct {
OperationID string `json:"operationID"`
CallbackCommand `json:"callbackCommand"`
ConversationID string `json:"conversationID"`
OpUserID string `json:"opUserID"`
SessionType int32 `json:"sessionType"`
TypeKeyList []string `json:"typeKeyList"`
//MessageKeyList []*msg.GetMessageListReactionExtensionsReq_MessageReactionKey `json:"messageKeyList"`
}
type CallbackGetMessageListReactionExtResp struct {
CommonCallbackResp
MessageResultList []*msg.SingleMessageExtensionResult `json:"messageResultList"`
}
type CallbackAddMessageReactionExtReq struct {
OperationID string `json:"operationID"`
CallbackCommand `json:"callbackCommand"`
ConversationID string `json:"conversationID"`
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 CallbackAddMessageReactionExtResp struct {
CommonCallbackResp
ResultReactionExtensionList []*msg.KeyValueResp `json:"resultReactionExtensionList"`
IsReact bool `json:"isReact"`
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
}
+32
View File
@@ -0,0 +1,32 @@
package callbackstruct
type CallbackUserOnlineReq struct {
UserStatusCallbackReq
//Token string `json:"token"`
Seq int64 `json:"seq"`
IsAppBackground bool `json:"isAppBackground"`
ConnID string `json:"connID"`
}
type CallbackUserOnlineResp struct {
CommonCallbackResp
}
type CallbackUserOfflineReq struct {
UserStatusCallbackReq
Seq int64 `json:"seq"`
ConnID string `json:"connID"`
}
type CallbackUserOfflineResp struct {
CommonCallbackResp
}
type CallbackUserKickOffReq struct {
UserStatusCallbackReq
Seq int64 `json:"seq"`
}
type CallbackUserKickOffResp struct {
CommonCallbackResp
}
+39
View File
@@ -0,0 +1,39 @@
package callbackstruct
import common "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
type CallbackBeforePushReq struct {
UserStatusBatchCallbackReq
*common.OfflinePushInfo
ClientMsgID string `json:"clientMsgID"`
SendID string `json:"sendID"`
GroupID string `json:"groupID"`
ContentType int32 `json:"contentType"`
SessionType int32 `json:"sessionType"`
AtUserIDs []string `json:"atUserIDList"`
Content string `json:"content"`
}
type CallbackBeforePushResp struct {
CommonCallbackResp
UserIDs []string `json:"userIDList"`
OfflinePushInfo *common.OfflinePushInfo `json:"offlinePushInfo"`
}
type CallbackBeforeSuperGroupOnlinePushReq struct {
UserStatusBaseCallback
ClientMsgID string `json:"clientMsgID"`
SendID string `json:"sendID"`
GroupID string `json:"groupID"`
ContentType int32 `json:"contentType"`
SessionType int32 `json:"sessionType"`
AtUserIDs []string `json:"atUserIDList"`
Content string `json:"content"`
Seq int64 `json:"seq"`
}
type CallbackBeforeSuperGroupOnlinePushResp struct {
CommonCallbackResp
UserIDs []string `json:"userIDList"`
OfflinePushInfo *common.OfflinePushInfo `json:"offlinePushInfo"`
}