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

Пришлось немного подредактировать application.yml из-за того, что pos… #2

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

Conversation

trokhinas
Copy link

…tgre не нравились имя базы данных и пользователя.

…tgre не нравились имя базы данных и пользователя.
url: jdbc:postgresql://localhost:5432/home-budget
username: user
password: myPass
url: jdbc:postgresql://localhost:5432/homebudget
Copy link
Owner

Choose a reason for hiding this comment

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

Ну с такой правкой оно уже у меня не будет работать :-)

Это выглядит как правка, которая важна только для вашего окружения. Такие вещи лучше не коммитить, по крайней мере, в глобальный файл application.yaml. Для таких целей можно сделать свой собственный application-debug.yaml, внести свои специфичные правки уже в него и запускать приложение с профилем debug.

Copy link
Owner

@typeundefined typeundefined left a comment

Choose a reason for hiding this comment

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

В целом неплохо, только верните application.yaml :-)

* @author Trokhin
*
*/
public interface ICategoryService {
Copy link
Owner

Choose a reason for hiding this comment

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

Пока что интерфейс выглядит излишним. Хотя, конечно, так тоже можно.

public CategoryDTO getByID(@PathVariable("id") Long id) {
CategoryDTO categoryDTO = categoryService.get(id);

if(categoryDTO == null)
Copy link
Owner

Choose a reason for hiding this comment

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

Не проще ли бросить exception сразу из сервиса? Всегда проще работать в предположении, что сервис не вернул null (ибо что с ним делать-то?).

typeundefined pushed a commit that referenced this pull request Dec 16, 2018
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