修改京东取链
This commit is contained in:
parent
edc20b3c7a
commit
a92f4890da
@ -124,9 +124,6 @@ func (t *jdUnionApiImpl) PromotionLink(req PromotionLinkRequest) (*PromotionLink
|
||||
"positionId": req.PositionId,
|
||||
"siteId": req.SiteId,
|
||||
}
|
||||
if req.PositionId > 0 {
|
||||
params["positionId"] = req.PositionId
|
||||
}
|
||||
requestPrams := map[string]any{
|
||||
"promotionCodeReq": params,
|
||||
}
|
||||
|
||||
@ -32,9 +32,7 @@ func (z *zheTaoKeApiImpl) PromotionLink(req PromotionLinkRequest) (*PromotionLin
|
||||
"unionId": z.client.authConfig.UnionId,
|
||||
"materialId": req.MaterialId,
|
||||
"chainType": req.ChainType,
|
||||
}
|
||||
if req.PositionId > 0 {
|
||||
params["positionId"] = req.PositionId
|
||||
"positionId": req.PositionId,
|
||||
}
|
||||
|
||||
request := &client.HttpRequest{Headers: z.client.headers, QueryArgs: params}
|
||||
|
||||
@ -23,16 +23,16 @@ func TestApiClient(t *testing.T) {
|
||||
func (a *apiClientSuite) SetupSuite() {
|
||||
log := logx.WithContext(context.Background())
|
||||
apiClient := NewApiClient(log, AuthConfig{
|
||||
AppKey: "",
|
||||
UnionId: "",
|
||||
AppKey: "de6307e7af054f69bd2506696d96e47d",
|
||||
UnionId: "2036695914",
|
||||
})
|
||||
a.api = apiClient
|
||||
}
|
||||
|
||||
func (a *apiClientSuite) Test_PromotionLink() {
|
||||
data := PromotionLinkRequest{
|
||||
MaterialId: "https://u.jd.com/rDPUXnL", //推广物料url,例如活动链接、商品链接等;支持仅传入skuid
|
||||
PositionId: 100343888999, //自定义推广位id,自定义的数字,自己在本地跟用户做好关联,订单中会透出自定义的数字
|
||||
MaterialId: "https://u.jd.com/r6NhFBF", //推广物料url,例如活动链接、商品链接等;支持仅传入skuid
|
||||
PositionId: 131, //自定义推广位id,自定义的数字,自己在本地跟用户做好关联,订单中会透出自定义的数字
|
||||
ChainType: 3, // 转链类型,1:长链, 2 :短链 ,3: 长链+短链,默认短链,短链有效期60天
|
||||
}
|
||||
resp, err := a.api.PromotionLink(data)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user