mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 06:19:20 +08:00
add webhooks (#1465)
* add callback before join group * fix bug * fix deployments/templates/alertmanager.yml * fix bug * update callback after join group * merge callback after join group * update callback setrgoup info * test * test * test * update three functions in friend category * test friend and blacklist * test * test * test * Update openim.yaml * merge callback after join group * merge callback after join group * merge callback after join group * fix callbackbeforesetgroupinfo * fix eventtime * update api request required * update api request required * update api request required * delete unused code * delete unused code * fix * Update .env * Update .env * Update callback.go * Update callback.go * Update .env * Update .env * fix: merge * update * fix: merge * fix: fix bugs * update callback enable * update callback enable * update callback enable * update callback enable * update callback enable * update callback enable * Update openim.yaml * Update environment.sh * Update environment.md * Update environment.md * Update environment.sh --------- Co-authored-by: Gordon <1432970085@qq.com>
This commit is contained in:
@@ -1,5 +1,20 @@
|
||||
package callbackstruct
|
||||
|
||||
const CallbackBeforeInviteJoinGroupCommand = "callbackBeforeInviteJoinGroupCommand"
|
||||
const CallbackAfterJoinGroupCommand = "callbackAfterJoinGroupCommand"
|
||||
const CallbackAfterSetGroupInfoCommand = "callbackAfterSetGroupInfoCommand"
|
||||
const CallbackBeforeSetGroupInfoCommand = "callbackBeforeSetGroupInfoCommand"
|
||||
|
||||
const CallbackAfterRevokeMsgCommand = "callbackBeforeAfterMsgCommand"
|
||||
const CallbackBeforeAddBlackCommand = "callbackBeforeAddBlackCommand"
|
||||
const CallbackAfterAddFriendCommand = "callbackAfterAddFriendCommand"
|
||||
const CallbackBeforeAddFriendAgreeCommand = "callbackBeforeAddFriendAgreeCommand"
|
||||
|
||||
const CallbackAfterDeleteFriendCommand = "callbackAfterDeleteFriendCommand"
|
||||
const CallbackBeforeImportFriendsCommand = "callbackBeforeImportFriendsCommand"
|
||||
const CallbackAfterImportFriendsCommand = "callbackAfterImportFriendsCommand"
|
||||
const CallbackAfterRemoveBlackCommand = "callbackAfterRemoveBlackCommand"
|
||||
|
||||
const (
|
||||
CallbackQuitGroupCommand = "callbackQuitGroupCommand"
|
||||
CallbackKillGroupCommand = "callbackKillGroupCommand"
|
||||
@@ -29,5 +44,6 @@ const (
|
||||
CallbackBeforeCreateGroupCommand = "callbackBeforeCreateGroupCommand"
|
||||
CallbackAfterCreateGroupCommand = "callbackAfterCreateGroupCommand"
|
||||
CallbackBeforeMemberJoinGroupCommand = "callbackBeforeMemberJoinGroupCommand"
|
||||
CallbackBeforeSetGroupMemberInfoCommand = "CallbackBeforeSetGroupMemberInfoCommand"
|
||||
CallbackBeforeSetGroupMemberInfoCommand = "callbackBeforeSetGroupMemberInfoCommand"
|
||||
CallbackAfterSetGroupMemberInfoCommand = "callbackAfterSetGroupMemberInfoCommand"
|
||||
)
|
||||
|
||||
@@ -19,6 +19,7 @@ type CallbackBeforeAddFriendReq struct {
|
||||
FromUserID string `json:"fromUserID" `
|
||||
ToUserID string `json:"toUserID"`
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
Ex string `json:"ex"`
|
||||
}
|
||||
|
||||
type CallbackBeforeAddFriendResp struct {
|
||||
@@ -35,17 +36,6 @@ type CallBackAddFriendReplyBeforeResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterAddFriendReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
FromUserID string `json:"fromUserID" `
|
||||
ToUserID string `json:"toUserID"`
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
}
|
||||
|
||||
type CallbackAfterAddFriendResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackBeforeSetFriendRemarkReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OwnerUserID string `json:"ownerUserID"`
|
||||
@@ -68,3 +58,70 @@ type CallbackAfterSetFriendRemarkReq struct {
|
||||
type CallbackAfterSetFriendRemarkResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
type CallbackAfterAddFriendReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
FromUserID string `json:"fromUserID" `
|
||||
ToUserID string `json:"toUserID"`
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
}
|
||||
|
||||
type CallbackAfterAddFriendResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
type CallbackBeforeAddBlackReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OwnerUserID string `json:"ownerUserID" `
|
||||
BlackUserID string `json:"blackUserID"`
|
||||
}
|
||||
|
||||
type CallbackBeforeAddBlackResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackBeforeAddFriendAgreeReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
FromUserID string `json:"fromUserID" `
|
||||
ToUserID string `json:"blackUserID"`
|
||||
HandleResult int32 `json:"HandleResult"`
|
||||
HandleMsg string `json:"HandleMsg"`
|
||||
}
|
||||
|
||||
type CallbackBeforeAddFriendAgreeResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterDeleteFriendReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OwnerUserID string `json:"ownerUserID" `
|
||||
FriendUserID string `json:"friendUserID"`
|
||||
}
|
||||
type CallbackAfterDeleteFriendResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackBeforeImportFriendsReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OwnerUserID string `json:"ownerUserID" `
|
||||
FriendUserIDs []string `json:"friendUserIDs"`
|
||||
}
|
||||
type CallbackBeforeImportFriendsResp struct {
|
||||
CommonCallbackResp
|
||||
FriendUserIDs []string `json:"friendUserIDs"`
|
||||
}
|
||||
type CallbackAfterImportFriendsReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OwnerUserID string `json:"ownerUserID" `
|
||||
FriendUserIDs []string `json:"friendUserIDs"`
|
||||
}
|
||||
type CallbackAfterImportFriendsResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterRemoveBlackReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OwnerUserID string `json:"ownerUserID"`
|
||||
BlackUserID string `json:"blackUserID"`
|
||||
}
|
||||
type CallbackAfterRemoveBlackResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
+69
-50
@@ -109,56 +109,6 @@ type CallbackAfterSetGroupMemberInfoResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterGroupMemberExitReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
GroupID string `json:"groupID"`
|
||||
UserID string `json:"userID"`
|
||||
GroupType *int32 `json:"groupType"`
|
||||
ExitType string `json:"exitType"`
|
||||
}
|
||||
|
||||
type CallbackAfterGroupMemberExitResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterUngroupReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
GroupID string `json:"groupID"`
|
||||
GroupType *int32 `json:"groupType"`
|
||||
OwnerID string `json:"ownerID"`
|
||||
MemberList []string `json:"memberList"`
|
||||
}
|
||||
|
||||
type CallbackAfterUngroupResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterSetGroupInfoReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
GroupID string `json:"groupID"`
|
||||
GroupType *int32 `json:"groupType"`
|
||||
UserID string `json:"userID"`
|
||||
Name string `json:"name"`
|
||||
Notification string `json:"notification"`
|
||||
GroupUrl string `json:"groupUrl"`
|
||||
}
|
||||
|
||||
type CallbackAfterSetGroupInfoResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterRevokeMsgReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
GroupID string `json:"groupID"`
|
||||
GroupType *int32 `json:"groupType"`
|
||||
UserID string `json:"userID"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type CallbackAfterRevokeMsgResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackQuitGroupReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
GroupID string `json:"groupID"`
|
||||
@@ -214,3 +164,72 @@ type CallbackTransferGroupOwnerReq struct {
|
||||
type CallbackTransferGroupOwnerResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackBeforeInviteUserToGroupReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OperationID string `json:"operationID"`
|
||||
GroupID string `json:"groupID"`
|
||||
Reason string `json:"reason"`
|
||||
InvitedUserIDs []string `json:"invitedUserIDs"`
|
||||
}
|
||||
type CallbackBeforeInviteUserToGroupResp struct {
|
||||
CommonCallbackResp
|
||||
RefusedMembersAccount []string `json:"refusedMembersAccount,omitempty"` // Optional field to list members whose invitation is refused.
|
||||
}
|
||||
|
||||
type CallbackAfterJoinGroupReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OperationID string `json:"operationID"`
|
||||
GroupID string `json:"groupID"`
|
||||
ReqMessage string `json:"reqMessage"`
|
||||
JoinSource int32 `json:"joinSource"`
|
||||
InviterUserID string `json:"inviterUserID"`
|
||||
}
|
||||
type CallbackAfterJoinGroupResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackBeforeSetGroupInfoReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OperationID string `json:"operationID"`
|
||||
GroupID string `json:"groupID"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
Introduction string `json:"introduction"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Ex string `json:"ex"`
|
||||
NeedVerification int32 `json:"needVerification"`
|
||||
LookMemberInfo int32 `json:"lookMemberInfo"`
|
||||
ApplyMemberFriend int32 `json:"applyMemberFriend"`
|
||||
}
|
||||
|
||||
type CallbackBeforeSetGroupInfoResp struct {
|
||||
CommonCallbackResp
|
||||
GroupID string ` json:"groupID"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
Introduction string `json:"introduction"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Ex *string `json:"ex"`
|
||||
NeedVerification *int32 `json:"needVerification"`
|
||||
LookMemberInfo *int32 `json:"lookMemberInfo"`
|
||||
ApplyMemberFriend *int32 `json:"applyMemberFriend"`
|
||||
}
|
||||
|
||||
type CallbackAfterSetGroupInfoReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OperationID string `json:"operationID"`
|
||||
GroupID string `json:"groupID"`
|
||||
GroupName string `json:"groupName"`
|
||||
Notification string `json:"notification"`
|
||||
Introduction string `json:"introduction"`
|
||||
FaceURL string `json:"faceURL"`
|
||||
Ex *string `json:"ex"`
|
||||
NeedVerification *int32 `json:"needVerification"`
|
||||
LookMemberInfo *int32 `json:"lookMemberInfo"`
|
||||
ApplyMemberFriend *int32 `json:"applyMemberFriend"`
|
||||
}
|
||||
|
||||
type CallbackAfterSetGroupInfoResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
@@ -80,26 +80,6 @@ type CallbackMsgModifyCommandResp struct {
|
||||
Ex *string `json:"ex"`
|
||||
}
|
||||
|
||||
type CallbackSendGroupMsgErrorReq struct {
|
||||
CommonCallbackReq
|
||||
GroupID string `json:"groupID"`
|
||||
}
|
||||
|
||||
type CallbackSendGroupMsgErrorResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackSingleMsgRevokeReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
SendID string `json:"sendID"`
|
||||
ReceiveID string `json:"receiveID"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type CallbackSingleMsgRevokeResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackGroupMsgReadReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
SendID string `json:"sendID"`
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package callbackstruct
|
||||
|
||||
type CallbackAfterRevokeMsgReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
ConversationID string `json:"conversationID"`
|
||||
Seq int64 `json:"seq"`
|
||||
UserID string `json:"userID"`
|
||||
}
|
||||
type CallbackAfterRevokeMsgResp struct {
|
||||
CommonCallbackResp
|
||||
}
|
||||
Reference in New Issue
Block a user