mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 09:36:00 +08:00
callback
This commit is contained in:
@@ -56,10 +56,14 @@ func (c CommonCallbackResp) Parse() error {
|
||||
type UserStatusBaseCallback struct {
|
||||
CallbackCommand string `json:"callbackCommand"`
|
||||
OperationID string `json:"operationID"`
|
||||
PlatformID int32 `json:"platformID"`
|
||||
PlatformID int `json:"platformID"`
|
||||
Platform string `json:"platform"`
|
||||
}
|
||||
|
||||
func (c UserStatusBaseCallback) GetCallbackCommand() string {
|
||||
return c.CallbackCommand
|
||||
}
|
||||
|
||||
type UserStatusCallbackReq struct {
|
||||
UserStatusBaseCallback
|
||||
UserID string `json:"userID"`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package callbackstruct
|
||||
|
||||
type CallbackBeforeAddFriendReq struct {
|
||||
CallbackCommand string `json:"callbackCommand"`
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
FromUserID string `json:"fromUserID" `
|
||||
ToUserID string `json:"toUserID"`
|
||||
ReqMsg string `json:"reqMsg"`
|
||||
|
||||
@@ -67,8 +67,8 @@ type CallbackMsgModifyCommandResp struct {
|
||||
Ex *string `json:"ex"`
|
||||
}
|
||||
type CallbackBeforeSetMessageReactionExtReq struct {
|
||||
OperationID string `json:"operationID"`
|
||||
CallbackCommand string `json:"callbackCommand"`
|
||||
OperationID string `json:"operationID"`
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
SourceID string `json:"sourceID"`
|
||||
OpUserID string `json:"opUserID"`
|
||||
SessionType int32 `json:"sessionType"`
|
||||
@@ -84,8 +84,8 @@ type CallbackBeforeSetMessageReactionExtResp struct {
|
||||
MsgFirstModifyTime int64 `json:"msgFirstModifyTime"`
|
||||
}
|
||||
type CallbackDeleteMessageReactionExtReq struct {
|
||||
CallbackCommand `json:"callbackCommand"`
|
||||
OperationID string `json:"operationID"`
|
||||
CallbackCommand string `json:"callbackCommand"`
|
||||
SourceID string `json:"sourceID"`
|
||||
OpUserID string `json:"opUserID"`
|
||||
SessionType int32 `json:"sessionType"`
|
||||
|
||||
@@ -2,8 +2,8 @@ package callbackstruct
|
||||
|
||||
type CallbackUserOnlineReq struct {
|
||||
UserStatusCallbackReq
|
||||
Token string `json:"token"`
|
||||
Seq int `json:"seq"`
|
||||
//Token string `json:"token"`
|
||||
Seq int64 `json:"seq"`
|
||||
IsAppBackground bool `json:"isAppBackground"`
|
||||
ConnID string `json:"connID"`
|
||||
}
|
||||
@@ -14,7 +14,7 @@ type CallbackUserOnlineResp struct {
|
||||
|
||||
type CallbackUserOfflineReq struct {
|
||||
UserStatusCallbackReq
|
||||
Seq int `json:"seq"`
|
||||
Seq int64 `json:"seq"`
|
||||
ConnID string `json:"connID"`
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ type CallbackUserOfflineResp struct {
|
||||
|
||||
type CallbackUserKickOffReq struct {
|
||||
UserStatusCallbackReq
|
||||
Seq int `json:"seq"`
|
||||
Seq int64 `json:"seq"`
|
||||
}
|
||||
|
||||
type CallbackUserKickOffResp struct {
|
||||
|
||||
@@ -59,7 +59,7 @@ func Post(url string, data interface{}, timeOutSecond int) (content []byte, err
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func CallBackPostReturn(url, callbackCommand string, input interface{}, output cbapi.CallbackResp, callbackConfig config.CallBackConfig) error {
|
||||
func callBackPostReturn(url, callbackCommand string, input interface{}, output cbapi.CallbackResp, callbackConfig config.CallBackConfig) error {
|
||||
v := urlLib.Values{}
|
||||
v.Set("callbackCommand", callbackCommand)
|
||||
url = url + "?" + v.Encode()
|
||||
@@ -79,6 +79,6 @@ func CallBackPostReturn(url, callbackCommand string, input interface{}, output c
|
||||
return output.Parse()
|
||||
}
|
||||
|
||||
func CallBackPostReturnV2(url string, req cbapi.CallbackReq, resp cbapi.CallbackResp, callbackConfig config.CallBackConfig) error {
|
||||
return CallBackPostReturn(url, req.GetCallbackCommand(), req, resp, callbackConfig)
|
||||
func CallBackPostReturn(url string, req cbapi.CallbackReq, resp cbapi.CallbackResp, callbackConfig config.CallBackConfig) error {
|
||||
return callBackPostReturn(url, req.GetCallbackCommand(), req, resp, callbackConfig)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user