Bläddra i källkod

add reverse:for v1.1.4 抖音接口

tags/v1.1.4
huangjiajun 2 år sedan
förälder
incheckning
4084262504
1 ändrade filer med 31 tillägg och 5 borttagningar
  1. +31
    -5
      tik_tok/svc_tik_tok_goods.go

+ 31
- 5
tik_tok/svc_tik_tok_goods.go Visa fil

@@ -80,11 +80,7 @@ func GoodsList(args map[string]string) []TikTokGoods {

//详情
func GetDetail(args map[string]string) TikTokGoods {
productIds := strings.Split(args["id"], ",")
if len(productIds) == 0 {
return TikTokGoods{}
}
params := map[string]interface{}{"product_ids": productIds, "with_share_status": true}
params := map[string]interface{}{"product_ids": []string{args["id"]}, "with_share_status": true}
send, err := Send(args["appkey"], args["appSecret"], "alliance.materialsProductsDetails", params, args["acctoken"])
var goodsList = TikTokGoods{}
product := gjson.Get(send, "data.products").String()
@@ -109,6 +105,36 @@ func GetDetail(args map[string]string) TikTokGoods {
//
return goodsList
}

//详情
func GetDetailMore(args map[string]string) *[]TikTokGoods {
productIds := strings.Split(args["id"], ",")
if len(productIds) == 0 {
return nil
}
params := map[string]interface{}{"product_ids": productIds, "with_share_status": true}
send, err := Send(args["appkey"], args["appSecret"], "alliance.materialsProductsDetails", params, args["acctoken"])
var goodsList = make([]TikTokGoods, 0)
product := gjson.Get(send, "data.products").String()
if err != nil || product == "" {
return nil
}
var lmData struct {
Data struct {
Products []TikTokGoodsLm `json:"products"`
} `json:"data"`
}
err = json.Unmarshal([]byte(send), &lmData)
if err != nil {
return nil
}
for _, v := range lmData.Data.Products {
tmp := CommGoodsDetail(v)
goodsList = append(goodsList, tmp)
}
//
return &goodsList
}
func GetKlGoods(args map[string]string) TikTokGoods {
content, _ := php2go.Base64Decode(args["content"])
params := map[string]interface{}{"command": content}


Laddar…
Avbryt
Spara