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

Category service, repository #18

Merged
merged 4 commits into from
Feb 15, 2023

Conversation

CHANEE-personal
Copy link
Collaborator

  1. category Service, Repository
  2. service unit test

import lombok.Getter;

@Getter
@Builder
Copy link
Collaborator

Choose a reason for hiding this comment

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

우리가 직접 Requst를 만들 일이 있을까요? 그런게 아니라면, @builder는 빼도 괜찮지 않을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

controller request 부분 builder 제거 후 VO 하나 만들어서 처리하도록 하겠습니다!

* 5. 작성일 : 2023. 02. 08.
* </pre>
*/
public List<CategoryResponse> listCategory() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

메소드 이름은 JPA에 맞게 바뀔 것 같지만, 그 전에라도 일단 비슷하게 만들어 보는게 어떨까요?

* 5. 작성일 : 2023. 02. 08.
* </pre>
*/
public CategoryResponse createCategory(CreateCategoryRequest createCategoryRequest) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

CategoryResponse, CreateCategoryRequest는 Controller에서 관리하는 DTO처럼 보이는데요. 이걸 Respotory까지 내리는 것인가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

VO 하나 만들어서 데이터 파싱 후 service, repository단에서 처리하도록 하겠습니다.

Copy link
Collaborator

@f-lab-lyan f-lab-lyan left a comment

Choose a reason for hiding this comment

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

로직에는 특별히 문제는 없는 것 같아서 Approve했습니다만, 코멘트에 대해서는 생각해 보시면 좋을 것 같습니다.


@Service
@RequiredArgsConstructor
public class CategoryService {
Copy link
Collaborator

Choose a reason for hiding this comment

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

위의 Repository에도 비슷한 리뷰를 남기긴 했습니다만, Service에서 다루는 데이터와 Repository, Controller에서 다루는 데이터들간에 차이가 있어야 하지 않을까요? 차이라기 보다는 각각의 Layer가 다루는 데이터들이 달라야 하지 않을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

VO 하나 만들어서 데이터 파싱 후 service, repository단에서 처리하도록 하겠습니다.

@Test
@DisplayName("카테고리 등록")
void 카테고리등록() {
CreateCategoryRequest createCategoryRequest = CreateCategoryRequest.builder()
Copy link
Collaborator

Choose a reason for hiding this comment

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

아 ... 혹시 이 부분 때문에 ...Request에 빌더가 필요했던 것일까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

VO 하나 만들어서 Controller request 부분 builder 제거 후 수정 작업 진행했습니다.

verify(categoryRepository, atLeastOnce()).deleteCategory(2L);
verifyNoMoreInteractions(categoryRepository);

InOrder inOrder = inOrder(categoryRepository);
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분은 향후를 위해서 작성하신 것인가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

네넵 추후에 쓰일지도 모른다고 생각해서 우선 작업했습니다

2. create, update request builder 제거 후 VO에서 작업
3. service test case 수정
@yeonkyungJoo yeonkyungJoo merged commit 3689788 into f-lab-edu:main Feb 15, 2023
CHANEE-personal added a commit to CHANEE-personal/bbaemin that referenced this pull request Feb 18, 2023
* 1. category 관련 service, repository
2. service test case

* 수정

* repository method명 jpa에 맞게 수정

* 1. category vo 추가
2. create, update request builder 제거 후 VO에서 작업
3. service test case 수정
yeonkyungJoo added a commit that referenced this pull request Feb 25, 2023
* 1. build gradle jpa 관련 추가
2. application yml db 관련 설정 추가

* dev db 관련 암호화 적용

* 1. root build gradle jpa 설정 관련 및 db 관련 추가
2. application yml dev, test 분리
3. yml password 암호화 관련 설정 추가

* yml jasypt 암호화 관련 설정 추가

* build gradle dependencies 알파벳순으로 정렬

* build gradle dependencies 알파벳순으로 정렬

* Category service, repository (#18)

* 1. category 관련 service, repository
2. service test case

* 수정

* repository method명 jpa에 맞게 수정

* 1. category vo 추가
2. create, update request builder 제거 후 VO에서 작업
3. service test case 수정

* Error 클래스 및 관련 static 메소드 추가 (#19)

* Error 클래스 및 관련 static 메소드 추가

* Error 클래스를 ApiResult의 inner class로 선언

* UserService 작성 (#13)

* UserService/UserServiceTest 작성

* request/response DTO Service에서 제거

* Entity에서 비즈니스 로직 제거

* UserResponse 필드 테스트

* UserMemoryRepository - id 타입 AtomicLong으로 변경

* toEntity 제거

* item service, repository (#17)

* 1. item service, repository
2. item service unit test

* service unit test 수정

* service mockito test 관련 수정

* repository method명 jpa에 맞게 수정

* 1. item vo 추가
2. create, update request builder 제거 후 VO에서 작업
3. service test case 수정

* 1. Category CRUD jpa 적용
2. Store CRUD jpa 적용

* repository commit

* repository commit으로 revert

* 매장 수정시 로직 수정

* ApiResult 적용

* category, store 수정

* toDto 삭제, eventListener 삭제

* item 연관관계 설정

* category, store 수정

* 수정

---------

Co-authored-by: yeonkyung <[email protected]>
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.

3 participants