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:
commit
d693536866
|
@ -43,6 +43,7 @@ type (
|
||||||
Type *PartyType `json:"type,omitempty"` // party type for the suggestion (user input)
|
Type *PartyType `json:"type,omitempty"` // party type for the suggestion (user input)
|
||||||
Query string `json:"query"` // user input for suggestion
|
Query string `json:"query"` // user input for suggestion
|
||||||
Count int `json:"count"` // ligmit for results
|
Count int `json:"count"` // ligmit for results
|
||||||
|
Language string `json:"language,omitempty"`
|
||||||
Locations []*RequestParamsLocation `json:"locations"`
|
Locations []*RequestParamsLocation `json:"locations"`
|
||||||
RestrictValue bool `json:"restrict_value"` // don't show restricts (region) on results
|
RestrictValue bool `json:"restrict_value"` // don't show restricts (region) on results
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,34 @@ func (s *ApiSuggestIntegrationTest) TestAddress() {
|
||||||
s.NotEmpty(res)
|
s.NotEmpty(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *ApiSuggestIntegrationTest) TestAddressWithLanguageParamRU() {
|
||||||
|
api := NewSuggestApi()
|
||||||
|
|
||||||
|
params := suggest.RequestParams{
|
||||||
|
Query: "ул Свободы",
|
||||||
|
Language: "RU",
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := api.Address(context.Background(), ¶ms)
|
||||||
|
|
||||||
|
s.NoError(err)
|
||||||
|
s.NotEmpty(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *ApiSuggestIntegrationTest) TestAddressWithLanguageParamEN() {
|
||||||
|
api := NewSuggestApi()
|
||||||
|
|
||||||
|
params := suggest.RequestParams{
|
||||||
|
Query: "ул Свободы",
|
||||||
|
Language: "EN",
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := api.Address(context.Background(), ¶ms)
|
||||||
|
|
||||||
|
s.NoError(err)
|
||||||
|
s.NotEmpty(res)
|
||||||
|
}
|
||||||
|
|
||||||
func (s *ApiSuggestIntegrationTest) TestBank() {
|
func (s *ApiSuggestIntegrationTest) TestBank() {
|
||||||
api := NewSuggestApi()
|
api := NewSuggestApi()
|
||||||
params := suggest.RequestParams{
|
params := suggest.RequestParams{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user