mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
fix callback bug
This commit is contained in:
parent
76a3334f9d
commit
3a3412486a
@ -27,7 +27,7 @@ func callbackUserOnline(operationID, userID string, platformID int, token string
|
||||
},
|
||||
Seq: int(time.Now().UnixNano() / 1e6),
|
||||
}
|
||||
callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: callbackResp}
|
||||
callbackUserOnlineResp := &cbApi.CallbackUserOnlineResp{CommonCallbackResp: &callbackResp}
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOnlineCommand, callbackUserOnlineReq, callbackUserOnlineResp, config.Config.Callback.CallbackUserOnline.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
@ -52,7 +52,7 @@ func callbackUserOffline(operationID, userID string, platformID int) cbApi.Commo
|
||||
},
|
||||
Seq: int(time.Now().UnixNano() / 1e6),
|
||||
}
|
||||
callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: callbackResp}
|
||||
callbackUserOfflineResp := &cbApi.CallbackUserOfflineResp{CommonCallbackResp: &callbackResp}
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserOfflineCommand, callbackOfflineReq, callbackUserOfflineResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
@ -77,7 +77,7 @@ func callbackUserKickOff(operationID string, userID string, platformID int) cbAp
|
||||
},
|
||||
Seq: int(time.Now().UnixNano() / 1e6),
|
||||
}
|
||||
callbackUserKickOffResp := &cbApi.CallbackUserKickOffResp{CommonCallbackResp: callbackResp}
|
||||
callbackUserKickOffResp := &cbApi.CallbackUserKickOffResp{CommonCallbackResp: &callbackResp}
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackUserKickOffCommand, callbackUserKickOffReq, callbackUserKickOffResp, config.Config.Callback.CallbackUserOffline.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
|
@ -36,7 +36,7 @@ func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb.
|
||||
AtUserIDList: msg.AtUserIDList,
|
||||
Content: callback.GetContent(msg),
|
||||
}
|
||||
resp := &cbApi.CallbackBeforePushResp{CommonCallbackResp: callbackResp}
|
||||
resp := &cbApi.CallbackBeforePushResp{CommonCallbackResp: &callbackResp}
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackOfflinePushCommand, req, resp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
@ -84,7 +84,7 @@ func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.M
|
||||
AtUserIDList: msg.AtUserIDList,
|
||||
Content: callback.GetContent(msg),
|
||||
}
|
||||
resp := &cbApi.CallbackBeforePushResp{CommonCallbackResp: callbackResp}
|
||||
resp := &cbApi.CallbackBeforePushResp{CommonCallbackResp: &callbackResp}
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackOnlinePushCommand, req, resp, config.Config.Callback.CallbackOnlinePush.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
@ -126,7 +126,7 @@ func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg
|
||||
AtUserIDList: msg.AtUserIDList,
|
||||
Content: callback.GetContent(msg),
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeSuperGroupOnlinePushResp{CommonCallbackResp: callbackResp}
|
||||
resp := &cbApi.CallbackBeforeSuperGroupOnlinePushResp{CommonCallbackResp: &callbackResp}
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackSuperGroupOnlinePushCommand, req, resp, config.Config.Callback.CallbackBeforeSuperGroupOnlinePush.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
callbackResp.ErrMsg = err.Error()
|
||||
|
@ -26,7 +26,7 @@ func callbackBeforeAddFriend(req *pbFriend.AddFriendReq) cbApi.CommonCallbackRes
|
||||
OperationID: req.CommID.OperationID,
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeAddFriendResp{
|
||||
CommonCallbackResp: callbackResp,
|
||||
CommonCallbackResp: &callbackResp,
|
||||
}
|
||||
//utils.CopyStructFields(req, msg.MsgData)
|
||||
defer log.NewDebug(req.CommID.OperationID, utils.GetSelfFuncName(), commonCallbackReq, *resp)
|
||||
|
@ -21,7 +21,7 @@ func callbackBeforeCreateGroup(req *pbGroup.CreateGroupReq) cbApi.CommonCallback
|
||||
CallbackCommand: constant.CallbackBeforeCreateGroupCommand,
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeCreateGroupResp{
|
||||
CommonCallbackResp: callbackResp,
|
||||
CommonCallbackResp: &callbackResp,
|
||||
}
|
||||
//utils.CopyStructFields(req, msg.MsgData)
|
||||
defer log.NewDebug(req.OperationID, utils.GetSelfFuncName(), commonCallbackReq, *resp)
|
||||
|
@ -47,7 +47,7 @@ func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackRes
|
||||
RecvID: msg.MsgData.RecvID,
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeSendSingleMsgResp{
|
||||
CommonCallbackResp: callbackResp,
|
||||
CommonCallbackResp: &callbackResp,
|
||||
}
|
||||
//utils.CopyStructFields(req, msg.MsgData)
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
@ -77,7 +77,7 @@ func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
RecvID: msg.MsgData.RecvID,
|
||||
}
|
||||
resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: callbackResp}
|
||||
resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackAfterSendSingleMsgCommand, req, resp, config.Config.Callback.CallbackAfterSendSingleMsg.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
@ -99,7 +99,7 @@ func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
GroupID: msg.MsgData.GroupID,
|
||||
}
|
||||
resp := &cbApi.CallbackBeforeSendGroupMsgResp{CommonCallbackResp: callbackResp}
|
||||
resp := &cbApi.CallbackBeforeSendGroupMsgResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackBeforeSendGroupMsgCommand, req, resp, config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
@ -127,7 +127,7 @@ func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
GroupID: msg.MsgData.GroupID,
|
||||
}
|
||||
resp := &cbApi.CallbackAfterSendGroupMsgResp{CommonCallbackResp: callbackResp}
|
||||
resp := &cbApi.CallbackAfterSendGroupMsgResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackAfterSendGroupMsgCommand, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
@ -148,7 +148,7 @@ func callbackMsgModify(msg *pbChat.SendMsgReq) cbApi.CommonCallbackResp {
|
||||
req := cbApi.CallbackMsgModifyCommandReq{
|
||||
CommonCallbackReq: commonCallbackReq,
|
||||
}
|
||||
resp := &cbApi.CallbackMsgModifyCommandResp{CommonCallbackResp: callbackResp}
|
||||
resp := &cbApi.CallbackMsgModifyCommandResp{CommonCallbackResp: &callbackResp}
|
||||
defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp)
|
||||
if err := http.CallBackPostReturn(config.Config.Callback.CallbackUrl, constant.CallbackMsgModifyCommand, req, resp, config.Config.Callback.CallbackMsgModify.CallbackTimeOut); err != nil {
|
||||
callbackResp.ErrCode = http2.StatusInternalServerError
|
||||
|
@ -9,5 +9,5 @@ type CallbackBeforeAddFriendReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeAddFriendResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ type CallbackBeforeCreateGroupReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeCreateGroupResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
GroupID *string `json:"groupID"`
|
||||
GroupName *string `json:"groupName"`
|
||||
Notification *string `json:"notification"`
|
||||
|
@ -8,7 +8,7 @@ type CallbackBeforeSendSingleMsgReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeSendSingleMsgResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterSendSingleMsgReq struct {
|
||||
@ -17,7 +17,7 @@ type CallbackAfterSendSingleMsgReq struct {
|
||||
}
|
||||
|
||||
type CallbackAfterSendSingleMsgResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackBeforeSendGroupMsgReq struct {
|
||||
@ -26,7 +26,7 @@ type CallbackBeforeSendGroupMsgReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeSendGroupMsgResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackAfterSendGroupMsgReq struct {
|
||||
@ -35,7 +35,7 @@ type CallbackAfterSendGroupMsgReq struct {
|
||||
}
|
||||
|
||||
type CallbackAfterSendGroupMsgResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackMsgModifyCommandReq struct {
|
||||
@ -43,7 +43,7 @@ type CallbackMsgModifyCommandReq struct {
|
||||
}
|
||||
|
||||
type CallbackMsgModifyCommandResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
Content *string `json:"content"`
|
||||
RecvID *string `json:"recvID"`
|
||||
GroupID *string `json:"groupID"`
|
||||
|
@ -7,7 +7,7 @@ type CallbackUserOnlineReq struct {
|
||||
}
|
||||
|
||||
type CallbackUserOnlineResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackUserOfflineReq struct {
|
||||
@ -16,7 +16,7 @@ type CallbackUserOfflineReq struct {
|
||||
}
|
||||
|
||||
type CallbackUserOfflineResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
}
|
||||
|
||||
type CallbackUserKickOffReq struct {
|
||||
@ -25,5 +25,5 @@ type CallbackUserKickOffReq struct {
|
||||
}
|
||||
|
||||
type CallbackUserKickOffResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ type CallbackBeforePushReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforePushResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
UserIDList []string `json:"userIDList"`
|
||||
OfflinePushInfo *commonPb.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
}
|
||||
@ -33,7 +33,7 @@ type CallbackBeforeSuperGroupOnlinePushReq struct {
|
||||
}
|
||||
|
||||
type CallbackBeforeSuperGroupOnlinePushResp struct {
|
||||
CommonCallbackResp
|
||||
*CommonCallbackResp
|
||||
UserIDList []string `json:"userIDList"`
|
||||
OfflinePushInfo *commonPb.OfflinePushInfo `json:"offlinePushInfo"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user