64 lines
2.2 KiB
Go
64 lines
2.2 KiB
Go
package mtpsapi
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
)
|
|
|
|
func (a *API) PagePoiUpdate(outerPoiID, contactName, contactPhone, contactEmail string) (err error) {
|
|
if outerPoiID == "" || contactName == "" || contactPhone == "" || contactEmail == "" {
|
|
return fmt.Errorf("所有参数必须都要有值")
|
|
}
|
|
params := map[string]interface{}{
|
|
"outerPoiId": outerPoiID,
|
|
"contactName": contactName,
|
|
"contactPhone": contactPhone,
|
|
"contactEmail": contactEmail,
|
|
}
|
|
_, err = a.AccessAPI2("https://page.peisong.meituan.com/api", "haikuiopen/haikui/open/partner/poi/update", params)
|
|
return err
|
|
}
|
|
|
|
func (a *API) GetAccountDetail() (err error) {
|
|
params := map[string]interface{}{}
|
|
_, err = a.AccessAPI2("https://peisong.meituan.com/api", "haikuiopen/haikui/open/partner/base/detail", params)
|
|
return err
|
|
}
|
|
|
|
type GetStoreStatusResult struct {
|
|
PoiID int `json:"poiId"`
|
|
OuterPoiID string `json:"outerPoiId"`
|
|
AppkeyID int `json:"appkeyId"`
|
|
PoiName string `json:"poiName"`
|
|
CityID int `json:"cityId"`
|
|
CityName string `json:"cityName"`
|
|
ContactPhone string `json:"contactPhone"`
|
|
ContactName interface{} `json:"contactName"`
|
|
ContactEmail interface{} `json:"contactEmail"`
|
|
Address string `json:"address"`
|
|
AddressDetail interface{} `json:"addressDetail"`
|
|
OpenType int `json:"openType"`
|
|
CategoryID int `json:"categoryId"`
|
|
SecondCategoryID int `json:"secondCategoryId"`
|
|
PoiLat int `json:"poiLat"`
|
|
PoiLng int `json:"poiLng"`
|
|
SubBrandID int `json:"subBrandId"`
|
|
PoiType int `json:"poiType"`
|
|
}
|
|
|
|
func (a *API) GetStoreStatus(poiName string) (getStoreStatusResult *GetStoreStatusResult, err error) {
|
|
params := map[string]interface{}{
|
|
"poiName": poiName,
|
|
"openType": -1,
|
|
"cityId": -1,
|
|
"pageNum": 1,
|
|
"pageSize": 20,
|
|
}
|
|
result, err := a.AccessAPI2("https://page.peisong.meituan.com/api", "haikuiopen/haikui/open/partner/poi/search", params)
|
|
if err == nil {
|
|
utils.Map2StructByJson(result.Data, &getStoreStatusResult, false)
|
|
}
|
|
return getStoreStatusResult, err
|
|
}
|