From 16f215a82bf5f1f2b283eaba5e54616a2f1afe28 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 9 Jun 2023 17:55:41 +0800 Subject: [PATCH] callback log --- internal/rpc/msg/callback.go | 4 ++-- pkg/common/http/http_client.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index 969304ccb..6fb035b81 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -71,7 +71,7 @@ func callbackBeforeSendGroupMsg(ctx context.Context, msg *pbChat.SendMsgReq) err GroupID: msg.MsgData.GroupID, } resp := &cbapi.CallbackBeforeSendGroupMsgResp{} - return http.CallBackPostReturn(ctx, cbURL(), req, resp, config.Config.Callback.CallbackAfterSendSingleMsg) + return http.CallBackPostReturn(ctx, cbURL(), req, resp, config.Config.Callback.CallbackBeforeSendGroupMsg) } func callbackAfterSendGroupMsg(ctx context.Context, msg *pbChat.SendMsgReq) error { @@ -94,7 +94,7 @@ func callbackMsgModify(ctx context.Context, msg *pbChat.SendMsgReq) error { CommonCallbackReq: toCommonCallback(ctx, msg, constant.CallbackMsgModifyCommand), } resp := &cbapi.CallbackMsgModifyCommandResp{} - if err := http.CallBackPostReturn(ctx, cbURL(), req, resp, config.Config.Callback.CallbackAfterSendGroupMsg); err != nil { + if err := http.CallBackPostReturn(ctx, cbURL(), req, resp, config.Config.Callback.CallbackMsgModify); err != nil { return err } if resp.Content != nil { diff --git a/pkg/common/http/http_client.go b/pkg/common/http/http_client.go index 25de275c8..9f4349bb5 100644 --- a/pkg/common/http/http_client.go +++ b/pkg/common/http/http_client.go @@ -82,6 +82,7 @@ func PostReturn(ctx context.Context, url string, header map[string]string, input } func callBackPostReturn(ctx context.Context, url, command string, input interface{}, output callbackstruct.CallbackResp, callbackConfig config.CallBackConfig) error { + log.ZDebug(ctx, "callback", "url", url, "command", command, "input", input, "callbackConfig", callbackConfig) v := urlLib.Values{} v.Set(constant.CallbackCommand, command) url = url + "?" + v.Encode()