From c7c458b92bd05d7c1f07d09edbdf1f8aa8505561 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 20 Jan 2024 13:37:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- haodanku/kuaishou_recharge.go | 22 ++++++++++++++++++++++ md/haodanku.go | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 haodanku/kuaishou_recharge.go diff --git a/haodanku/kuaishou_recharge.go b/haodanku/kuaishou_recharge.go new file mode 100644 index 0000000..80a3231 --- /dev/null +++ b/haodanku/kuaishou_recharge.go @@ -0,0 +1,22 @@ +package haodanku + +import ( + "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/md" + "encoding/json" + "github.com/tidwall/gjson" +) + +func KuaishouRecharge(params map[string]string) []md.HaodankuKuaishouRecharge { + var goods = make([]md.HaodankuKuaishouRecharge, 0) + reqNew, err := SendReqNew("http://v3.api.haodanku.com/ks_prepaid_recharge", params) + if err != nil { + return goods + } + data := gjson.Get(string(reqNew), "data").String() + if data == "" { + return goods + } + var oldGoods []md.HaodankuKuaishouRecharge + json.Unmarshal([]byte(data), &oldGoods) + return oldGoods +} diff --git a/md/haodanku.go b/md/haodanku.go index cd3b890..6794098 100644 --- a/md/haodanku.go +++ b/md/haodanku.go @@ -1,5 +1,17 @@ package md +type HaodankuKuaishouRecharge struct { + Itemid string `json:"itemid"` + Itemtitle string `json:"itemtitle"` + Itemshorttitle string `json:"itemshorttitle"` + Itemendprice string `json:"itemendprice"` + Itemprice string `json:"itemprice"` + Itempic string `json:"itempic"` + Itemsale string `json:"itemsale"` + Tkrates string `json:"tkrates"` + Tkmoney string `json:"tkmoney"` + Shopname string `json:"shopname"` +} type HaodankuFriendsCircleItems struct { MaterialId string `json:"material_id"` CopyWriter string `json:"copy_writer"`