From e4b3d6f9ff5c154763803b2a25f52f4da2422fdb Mon Sep 17 00:00:00 2001 From: qidongsheng Date: Tue, 30 Jun 2020 08:41:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E7=BE=8E?= =?UTF-8?q?=E5=9B=A2=E9=85=8D=E9=80=81=E7=9A=84=E5=95=86=E5=BA=97=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/mtpsapi/shop_page.go | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/platformapi/mtpsapi/shop_page.go b/platformapi/mtpsapi/shop_page.go index c821157e..b83ad9d5 100644 --- a/platformapi/mtpsapi/shop_page.go +++ b/platformapi/mtpsapi/shop_page.go @@ -97,6 +97,13 @@ type GetStoreStatusResult struct { PoiType int `json:"poiType"` } +type GetStoreStatusResultAll struct { + TotalCount int `json:"totalcount"` + PageNum int `json:"pageNum"` + PageSize int `json:"pageSize"` + DataList []GetStoreStatusResult `json:"dataList"` +} + func (a *API) GetStoreStatus(poiName string) (getStoreStatusResult *GetStoreStatusResult, err error) { params := map[string]interface{}{ "poiName": poiName, @@ -111,3 +118,34 @@ func (a *API) GetStoreStatus(poiName string) (getStoreStatusResult *GetStoreStat } return getStoreStatusResult, err } + +func (a *API) GetStoreStatusAll() (getStoreStatusResult []*GetStoreStatusResultAll, err error) { + num := 1 + cookie := "_lxsdk_cuid=172c5ed322ac8-081f1f7ebdcbeb-f7d1d38-149c48-172c5ed322ac8; " + + "_lxsdk=172c5ed322ac8-081f1f7ebdcbeb-f7d1d38-149c48-172c5ed322ac8; " + + "uuid=fa1894be8819a84be4ef.1592458555.1.0.0; wm_order_channel=sjzxpc; " + + "cssVersion=82f258e3; utm_source=60376; au_trace_key_net=default; " + + "openh5_uuid=172c5ed322ac8-081f1f7ebdcbeb-f7d1d38-149c48-172c5ed322ac8; " + + "bmm-uuid=dbdc11bf-fcfe-84a0-0586-97e3d7d23ec7; " + + "token=-MfbU7noKEgDWuNA559DeG6LmYZ51CCiH8bYrH-eYuaugCOqJL7863lKoAWfx8HoydOzJE8r9gGM3QJ0IC3niA; " + + "_lxsdk_s=172fa436aed-861-103-c9b%7C%7C7" + a.SetCookieWithStr(cookie) + for { + params := map[string]interface{}{ + "pageNum": num, + "pageSize": 20, + } + var getStoreStatusResult1 *GetStoreStatusResultAll + getStoreStatusResult1 = new(GetStoreStatusResultAll) + result, err := a.AccessAPI2("https://page.peisong.meituan.com/api", "haikuiopen/haikui/open/partner/poi/search", params) + if err == nil { + utils.Map2StructByJson(result.Data, &getStoreStatusResult1, false) + } + if len(getStoreStatusResult1.DataList) == 0 || getStoreStatusResult1.DataList == nil { + break + } + getStoreStatusResult = append(getStoreStatusResult, getStoreStatusResult1) + num++ + } + return getStoreStatusResult, err +}