diff --git a/go.mod b/go.mod index 4432d25..1b72a45 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/nilorg/sdk v0.0.0-20221104025912-4b6ccb7004d8 github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/gomega v1.19.0 // indirect + github.com/shopspring/decimal v1.2.0 github.com/syyongx/php2go v0.9.7 github.com/tidwall/gjson v1.14.1 golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 diff --git a/go.sum b/go.sum index c5ba104..67e9e6e 100644 --- a/go.sum +++ b/go.sum @@ -364,6 +364,7 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= diff --git a/tik_tok/md_tik_tok_activity.go b/tik_tok/md_tik_tok_activity.go index 023bff2..bdffb66 100644 --- a/tik_tok/md_tik_tok_activity.go +++ b/tik_tok/md_tik_tok_activity.go @@ -5,3 +5,15 @@ type TikTokActivity struct { ActivityName string `json:"activity_name"` ActivityEndTime string `json:"activity_end_time"` } +type TikTokActivityUrl struct { + ActivityId int `json:"activity_id"` + BuyinId int `json:"buyin_id"` + Code int `json:"code"` + CommissionRate int `json:"commission_rate"` + IsPromote bool `json:"is_promote"` + Msg string `json:"msg"` + OriginActivityId int `json:"origin_activity_id"` + OriginBuyinId int `json:"origin_buyin_id"` + ProductId int `json:"product_id"` + ServiceRate int `json:"service_rate"` +} diff --git a/tik_tok/svc_tik_tok_team.go b/tik_tok/svc_tik_tok_team.go index 7f5b84a..c223f72 100644 --- a/tik_tok/svc_tik_tok_team.go +++ b/tik_tok/svc_tik_tok_team.go @@ -33,7 +33,29 @@ func Activity(args map[string]string) []TikTokActivity { return goodsList } return goodsList - +} +func ColonelMultiParseActivityUrl(args map[string]string) map[string]TikTokActivityUrl { + args = map[string]string{ + "appkey": "7136155008692651560", + "appSecret": "b132549f-f62c-491e-86f1-89af3658896a", + "activity_url": "https://haohuo.jinritemai.com/views/product/detail?id=3566195499839129569&ins_activity_param=eNkdXXR", + "acctoken": "4ecb8a39-f503-441d-b60e-d1b3da2dc57f", + } + params := map[string]interface{}{"activity_url": args["activity_url"]} + send, err := Send(args["appkey"], args["appSecret"], "buyin.colonelMultiParseActivityUrl", params, args["acctoken"]) + var goodsList = make(map[string]TikTokActivityUrl) + if err != nil { + return goodsList + } + product := gjson.Get(send, "data.results").String() + if err != nil || product == "" { + return goodsList + } + err = json.Unmarshal([]byte(product), &goodsList) + if err != nil { + return goodsList + } + return goodsList } func TrusteeshipProduct(args map[string]string) ([]TikTokGoods, int64) { //args = map[string]string{