Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

[#55] 카테고리 서비스 로직 리팩토링 #57

Open
wants to merge 2 commits into
base: issue/38
Choose a base branch
from

Conversation

tax1116
Copy link
Collaborator

@tax1116 tax1116 commented Apr 11, 2021

No description provided.

@tax1116 tax1116 requested a review from f-lab-dev April 11, 2021 14:58
@tax1116 tax1116 self-assigned this Apr 11, 2021
@tax1116 tax1116 changed the title [#55] 카테고리 서비스 서비스 로직 리팩토링 [#55] 카테고리 서비스 로직 리팩토링 Apr 11, 2021
@@ -12,17 +12,11 @@

private final CategoryService categoryService;

@PostMapping
public HttpStatus addMainCategory (@RequestBody String name) {
@PostMapping(value = {"/", "/{id}"})
Copy link
Member

Choose a reason for hiding this comment

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

여기는 2개를 주신 의도가 무엇이실까요? ID는 auto increment로 부여되는 것 아닐까요?

Copy link
Collaborator Author

@tax1116 tax1116 Apr 12, 2021

Choose a reason for hiding this comment

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

의도는 메인 카테고리와 서브 카테고리를 추가할 때, 부모 카테고리 id의 존재 여부에 따라 두 개를 분기 시키고자했습니다.

하나의 기능이 하나의 책임을 갖게 하는 것이 유지 보수에 더 유리할 것으로 판단하여 다시 분리했습니다.
추가적으로 한 번에 하나의 카테고리 추가가 아닌 List로 추가할 수 있도록 변경했습니다.

@tax1116 tax1116 added the wip Work in process label Apr 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wip Work in process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants