Browse Source

add reverse:for v1.0.8 团长商品调整

tags/v1.0.8
huangjiajun 2 years ago
parent
commit
632f645fdc
2 changed files with 28 additions and 20 deletions
  1. +19
    -18
      tik_tok/md_tik_tok_goods.go
  2. +9
    -2
      tik_tok/svc_tik_tok_team.go

+ 19
- 18
tik_tok/md_tik_tok_goods.go View File

@@ -19,24 +19,25 @@ type TikTokGoods struct {
} }


type TikTokGoodsLm 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 { type ShopTotalScoreData struct {
Level int `json:"level"` Level int `json:"level"`


+ 9
- 2
tik_tok/svc_tik_tok_team.go View File

@@ -1,6 +1,7 @@
package tik_tok package tik_tok


import ( import (
zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
@@ -38,12 +39,13 @@ func ActivityProduct(args map[string]string) []TikTokGoods {
//args = map[string]string{ //args = map[string]string{
// "appkey": "7136155008692651560", // "appkey": "7136155008692651560",
// "appSecret": "b132549f-f62c-491e-86f1-89af3658896a", // "appSecret": "b132549f-f62c-491e-86f1-89af3658896a",
// "activity_id": "468745",
// "activity_id": "437153",
// "search_type": "0", // "search_type": "0",
// "sort_type": "1", // "sort_type": "1",
// "page": "1", // "page": "1",
// "count": "20", // "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"]} 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"]) 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 return goodsList
} }
for _, v := range lmData.Data.Data { for _, v := range lmData.Data.Data {
if v.ActivityCosRatio > 0 {
v.CosRatio = v.ActivityCosRatio / 100
}
tmp := CommGoodsDetail(v) tmp := CommGoodsDetail(v)

goodsList = append(goodsList, tmp) goodsList = append(goodsList, tmp)
} }
fmt.Println(string(zhios_third_party_utils.Serialize(goodsList)))
return goodsList return goodsList
} }
func ProductUrl(args map[string]string) map[string]string { func ProductUrl(args map[string]string) map[string]string {


Loading…
Cancel
Save