@@ -19,24 +19,25 @@ type TikTokGoods struct { | |||
} | |||
type TikTokGoodsLm struct { | |||
CosFee int64 `json:"cos_fee"` | |||
CosRatio float64 `json:"cos_ratio"` | |||
CouponPrice int64 `json:"coupon_price"` | |||
Cover string `json:"cover"` | |||
DetailURL string `json:"detail_url"` | |||
FirstCid int64 `json:"first_cid"` | |||
InStock interface{} `json:"in_stock"` | |||
Price int64 `json:"price"` | |||
ProductID int64 `json:"product_id"` | |||
Sales int64 `json:"sales"` | |||
SecondCid int64 `json:"second_cid"` | |||
Sharable interface{} `json:"sharable"` | |||
ShopID int64 `json:"shop_id"` | |||
ShopName string `json:"shop_name"` | |||
ThirdCid int64 `json:"third_cid"` | |||
Title string `json:"title"` | |||
Imgs []string `json:"imgs"` | |||
ShopTotalScore ShopTotalScore `json:"shop_total_score"` | |||
CosFee int64 `json:"cos_fee"` | |||
CosRatio float64 `json:"cos_ratio"` | |||
ActivityCosRatio float64 `json:"activity_cos_ratio"` | |||
CouponPrice int64 `json:"coupon_price"` | |||
Cover string `json:"cover"` | |||
DetailURL string `json:"detail_url"` | |||
FirstCid int64 `json:"first_cid"` | |||
InStock interface{} `json:"in_stock"` | |||
Price int64 `json:"price"` | |||
ProductID int64 `json:"product_id"` | |||
Sales int64 `json:"sales"` | |||
SecondCid int64 `json:"second_cid"` | |||
Sharable interface{} `json:"sharable"` | |||
ShopID int64 `json:"shop_id"` | |||
ShopName string `json:"shop_name"` | |||
ThirdCid int64 `json:"third_cid"` | |||
Title string `json:"title"` | |||
Imgs []string `json:"imgs"` | |||
ShopTotalScore ShopTotalScore `json:"shop_total_score"` | |||
} | |||
type ShopTotalScoreData struct { | |||
Level int `json:"level"` | |||
@@ -1,6 +1,7 @@ | |||
package tik_tok | |||
import ( | |||
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils" | |||
"encoding/json" | |||
"fmt" | |||
"github.com/tidwall/gjson" | |||
@@ -38,12 +39,13 @@ func ActivityProduct(args map[string]string) []TikTokGoods { | |||
//args = map[string]string{ | |||
// "appkey": "7136155008692651560", | |||
// "appSecret": "b132549f-f62c-491e-86f1-89af3658896a", | |||
// "activity_id": "468745", | |||
// "activity_id": "437153", | |||
// "search_type": "0", | |||
// "sort_type": "1", | |||
// "page": "1", | |||
// "count": "20", | |||
// "acctoken": "21af5cb7-6a14-455f-90f7-6807b5e6655f", | |||
// "status": "1", | |||
// "acctoken": "ff1a797c-a088-47bf-8c31-9784fa630c5e", | |||
//} | |||
params := map[string]interface{}{"status": args["status"], "activity_id": args["activity_id"], "search_type": args["search_type"], "sort_type": args["sort_type"], "page": args["page"], "count": args["count"]} | |||
send, err := Send(args["appkey"], args["appSecret"], "alliance.colonelActivityProduct", params, args["acctoken"]) | |||
@@ -64,9 +66,14 @@ func ActivityProduct(args map[string]string) []TikTokGoods { | |||
return goodsList | |||
} | |||
for _, v := range lmData.Data.Data { | |||
if v.ActivityCosRatio > 0 { | |||
v.CosRatio = v.ActivityCosRatio / 100 | |||
} | |||
tmp := CommGoodsDetail(v) | |||
goodsList = append(goodsList, tmp) | |||
} | |||
fmt.Println(string(zhios_third_party_utils.Serialize(goodsList))) | |||
return goodsList | |||
} | |||
func ProductUrl(args map[string]string) map[string]string { | |||