Fix geolocate params types.

This commit is contained in:
Alexander Zhuravlev 2024-05-12 17:56:24 +03:00
parent 6dd9ffdb08
commit 6f921c2bf5
2 changed files with 5 additions and 6 deletions

View File

@ -10,8 +10,8 @@ type (
GeolocateParams struct {
Lat string `json:"lat"` // geographic latitude
Lon string `json:"lon"` // geographic longitude
Count string `json:"count,omitempty"` // number of results (max 20)
RadiusMeters string `json:"radius_meters,omitempty"` // search radius in metres (max. 1000)
Count int `json:"count,omitempty"` // number of results (max 20)
RadiusMeters int `json:"radius_meters,omitempty"` // search radius in metres (max. 1000)
Language string `json:"language,omitempty"` // in which language to return the result (ru / en)
}

View File

@ -6,7 +6,6 @@ import (
"context"
"fmt"
"os"
"strconv"
"testing"
"github.com/stretchr/testify/suite"
@ -364,13 +363,13 @@ func (s *ApiSuggestIntegrationTest) TestGeoLocateWithCountTwo() {
Lat: "55.878",
Lon: "37.653",
Language: "EN",
Count: strconv.Itoa(reqElementCount),
Count: reqElementCount,
}
res, err := api.GeoLocate(context.Background(), &params)
s.NoError(err)
s.Len(res, 2)
s.Len(res, reqElementCount)
}
func (s *ApiSuggestIntegrationTest) TestGeoLocateWithRadius() {
@ -380,7 +379,7 @@ func (s *ApiSuggestIntegrationTest) TestGeoLocateWithRadius() {
Lat: "55.878",
Lon: "37.653",
Language: "EN",
RadiusMeters: "100",
RadiusMeters: 100,
}
res, err := api.GeoLocate(context.Background(), &params)