refactor: Changed object naming
This commit is contained in:
parent
cd9d2ba306
commit
bba41d685e
|
@ -17,10 +17,10 @@ type (
|
|||
}
|
||||
)
|
||||
|
||||
// AddressByGeolocate try to return suggest addresses by params
|
||||
// AddressByCoordinates try to return suggest addresses by params
|
||||
// see documentation on:https://dadata.ru/api/geolocate/
|
||||
func (a *Api) AddressByGeolocate(ctx context.Context, params *RequestParams) (ret []*AddressGeolocateSuggestion, err error) {
|
||||
var result = &AddressGeolocateResponse{}
|
||||
func (a *Api) AddressByCoordinates(ctx context.Context, params *RequestParams) (ret []*AddressSuggestion, err error) {
|
||||
var result = &AddressResponse{}
|
||||
err = a.Client.Post(ctx, "geolocate/address", params, result)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
@ -13,15 +13,15 @@ type (
|
|||
Language string `json:"language,omitempty"` // in which language to return the result (ru / en)
|
||||
}
|
||||
|
||||
// AddressGeolocateSuggestion api response for address
|
||||
AddressGeolocateSuggestion struct {
|
||||
// AddressSuggestion api response for address
|
||||
AddressSuggestion struct {
|
||||
Value string `json:"value"`
|
||||
UnrestrictedValue string `json:"unrestricted_value"`
|
||||
Data *model.Address `json:"data"`
|
||||
}
|
||||
|
||||
// AddressGeolocateResponse result slice for address suggestions
|
||||
AddressGeolocateResponse struct {
|
||||
Suggestions []*AddressGeolocateSuggestion `json:"suggestions"`
|
||||
// AddressResponse result slice for address suggestions
|
||||
AddressResponse struct {
|
||||
Suggestions []*AddressSuggestion `json:"suggestions"`
|
||||
}
|
||||
)
|
||||
|
|
|
@ -92,7 +92,7 @@ type (
|
|||
// full documentation https://confluence.hflabs.ru/pages/viewpage.action?pageId=222888017
|
||||
BoundValue string
|
||||
|
||||
// Address base struct for datdata.AddressByGeolocate
|
||||
// Address base struct for datdata.AddressByCoordinates
|
||||
Address struct {
|
||||
Source string `json:"source"` // Исходный адрес одной строкой
|
||||
Result string `json:"result"` // Стандартизованный адрес одной строкой
|
||||
|
|
Loading…
Reference in New Issue
Block a user