Skip to content

Review code#1

Open
iffomko wants to merge 8 commits intomasterfrom
ilya-develop
Open

Review code#1
iffomko wants to merge 8 commits intomasterfrom
ilya-develop

Conversation

@iffomko
Copy link
Copy Markdown
Owner

@iffomko iffomko commented May 26, 2024

No description provided.

iffomko added 8 commits April 19, 2023 13:26
…ый делает запросы на распознавание речи к YandexAPI
…епозитория, где делаются запросы к OpenAI API, а второй уровень сервиса, который настраивается запросы под мою необходимость и уже шлет эти запросы
…часть файлов, добавил возможность работы с бд, а конкретно функции: добавить пользователя, удалить пользователя по id, получить пользователя по id, получить роли пользователя по id, получить всех пользователей, добавить роль для пользователя по id
…исок фильтров. Также сделал регистрацию пользователя
Comment on lines +20 to +24
public YandexClient getYandexRecognition() {
String apiKey = System.getenv("API_KEY");

return new YandexClient(apiKey);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Можно отрефакторить с помощью "Inline varriable". И убери квалификатор бина, помести его в название

Comment on lines +15 to +17
public AnswerService getAnswerService() {
return new AnswerService();
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Тоже самое

Comment on lines +3 to +5
public class SpeechSynthesis {

}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Зачем он тебе? Удали

Comment on lines +27 to +52
private String getQueryParams() {
StringBuilder queries = new StringBuilder();

if (lang != null) {
queries.append("lang=");
queries.append(lang.getLang());
}

if (topic != null) {
if (!queries.isEmpty()) {
queries.append("&");
}

queries.append("topic=");
queries.append(lang.getLang());
}

if (!queries.isEmpty()) {
queries.append("&");
}

queries.append("profanityFilter=");
queries.append(profanityFilter);

if (!queries.isEmpty()) {
queries.append("&");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Можно применить паттерн "Строитель"

Comment on lines +64 to +67
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
headers.set("Authorization", "Api-Key " + apiKey);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Это можно было бы сделать в конструкторе

Copy link
Copy Markdown
Collaborator

@Cromulent74 Cromulent74 left a comment

Choose a reason for hiding this comment

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

Исправь замечания

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