- Citycode to CityCode
This commit is contained in:
@@ -83,7 +83,7 @@ type District struct {
|
|||||||
Adcode string `json:"adcode"` // 国家行政编码
|
Adcode string `json:"adcode"` // 国家行政编码
|
||||||
Lng float64 `json:"lng"`
|
Lng float64 `json:"lng"`
|
||||||
Lat float64 `json:"lat"`
|
Lat float64 `json:"lat"`
|
||||||
Citycode string `json:"citycode"` // 电话区号
|
CityCode string `json:"citycode"` // 电话区号
|
||||||
Level int `json:"level"`
|
Level int `json:"level"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Districts []*District `json:"districts"`
|
Districts []*District `json:"districts"`
|
||||||
@@ -234,7 +234,7 @@ func (a *API) getDistrictsFromInterface(districts interface{}) (districtList []*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if cityCodeStr, ok := v2["citycode"].(string); ok {
|
if cityCodeStr, ok := v2["citycode"].(string); ok {
|
||||||
districtList[k].Citycode = cityCodeStr
|
districtList[k].CityCode = cityCodeStr
|
||||||
}
|
}
|
||||||
districtList[k].Districts = a.getDistrictsFromInterface(v2["districts"])
|
districtList[k].Districts = a.getDistrictsFromInterface(v2["districts"])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user