common/http增加headers参数
This commit is contained in:
2
go.mod
2
go.mod
@@ -3,7 +3,7 @@ module order
|
||||
go 1.25.3
|
||||
|
||||
require (
|
||||
gitee.com/red-future---jilin-g/common v0.2.1
|
||||
gitee.com/red-future---jilin-g/common v0.2.5
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.6
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.6
|
||||
github.com/gogf/gf/v2 v2.9.6
|
||||
|
||||
3
go.sum
3
go.sum
@@ -1,5 +1,6 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
gitee.com/red-future---jilin-g/common v0.2.1/go.mod h1:TFCNnI7801DamWd0m/M2CT5T090jFXXGLNDY4iZ2WY8=
|
||||
gitee.com/red-future---jilin-g/common v0.2.5 h1:0T4chOMw9aXbA9RvP8d0814xLbisjzrMPhgqbCTa12M=
|
||||
gitee.com/red-future---jilin-g/common v0.2.5/go.mod h1:TFCNnI7801DamWd0m/M2CT5T090jFXXGLNDY4iZ2WY8=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
|
||||
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
|
||||
|
||||
@@ -689,7 +689,7 @@ func (s *order) getAssetFromAssetService(ctx context.Context, tenantID, assetID
|
||||
// 这里应该调用assets服务的getAsset接口
|
||||
// 暂时返回模拟数据
|
||||
var assetResp AssetServiceResponse
|
||||
err := http.Get(ctx, fmt.Sprintf("http://assets-service/internal/asset/%s", assetID), &assetResp)
|
||||
err := http.Get(ctx, fmt.Sprintf("http://assets-service/internal/asset/%s", assetID), nil, &assetResp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -711,7 +711,7 @@ func (s *order) deductStockFromAssetService(ctx context.Context, tenantID, asset
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
err := http.Post(ctx, "http://assets-service/internal/stock/deduct", &result, req)
|
||||
err := http.Post(ctx, "http://assets-service/internal/stock/deduct", nil, &result, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -737,7 +737,7 @@ func (s *order) refundStockFromAssetService(ctx context.Context, tenantID, asset
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
err := http.Post(ctx, "http://assets-service/internal/stock/refund", &result, req)
|
||||
err := http.Post(ctx, "http://assets-service/internal/stock/refund", nil, &result, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ func (s *payment) getAssetFromAssetService(ctx context.Context, tenantID, assetI
|
||||
// 这里应该调用assets服务的getAsset接口
|
||||
// 暂时返回模拟数据
|
||||
var assetResp AssetServiceResponse
|
||||
err := http.Get(ctx, fmt.Sprintf("http://assets-service/internal/asset/%s", assetID), &assetResp)
|
||||
err := http.Get(ctx, fmt.Sprintf("http://assets-service/internal/asset/%s", assetID), nil, &assetResp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -489,7 +489,7 @@ func (s *payment) deductStockFromAssetService(ctx context.Context, tenantID, ass
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
err := http.Post(ctx, "http://assets-service/internal/stock/deduct", &result, req)
|
||||
err := http.Post(ctx, "http://assets-service/internal/stock/deduct", nil, &result, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -515,7 +515,7 @@ func (s *payment) refundStockFromAssetService(ctx context.Context, tenantID, ass
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
err := http.Post(ctx, "http://assets-service/internal/stock/refund", &result, req)
|
||||
err := http.Post(ctx, "http://assets-service/internal/stock/refund", nil, &result, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user