-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create main service #2
Conversation
return categoryService.create(newCategoryDto); | ||
} | ||
|
||
@PatchMapping("/{categoryId}") |
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.
Одинаковые пути можно вынести в отдельную переменную для избежания дубляжей
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 static final CATEGORY = "/{categoryId}"
для всех повторяющихся путей?
Можно мне не менять это в рамках моей работы? Я бы предпочел описание путей сохранить как есть. Общую часть я вынес выше в @RequestMapping("/admin/categories")
|
||
@GetMapping | ||
public List<UserDto> findAll(@RequestParam(required = false) List<Long> ids, | ||
@RequestParam(defaultValue = MIN_SIZE) @PositiveOrZero int from, |
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.
Почему два раза requestParam
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 параметра: ids, from, size,
соответственно три @RequestParam
|
||
List<Long> categories; | ||
|
||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
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 можно вынести в отдельную переменную для избежания дубляжей
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.
поправил
No description provided.