aa
This commit is contained in:
@@ -205,3 +205,31 @@ func (a *API) ResourceURLGen(pid string, resourceType int) (resourceURLGenResult
|
||||
}
|
||||
return resourceURLGenResult, err
|
||||
}
|
||||
|
||||
//生成商品推广链接
|
||||
func (a *API) GoodsPromotionURLGen(pid string, goodsID string) (resourceURLGenResult *ResourceURLGenResult, err error) {
|
||||
result, err := a.AccessAPI("pdd.ddk.goods.promotion.url.generate", false, map[string]interface{}{
|
||||
"p_id": pid,
|
||||
//"generate_short_url": true,
|
||||
"goods_sign_list": []string{"\"" + goodsID + "\""},
|
||||
})
|
||||
if err == nil {
|
||||
utils.Map2StructByJson(result["resource_url_response"], &resourceURLGenResult, false)
|
||||
}
|
||||
return resourceURLGenResult, err
|
||||
}
|
||||
|
||||
//查询是否绑定备案
|
||||
func (a *API) MemberAuthorityQuery(pid string) (bool bool, err error) {
|
||||
result, err := a.AccessAPI("pdd.ddk.member.authority.query", false, map[string]interface{}{
|
||||
"pid": pid,
|
||||
})
|
||||
if err == nil {
|
||||
if utils.MustInterface2Int64(result["authority_query_response"].(map[string]interface{})["bind"]) == 0 {
|
||||
return false, err
|
||||
} else {
|
||||
return true, err
|
||||
}
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user