diff --git a/tik_tok/md_tik_tok_goods.go b/tik_tok/md_tik_tok_goods.go index c913e2c..3b3b1f6 100644 --- a/tik_tok/md_tik_tok_goods.go +++ b/tik_tok/md_tik_tok_goods.go @@ -1,21 +1,21 @@ package tik_tok type TikTokGoods struct { - Commission string `json:"commission"` - CostPrice string `json:"cost_price"` - DetailURL string `json:"detail_url"` - GoodsID string `json:"goods_id"` - GoodsImg string `json:"goods_img"` - GoodsSales string `json:"goods_sales"` - GoodsTitle string `json:"goods_title"` - Imgs []string `json:"imgs"` - InStock string `json:"in_stock"` - Price string `json:"price"` - Sharable string `json:"sharable"` - ShopID string `json:"shop_id"` - ShopName string `json:"shop_name"` - ShopTotalScore string `json:"shop_total_score"` - YhqPrice string `json:"yhq_price"` + Commission string `json:"commission"` + CostPrice string `json:"cost_price"` + DetailURL string `json:"detail_url"` + GoodsID string `json:"goods_id"` + GoodsImg string `json:"goods_img"` + GoodsSales string `json:"goods_sales"` + GoodsTitle string `json:"goods_title"` + Imgs []string `json:"imgs"` + InStock string `json:"in_stock"` + Price string `json:"price"` + Sharable string `json:"sharable"` + ShopID string `json:"shop_id"` + ShopName string `json:"shop_name"` + ShopTotalScore ShopTotalScore1 `json:"shop_total_score"` + YhqPrice string `json:"yhq_price"` } type TikTokGoodsLm struct { @@ -39,7 +39,7 @@ type TikTokGoodsLm struct { ShopTotalScore ShopTotalScore `json:"shop_total_score"` } type ShopTotalScoreData struct { - Level string `json:"level"` + Level int `json:"level"` Score string `json:"score"` Text string `json:"text"` } @@ -48,6 +48,16 @@ type ShopTotalScore struct { ProductScore ShopTotalScoreData `json:"product_score"` ServiceScore ShopTotalScoreData `json:"service_score"` } +type ShopTotalScoreData1 struct { + Level string `json:"level"` + Score string `json:"score"` + Text string `json:"text"` +} +type ShopTotalScore1 struct { + LogisticsScore ShopTotalScoreData1 `json:"logistics_score"` + ProductScore ShopTotalScoreData1 `json:"product_score"` + ServiceScore ShopTotalScoreData1 `json:"service_score"` +} type TikTokLive struct { LiveId string `json:"live_id"` Name string `json:"name"` diff --git a/tik_tok/svc_tik_tok_goods.go b/tik_tok/svc_tik_tok_goods.go index 3c3e71c..80b67b0 100644 --- a/tik_tok/svc_tik_tok_goods.go +++ b/tik_tok/svc_tik_tok_goods.go @@ -117,6 +117,23 @@ func GetKlGoods(args map[string]string) TikTokGoods { return goodsList } func CommGoodsDetail(goods TikTokGoodsLm) TikTokGoods { + ShopTotalScore := ShopTotalScore1{ + LogisticsScore: ShopTotalScoreData1{ + Level: zhios_third_party_utils.IntToStr(goods.ShopTotalScore.LogisticsScore.Level), + Score: goods.ShopTotalScore.LogisticsScore.Score, + Text: goods.ShopTotalScore.LogisticsScore.Text, + }, + ProductScore: ShopTotalScoreData1{ + Level: zhios_third_party_utils.IntToStr(goods.ShopTotalScore.ProductScore.Level), + Score: goods.ShopTotalScore.ProductScore.Score, + Text: goods.ShopTotalScore.ProductScore.Text, + }, + ServiceScore: ShopTotalScoreData1{ + Level: zhios_third_party_utils.IntToStr(goods.ShopTotalScore.ServiceScore.Level), + Score: goods.ShopTotalScore.ServiceScore.Score, + Text: goods.ShopTotalScore.ServiceScore.Text, + }, + } var tmp = TikTokGoods{ Commission: zhios_third_party_utils.AnyToString(goods.CosRatio), @@ -132,7 +149,7 @@ func CommGoodsDetail(goods TikTokGoodsLm) TikTokGoods { Sharable: zhios_third_party_utils.AnyToString(goods.Sharable), ShopID: zhios_third_party_utils.AnyToString(goods.ShopID), ShopName: zhios_third_party_utils.AnyToString(goods.ShopName), - ShopTotalScore: zhios_third_party_utils.AnyToString(goods.ShopTotalScore), + ShopTotalScore: ShopTotalScore, YhqPrice: "0", } if zhios_third_party_utils.StrToFloat64(tmp.Price) == 0 {