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