Merge pull request #25 from max-grape/api_suggest_model_request_params_language_added

feat: suggest RequestPrams Language field added
This commit is contained in:
Alex 2024-05-08 19:48:41 +03:00 committed by GitHub
commit d693536866
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View File

@ -43,6 +43,7 @@ type (
Type *PartyType `json:"type,omitempty"` // party type for the suggestion (user input)
Query string `json:"query"` // user input for suggestion
Count int `json:"count"` // ligmit for results
Language string `json:"language,omitempty"`
Locations []*RequestParamsLocation `json:"locations"`
RestrictValue bool `json:"restrict_value"` // don't show restricts (region) on results

View File

@ -53,6 +53,34 @@ func (s *ApiSuggestIntegrationTest) TestAddress() {
s.NotEmpty(res)
}
func (s *ApiSuggestIntegrationTest) TestAddressWithLanguageParamRU() {
api := NewSuggestApi()
params := suggest.RequestParams{
Query: "ул Свободы",
Language: "RU",
}
res, err := api.Address(context.Background(), &params)
s.NoError(err)
s.NotEmpty(res)
}
func (s *ApiSuggestIntegrationTest) TestAddressWithLanguageParamEN() {
api := NewSuggestApi()
params := suggest.RequestParams{
Query: "ул Свободы",
Language: "EN",
}
res, err := api.Address(context.Background(), &params)
s.NoError(err)
s.NotEmpty(res)
}
func (s *ApiSuggestIntegrationTest) TestBank() {
api := NewSuggestApi()
params := suggest.RequestParams{