diff --git a/internal/api/route.go b/internal/api/route.go index e9ce4cede..595c5ba39 100644 --- a/internal/api/route.go +++ b/internal/api/route.go @@ -221,6 +221,7 @@ func NewGinRouter(discov discoveryregistry.SvcDiscoveryRegistry, rdb redis.Unive statisticsGroup.POST("/group/create", g.GroupCreateCount) statisticsGroup.POST("/group/active", m.GetActiveGroup) } + callback := r.Group("/callbackExample") { callback.POST("/callbackBeforeSendSingleMsgCommand", m.CallbackExample) diff --git a/pkg/common/http/http_client.go b/pkg/common/http/http_client.go index a80d1c9a4..0525a2826 100644 --- a/pkg/common/http/http_client.go +++ b/pkg/common/http/http_client.go @@ -112,7 +112,9 @@ func callBackPostReturn(ctx context.Context, url, command string, input interfac //v.Set(constant.CallbackCommand, command) //url = url + "/" + v.Encode() url = url + "/" + command - b, err := Post(ctx, url, nil, input, callbackConfig.CallbackTimeOut) + header := map[string]string{} + header["operationID"] = ctx.Value(constant.OperationID).(string) + b, err := Post(ctx, url, header, input, callbackConfig.CallbackTimeOut) if err != nil { if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue { log.ZWarn(ctx, "callback failed but continue", err, "url", url)