|
@@ -131,6 +131,40 @@ func CsjpGoodsDetail(args map[string]string) TikTokGoods { |
|
|
// |
|
|
// |
|
|
return goodsList |
|
|
return goodsList |
|
|
} |
|
|
} |
|
|
|
|
|
func CsjpGoodsDetailMore(args map[string]string) []TikTokGoods { |
|
|
|
|
|
|
|
|
|
|
|
params := map[string]interface{}{} |
|
|
|
|
|
if args["product_ids"] != "" { |
|
|
|
|
|
ex := strings.Split(args["product_ids"], ",") |
|
|
|
|
|
ids := make([]int, 0) |
|
|
|
|
|
for _, v := range ex { |
|
|
|
|
|
ids = append(ids, zhios_third_party_utils.StrToInt(v)) |
|
|
|
|
|
} |
|
|
|
|
|
params["product_ids"] = ids |
|
|
|
|
|
} |
|
|
|
|
|
send, err := CsjpSend(args["app_id"], args["app_secret"], "product/detail", params) |
|
|
|
|
|
var goodsList = make([]TikTokGoods, 0) |
|
|
|
|
|
product := gjson.Get(send, "data.products").String() |
|
|
|
|
|
if err != nil || product == "" { |
|
|
|
|
|
return goodsList |
|
|
|
|
|
} |
|
|
|
|
|
var lmData struct { |
|
|
|
|
|
Data struct { |
|
|
|
|
|
Products []TikTokGoodsLm `json:"products"` |
|
|
|
|
|
} `json:"data"` |
|
|
|
|
|
} |
|
|
|
|
|
err = json.Unmarshal([]byte(send), &lmData) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return goodsList |
|
|
|
|
|
} |
|
|
|
|
|
for _, v := range lmData.Data.Products { |
|
|
|
|
|
v.CosRatio = v.CosRatio / 100 |
|
|
|
|
|
tmp := CommGoodsDetail(v) |
|
|
|
|
|
goodsList = append(goodsList, tmp) |
|
|
|
|
|
} |
|
|
|
|
|
// |
|
|
|
|
|
return goodsList |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//3.2.2 商品转链接口 |
|
|
//3.2.2 商品转链接口 |
|
|
func CsjpGoodsLink(args map[string]string) (string, error) { |
|
|
func CsjpGoodsLink(args map[string]string) (string, error) { |
|
|