Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавил отображение подсказок на латинице в адресах #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Arcane561
Copy link

@Arcane561 Arcane561 commented Aug 7, 2020

Обнаружил, что такой функции нет, использовать предлагается вот так:

AddressRequestBuilder.create(__query__).outputLanguage("en").build()

и если нужны на русском, то ничего добавлять не нужно:

AddressRequestBuilder.create(__query__).build()

Signed-off-by: arcane418 <arcane561@gmail.com>
@codecov
Copy link

codecov bot commented Aug 7, 2020

Codecov Report

Merging #18 into master will decrease coverage by 0.60%.
The diff coverage is 33.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #18      +/-   ##
============================================
- Coverage     99.06%   98.45%   -0.61%     
  Complexity      142      142              
============================================
  Files            45       45              
  Lines           321      324       +3     
  Branches          1        1              
============================================
+ Hits            318      319       +1     
- Misses            3        5       +2     
Impacted Files Coverage Δ Complexity Δ
...a/client/domain/address/AddressRequestBuilder.java 88.88% <0.00%> (-11.12%) 7.00 <0.00> (ø)
...n/dadata/client/domain/address/AddressRequest.java 100.00% <100.00%> (ø) 1.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3abf29d...9db0582. Read the comment docs.

@KuliginStepan KuliginStepan self-requested a review August 15, 2020 11:24
Copy link
Owner

@KuliginStepan KuliginStepan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно добавить тестов, которые проверяют, что изменение языка действительно работает

@@ -43,9 +44,15 @@ public AddressRequestBuilder restrictValue() {
return this;
}

public AddressRequestBuilder outputLanguage(String language) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Предлагаю сделать более типизировано: у нас есть конечный список языков, которые поддерживаются – это русский (ru) и английский (en). Можно сделать Enum, например:

public enum Language {
  EN,
  RU
}

А при создании AddressRequest делать такое: language.name().toLower()

@@ -25,17 +25,21 @@
private Map<String, String> toBound;
@JsonProperty("restrict_value")
private Boolean restrictValue;
@JsonProperty("language")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если название поля совпадает с полем в json, то аннотацию @JsonProperty не обязательно ставить

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants