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

Create main service #2

Merged
merged 22 commits into from
May 14, 2024
Merged

Create main service #2

merged 22 commits into from
May 14, 2024

Conversation

ayzatmr
Copy link
Owner

@ayzatmr ayzatmr commented May 12, 2024

No description provided.

return categoryService.create(newCategoryDto);
}

@PatchMapping("/{categoryId}")

Choose a reason for hiding this comment

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

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

Copy link
Owner Author

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,

Choose a reason for hiding this comment

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

Почему два раза requestParam

Copy link
Owner Author

@ayzatmr ayzatmr May 13, 2024

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")

Choose a reason for hiding this comment

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

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

поправил

@ayzatmr ayzatmr merged commit da40932 into main May 14, 2024
2 checks passed
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