- mtwm PoiInfo
This commit is contained in:
@@ -15,6 +15,38 @@ type PoiCategoryInfo struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type PoiInfo struct {
|
||||
Address string `json:"address,omitempty"`
|
||||
AppID int `json:"app_id,omitempt"`
|
||||
AppPoiCode string `json:"app_poi_code,omitempt"`
|
||||
CityID int `json:"city_id,omitempt"`
|
||||
Ctime int64 `json:"ctime,omitempt"`
|
||||
InvoiceDescription string `json:"invoice_description,omitempt"`
|
||||
InvoiceMinPrice int `json:"invoice_min_price,omitempt"`
|
||||
InvoiceSupport int `json:"invoice_support,omitempt"`
|
||||
IsOnline int `json:"is_online,omitempt"`
|
||||
Latitude float64 `json:"latitude,omitempt"`
|
||||
LocationID int `json:"location_id,omitempt"`
|
||||
Longitude float64 `json:"longitude,omitempt"`
|
||||
Name string `json:"name,omitempt"`
|
||||
OpenLevel int `json:"open_level,omitempt"`
|
||||
Phone string `json:"phone,omitempt"`
|
||||
PicURL string `json:"pic_url,omitempt"`
|
||||
PicURLLarge string `json:"pic_url_large,omitempt"`
|
||||
PreBook int `json:"pre_book,omitempt"`
|
||||
PreBookMaxDays int `json:"pre_book_max_days,omitempt"`
|
||||
PreBookMinDays int `json:"pre_book_min_days,omitempt"`
|
||||
PromotionInfo string `json:"promotion_info,omitempt"`
|
||||
Remark string `json:"remark,omitempt"`
|
||||
ShippingFee float64 `json:"shipping_fee,omitempt"`
|
||||
ShippingTime string `json:"shipping_time,omitempt"`
|
||||
StandbyTel string `json:"standby_tel,omitempt"`
|
||||
TagName string `json:"tag_name,omitempt"`
|
||||
ThirdTagName string `json:"third_tag_name,omitempt"`
|
||||
TimeSelect int `json:"time_select,omitempt"`
|
||||
Utime int64 `json:"utime,omitempt"`
|
||||
}
|
||||
|
||||
func (a *API) PoiSave(poiCode string, poiParams map[string]interface{}) (err error) {
|
||||
_, err = a.AccessAPI("poi/save", false, utils.MergeMaps(utils.Params2Map(KeyAppPoiCode, poiCode), poiParams))
|
||||
return err
|
||||
@@ -33,17 +65,17 @@ func (a *API) PoiGetIDs() (ids []string, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (a *API) PoiMGet(poiCodes []string) (pois []map[string]interface{}, err error) {
|
||||
func (a *API) PoiMGet(poiCodes []string) (pois []*PoiInfo, err error) {
|
||||
result, err := a.AccessAPI("poi/mget", true, map[string]interface{}{
|
||||
KeyAppPoiCodes: strings.Join(poiCodes, ","),
|
||||
})
|
||||
if err == nil {
|
||||
return utils.Slice2MapSlice(result.([]interface{})), nil
|
||||
err = utils.Map2StructByJson(result, &pois, false)
|
||||
}
|
||||
return nil, err
|
||||
return pois, err
|
||||
}
|
||||
|
||||
func (a *API) PoiGet(poiCode string) (poi map[string]interface{}, err error) {
|
||||
func (a *API) PoiGet(poiCode string) (poi *PoiInfo, err error) {
|
||||
result, err := a.PoiMGet([]string{poiCode})
|
||||
if err == nil {
|
||||
if len(result) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user