根据坐标得到城市

This commit is contained in:
苏尹岚
2020-09-24 18:26:04 +08:00
parent 5348bcb82e
commit 0b0930ccd1
3 changed files with 10 additions and 10 deletions

View File

@@ -222,8 +222,8 @@ func GetCoordinateDistrictCode(ctx *jxcontext.Context, lng, lat float64) (code i
return api.AutonaviAPI.GetCoordinateDistrictCode(lng, lat), nil return api.AutonaviAPI.GetCoordinateDistrictCode(lng, lat), nil
} }
func GetCoordinateTownInfo(ctx *jxcontext.Context, lng, lat float64) (name string, err error) { func GetCoordinateCityInfo(ctx *jxcontext.Context, lng, lat float64) (name string, err error) {
name, _ = api.AutonaviAPI.GetCoordinateTownInfo(lng, lat) name, _ = api.AutonaviAPI.GetCoordinateCityInfo(lng, lat)
return name, err return name, err
} }

View File

@@ -146,10 +146,10 @@ func (c *CmsController) GetCoordinateDistrictCode() {
// @Param lat query number true "纬度" // @Param lat query number true "纬度"
// @Success 200 {object} controllers.CallResult // @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /GetCoordinateTownInfo [get] // @router /GetCoordinateCityInfo [get]
func (c *CmsController) GetCoordinateTownInfo() { func (c *CmsController) GetCoordinateCityInfo() {
c.callGetCoordinateTownInfo(func(params *tCmsGetCoordinateTownInfoParams) (retVal interface{}, errCode string, err error) { c.callGetCoordinateCityInfo(func(params *tCmsGetCoordinateCityInfoParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetCoordinateTownInfo(params.Ctx, params.Lng, params.Lat) retVal, err = cms.GetCoordinateCityInfo(params.Ctx, params.Lng, params.Lat)
return retVal, "", err return retVal, "", err
}) })
} }

View File

@@ -279,8 +279,8 @@ func init() {
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "GetCoordinateDistrictCode", Method: "GetCoordinateCityInfo",
Router: `/GetCoordinateDistrictCode`, Router: `/GetCoordinateCityInfo`,
AllowHTTPMethods: []string{"get"}, AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(), MethodParams: param.Make(),
Filters: nil, Filters: nil,
@@ -288,8 +288,8 @@ func init() {
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "GetCoordinateTownInfo", Method: "GetCoordinateDistrictCode",
Router: `/GetCoordinateTownInfo`, Router: `/GetCoordinateDistrictCode`,
AllowHTTPMethods: []string{"get"}, AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(), MethodParams: param.Make(),
Filters: nil, Filters: nil,