fix callback bug

This commit is contained in:
wangchuxiao 2022-11-08 17:10:27 +08:00
parent 76a3334f9d
commit 3a3412486a
10 changed files with 25 additions and 25 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -9,5 +9,5 @@ type CallbackBeforeAddFriendReq struct {
}
type CallbackBeforeAddFriendResp struct {
CommonCallbackResp
*CommonCallbackResp
}

View File

@ -10,7 +10,7 @@ type CallbackBeforeCreateGroupReq struct {
}
type CallbackBeforeCreateGroupResp struct {
CommonCallbackResp
*CommonCallbackResp
GroupID *string `json:"groupID"`
GroupName *string `json:"groupName"`
Notification *string `json:"notification"`

View File

@ -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"`

View File

@ -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
}

View File

@ -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"`
}