huangjiajun 5 days ago
parent
commit
37309e1174
1 changed files with 37 additions and 0 deletions
  1. +37
    -0
      pdd_union/extend_url.go

+ 37
- 0
pdd_union/extend_url.go View File

@@ -126,6 +126,43 @@ func WnMainThemeUrl(keyArr map[string]string, param map[string]interface{}) map[
}
return tmp
}
func OwnWnMainThemeUrl(keyArr map[string]string, param map[string]interface{}) map[string]string {
send, _ := Send(keyArr, "pdd.ddk.goods.zs.unit.url.gen", param)
var res cps_pdd.WnMainThemeUrl
json.Unmarshal([]byte(send), &res)
tmp := map[string]string{
"url": "",
"open_app_url": "",
"no_open_app_url": "",
"page_path": "",
"schema_url": "",
}
tmp["url"] = res.GoodsZsUnitGenerateResponse.ShortUrl
tmp["open_app_url"] = res.GoodsZsUnitGenerateResponse.MobileUrl
tmp["short_open_url"] = res.GoodsZsUnitGenerateResponse.MobileShortUrl
tmp["no_open_app_url"] = res.GoodsZsUnitGenerateResponse.ShortUrl
tmp["page_path"] = res.GoodsZsUnitGenerateResponse.WeAppInfo.PagePath
tmp["schema_url"] = res.GoodsZsUnitGenerateResponse.SchemaUrl
if param["open_app"] == "<nil>" || param["open_app"] == nil {
param["open_app"] = ""
}
if param["link_type"] == "<nil>" || param["link_type"] == nil {
param["link_type"] = ""
}
if param["open_app"] == "" && param["link_type"] != "" {
tmp["url"] = res.GoodsZsUnitGenerateResponse.Url
}
if param["open_app"] != "" {
tmp["url"] = res.GoodsZsUnitGenerateResponse.MobileShortUrl
}
if param["open_app"] != "" && param["link_type"] != "" {
tmp["url"] = res.GoodsZsUnitGenerateResponse.MobileUrl
}
if res.GoodsZsUnitGenerateResponse.WeAppInfo.PagePath == "" {
tmp["page_path"] = res.GoodsZsUnitGenerateResponse.WeAppPagePath
}
return tmp
}

// https://open.pinduoduo.com/application/document/api?id=pdd.ddk.oauth.rp.prom.url.generate
func RpUrl(keyArr map[string]string, param map[string]interface{}) map[string]string {


Loading…
Cancel
Save