-
Notifications
You must be signed in to change notification settings - Fork 79
Spirin [group 597] - Task 4 #323
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
base: master
Are you sure you want to change the base?
Conversation
ignorer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что-то я не увидел, чтобы пароль использовался где-то, кроме регистрации.
| import org.springframework.context.annotation.Configuration; | ||
| import ru.mipt.java2016.homework.base.task1.Calculator; | ||
|
|
||
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну хоть бы коммент удалил при копипасте :)
| public class BillingDatabaseConfiguration { | ||
| @Bean | ||
| public DataSource billingDataSource( | ||
| @Value("jdbc:h2:mem:testdb") String jdbcUrl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно создать в main/resources файл application.properties, в который положить вот это значение. То же касается и следующих двух строк, только там выставлены пустые значения по умолчанию.
|
|
||
| // Update initial (username, password) | ||
| jdbcTemplate.execute("DELETE FROM billing.users WHERE username = 'username'"); | ||
| jdbcTemplate.execute("INSERT INTO billing.users VALUES ('username', 'password')"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно было бы использовать MERGE
| name = "world"; | ||
| } | ||
| return "<html>" + | ||
| "<head><title>FediqApp</title></head>" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Но ведь...
| String username = authentication.getName(); | ||
| double result = calculator.calculate(expression); | ||
|
|
||
| LOG.trace("Result: " + result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше бы объединить это с предыдущим сообщением логгера, потому как если 100 пользователей одновременно захотят посчитать, то получится каша из сообщений, непонятно, какой результат к какому выражению относится.
| String password = arguments[1]; | ||
|
|
||
| LOG.trace(username); | ||
| LOG.trace(password); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ещё один пример неудачного логирования.
| } | ||
|
|
||
| // Calculate the value of call function(a, b) | ||
| private double performBinaryFunction(String function, double a, double b) throws ParsingException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хм, а если я добавлю в список базовых функцию от 3 аргументов?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ignorer В условиях задания, пока не предусмотрены функции от 3 аргументов.
А если вдруг они и возникнут, то грамматика спокойно обобщается и на них. :)
| .logout().disable() | ||
| .csrf().disable() | ||
| .authorizeRequests() | ||
| .antMatchers("/eval/**").authenticated() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему только eval? :)
in progress