fix: callback post reqeust lack of operation header

This commit is contained in:
luhaoling 2024-01-15 14:45:27 +08:00
parent 4dc2313bbc
commit 3202e8dff3
2 changed files with 4 additions and 1 deletions

View File

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

View File

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