新增获取美团配送的商店方法
This commit is contained in:
@@ -97,6 +97,13 @@ type GetStoreStatusResult struct {
|
|||||||
PoiType int `json:"poiType"`
|
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) {
|
func (a *API) GetStoreStatus(poiName string) (getStoreStatusResult *GetStoreStatusResult, err error) {
|
||||||
params := map[string]interface{}{
|
params := map[string]interface{}{
|
||||||
"poiName": poiName,
|
"poiName": poiName,
|
||||||
@@ -111,3 +118,34 @@ func (a *API) GetStoreStatus(poiName string) (getStoreStatusResult *GetStoreStat
|
|||||||
}
|
}
|
||||||
return getStoreStatusResult, err
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user