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 { GeolocateParams struct {
Lat string `json:"lat"` // geographic latitude Lat string `json:"lat"` // geographic latitude
Lon string `json:"lon"` // geographic longitude Lon string `json:"lon"` // geographic longitude
Count string `json:"count,omitempty"` // number of results (max 20) Count int `json:"count,omitempty"` // number of results (max 20)
RadiusMeters string `json:"radius_meters,omitempty"` // search radius in metres (max. 1000) 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) Language string `json:"language,omitempty"` // in which language to return the result (ru / en)
} }

View File

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