This commit is contained in:
苏尹岚
2020-12-22 18:19:31 +08:00
parent a48e9d13ab
commit 1765620899
2 changed files with 30 additions and 0 deletions

View File

@@ -438,3 +438,24 @@ func (c *JobController) ReloadJobSpan() {
return retVal, "", err
})
}
// @Title 根据地址查坐标
// @Description 根据地址查坐标
// @Param token header string true "认证token"
// @Param address formData string true "地址"
// @Param cityCode formData int true "cityCode"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetCoordinateFromAddress [get]
func (c *JobController) GetCoordinateFromAddress() {
c.callGetCoordinateFromAddress(func(params *tJobGetCoordinateFromAddressParams) (retVal interface{}, errCode string, err error) {
place := &struct {
Lng float64 `json:"lng"`
Lat float64 `json:"lat"`
}{}
lng, lat, err := api.AutonaviAPI.GetCoordinateFromAddressByPage(params.Address, params.CityCode)
place.Lng = lng
place.Lat = lat
return place, "", err
})
}

View File

@@ -385,6 +385,15 @@ func init() {
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"],
beego.ControllerComments{
Method: "GetCoordinateFromAddress",
Router: `/GetCoordinateFromAddress`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"],
beego.ControllerComments{
Method: "GetEjyOrders",