refactor: Changed object naming

This commit is contained in:
MrShtein 2024-05-11 17:48:05 +03:00
parent cd9d2ba306
commit bba41d685e
3 changed files with 9 additions and 9 deletions

View File

@ -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/ // see documentation on:https://dadata.ru/api/geolocate/
func (a *Api) AddressByGeolocate(ctx context.Context, params *RequestParams) (ret []*AddressGeolocateSuggestion, err error) { func (a *Api) AddressByCoordinates(ctx context.Context, params *RequestParams) (ret []*AddressSuggestion, err error) {
var result = &AddressGeolocateResponse{} var result = &AddressResponse{}
err = a.Client.Post(ctx, "geolocate/address", params, result) err = a.Client.Post(ctx, "geolocate/address", params, result)
if err != nil { if err != nil {
return return

View File

@ -13,15 +13,15 @@ type (
Language string `json:"language,omitempty"` // in which language to return the result (ru / en) Language string `json:"language,omitempty"` // in which language to return the result (ru / en)
} }
// AddressGeolocateSuggestion api response for address // AddressSuggestion api response for address
AddressGeolocateSuggestion struct { AddressSuggestion struct {
Value string `json:"value"` Value string `json:"value"`
UnrestrictedValue string `json:"unrestricted_value"` UnrestrictedValue string `json:"unrestricted_value"`
Data *model.Address `json:"data"` Data *model.Address `json:"data"`
} }
// AddressGeolocateResponse result slice for address suggestions // AddressResponse result slice for address suggestions
AddressGeolocateResponse struct { AddressResponse struct {
Suggestions []*AddressGeolocateSuggestion `json:"suggestions"` Suggestions []*AddressSuggestion `json:"suggestions"`
} }
) )

View File

@ -92,7 +92,7 @@ type (
// full documentation https://confluence.hflabs.ru/pages/viewpage.action?pageId=222888017 // full documentation https://confluence.hflabs.ru/pages/viewpage.action?pageId=222888017
BoundValue string BoundValue string
// Address base struct for datdata.AddressByGeolocate // Address base struct for datdata.AddressByCoordinates
Address struct { Address struct {
Source string `json:"source"` // Исходный адрес одной строкой Source string `json:"source"` // Исходный адрес одной строкой
Result string `json:"result"` // Стандартизованный адрес одной строкой Result string `json:"result"` // Стандартизованный адрес одной строкой