102 lines
3.0 KiB
Go
102 lines
3.0 KiB
Go
|
package minedata
|
||
|
|
||
|
import "encoding/json"
|
||
|
|
||
|
type MilepostResponse struct {
|
||
|
Status int `json:"status"`
|
||
|
Message string `json:"message"`
|
||
|
Count int `json:"count"`
|
||
|
Items []struct {
|
||
|
Roadname string `json:"roadname"`
|
||
|
Roadid string `json:"roadid"`
|
||
|
Roadtype string `json:"roadtype"`
|
||
|
Kpileid string `json:"kpileid"`
|
||
|
Direction string `json:"direction"`
|
||
|
Location string `json:"location"`
|
||
|
Offset int `json:"offset"`
|
||
|
Adcode string `json:"adcode"`
|
||
|
Province string `json:"province"`
|
||
|
City string `json:"city"`
|
||
|
Area string `json:"area"`
|
||
|
FormatName string `json:"format_name"`
|
||
|
} `json:"items"`
|
||
|
}
|
||
|
|
||
|
type RoadSearchResponse struct {
|
||
|
Suggestion interface{} `json:"suggestion"`
|
||
|
Count int `json:"count"`
|
||
|
Pois []struct {
|
||
|
Alias interface{} `json:"alias"`
|
||
|
Brandcode string `json:"brandcode"`
|
||
|
Brand string `json:"brand"`
|
||
|
Tag string `json:"tag"`
|
||
|
Hit int `json:"hit"`
|
||
|
Tel string `json:"tel"`
|
||
|
Region struct {
|
||
|
Adcode string `json:"adcode"`
|
||
|
Province string `json:"province"`
|
||
|
City string `json:"city"`
|
||
|
County string `json:"county"`
|
||
|
Town interface{} `json:"town"`
|
||
|
} `json:"region"`
|
||
|
Subpois interface{} `json:"subpois"`
|
||
|
Nid string `json:"nid"`
|
||
|
Name string `json:"name"`
|
||
|
Typecode string `json:"typecode"`
|
||
|
Type string `json:"type"`
|
||
|
Location string `json:"location"`
|
||
|
Address string `json:"address"`
|
||
|
Distance interface{} `json:"distance"`
|
||
|
} `json:"pois"`
|
||
|
Status int `json:"status"`
|
||
|
Message string `json:"message"`
|
||
|
}
|
||
|
|
||
|
type ReverseMilepostResponse struct {
|
||
|
Status int `json:"status"`
|
||
|
Message string `json:"message"`
|
||
|
Count int `json:"count"`
|
||
|
Items []struct {
|
||
|
Roadname string `json:"roadname"`
|
||
|
Roadid string `json:"roadid"`
|
||
|
Roadtype string `json:"roadtype"`
|
||
|
Direction string `json:"direction"`
|
||
|
Kpileid string `json:"kpileid"`
|
||
|
Location string `json:"location"`
|
||
|
Adcode string `json:"adcode"`
|
||
|
Province string `json:"province"`
|
||
|
City string `json:"city"`
|
||
|
Area string `json:"area"`
|
||
|
Offset int `json:"offset"`
|
||
|
FormatName string `json:"format_name"`
|
||
|
} `json:"items"`
|
||
|
}
|
||
|
|
||
|
type ReverseGeocodingResponse struct {
|
||
|
Status int `json:"status"`
|
||
|
Message string `json:"message"`
|
||
|
Count int `json:"count"`
|
||
|
Items []struct {
|
||
|
Roadname string `json:"roadname"`
|
||
|
Roadid string `json:"roadid"`
|
||
|
Roadtype string `json:"roadtype"`
|
||
|
Direction string `json:"direction"`
|
||
|
Kpileid string `json:"kpileid"`
|
||
|
Location string `json:"location"`
|
||
|
Adcode string `json:"adcode"`
|
||
|
Province string `json:"province"`
|
||
|
City string `json:"city"`
|
||
|
Area string `json:"area"`
|
||
|
Offset int `json:"offset"`
|
||
|
FormatName string `json:"format_name"`
|
||
|
} `json:"items"`
|
||
|
}
|
||
|
|
||
|
func ToString(data interface{}) string {
|
||
|
b, err := json.Marshal(data)
|
||
|
if err != nil {
|
||
|
return ""
|
||
|
}
|
||
|
return string(b)
|
||
|
}
|