diff --git a/config/config.yaml b/config/config.yaml index 7d326758d..3f4e853e6 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -196,18 +196,18 @@ callback: callbackUrl : "http://127.0.0.1:8080/callback" # 开启关闭操作前后回调的配置 callbackbeforeSendSingleMsg: - enable: true # 回调是否启用 + enable: false # 回调是否启用 callbackTimeOut: 2 # 回调超时时间 CallbackFailedContinue: true # 回调超时是否继续执行代码 callbackAfterSendSingleMsg: - enable: true + enable: false callbackTimeOut: 2 callbackBeforeSendGroupMsg: - enable: true + enable: false callbackTimeOut: 2 CallbackFailedContinue: true callbackAfterSendGroupMsg: - enable: true + enable: false callbackTimeOut: 2 callbackWordFilter: enable: true diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index 9dc90eb50..a09b1e87c 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -28,7 +28,6 @@ func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbApi.CommonCallbackReq } func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { - log.NewDebug(msg.OperationID, config.Config.Callback.CallbackBeforeSendSingleMsg.Enable) if !config.Config.Callback.CallbackBeforeSendSingleMsg.Enable { return true, nil } @@ -58,7 +57,6 @@ func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err erro func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error { - log.NewDebug(msg.OperationID, config.Config.Callback.CallbackAfterSendSingleMsg.Enable) if !config.Config.Callback.CallbackAfterSendSingleMsg.Enable { return nil } @@ -80,7 +78,6 @@ func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error { func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { - log.NewDebug(msg.OperationID, config.Config.Callback.CallbackBeforeSendGroupMsg.Enable) if !config.Config.Callback.CallbackBeforeSendGroupMsg.Enable { return true, nil } @@ -103,11 +100,11 @@ func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error return false, nil } } + log.NewInfo() return true, err } func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) error { - log.NewDebug(msg.OperationID, config.Config.Callback.CallbackAfterSendGroupMsg.Enable) if !config.Config.Callback.CallbackAfterSendGroupMsg.Enable { return nil } @@ -130,7 +127,6 @@ func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) error { func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { - log.NewDebug(msg.OperationID, config.Config.Callback.CallbackWordFilter.Enable) if !config.Config.Callback.CallbackWordFilter.Enable || msg.MsgData.ContentType != constant.Text { return true, nil } @@ -157,6 +153,7 @@ func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { } log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content)) } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), err.Error()) return true, err } diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 739a28171..af8f40b4f 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -243,7 +243,7 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S } // callback if err := callbackAfterSendGroupMsg(pb); err != nil { - log.NewError(pb.OperationID, utils.GetSelfFuncName(), "CallBackAfterSendMsg failed", err.Error()) + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg failed", err.Error()) } return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime) default: