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

[Feature/48] 카테고리 validation 검증 로직 및 비기능 개발 #52

Merged
merged 6 commits into from
Mar 30, 2024

Conversation

galug
Copy link
Contributor

@galug galug commented Mar 14, 2024

- CategoryService.java - 유저의 카테고리인지 확인하는 로직 추가 - 관련: #48

Type of change

  • Bug fix : 버그 수정
  • Refactor : 코드 리팩토링 작업

PR Desciption

변경 사항 설명

유저 카테고리 수정

  • CategoryService.java
    • 유저의 카테고리인지 확인하는 로직 추가
  • Category.java, CategoryKind.java
    • 정책 변경에 따라 CategoryKind.java 생성
    • Category 에 기본 일정들을 구분 가능한 Kind 생성
  • CategoryRequest.java, CategoryName.java, CategoryValidator.java
    • 기존 검증 로직 변경 및 삭제
    • 정책 변경에 따른 이름을 통한 구분 필요 없어짐
      CategoryService.java
    • 정책에 맞게 검증 수준을 변경

소셜로그인 관련 부분에 기본 카테고리 들어가게 수정

  • Category.java, CategoryConverter.java
    • kind 를 Category에 넣게끔 추가
  • SocialUtils.java
    • 네이버 로그인 시에는 nickname이 null 값으로 받아집니다.
    • 공통 로직 toUser 를 냅두는 방향으로 변경했습니다.
    • 좀 더 좋은 구조를 고민해 보면 좋을 것 같아요.
  • CategoryKind.java, UserFacade.java
    • Enum 타입의 활용을 위한 변수명 추가
    • Enum 타입을 활용하기 위한 Facade 변경

Requirements for Reviewer

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

PR Log

PR 작업하면서 고민했던 내용, 해결한 내용, 고민 중인 내용 등

새롭게 배운 것

고민 중인 사항

첨부 자료

관련 이슈

<body>
- CategoryService.java
  - 유저의 카테고리인지 확인하는 로직 추가

<footer>
- 관련: #48
@galug galug added 🐛 bug 버그 관련 ♻️ refactor 리펙터링 관련 labels Mar 14, 2024
@galug galug requested review from luke0408 and hyeonji91 March 14, 2024 11:39
@galug galug self-assigned this Mar 14, 2024
@galug galug requested a review from a team as a code owner March 14, 2024 11:39
<body>

<footer>
- 관련: #48
Copy link
Member

@luke0408 luke0408 left a comment

Choose a reason for hiding this comment

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

👍 수고 하셨습니다 리뷰 확인 부탁드릴게요


public boolean isNotCreatedByUser(Long userId) {
return this.user.getId() == userId;
}
Copy link
Member

Choose a reason for hiding this comment

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

❗ method 명은 isNotCreatedByUser 인데 메서드의 로직은 해당 유저에 의해 생성된 것을 확인하는 것으로 보입니다. 때문에 isCreatedByUser로 메서드 명을 변경해야하는 것 아닌가 라는 생각이 드는데 어떤가요?

@luke0408 luke0408 changed the title :refactor: Recycle: 카테고리 validation [Feature/48] 카테고리 validation 검증 로직 및 비기능 개발 Mar 22, 2024
김현재 added 3 commits March 28, 2024 10:56
<body>
- Category.java, CategoryKind.java
  - 정책 변경에 따라 CategoryKind.java 생성
  - Category 에 기본 일정들을 구분 가능한 Kind 생성
- CategoryRequest.java, CategoryName.java, CategoryValidator.java
  - 기존 검증 로직 변경 및 삭제
  - 정책 변경에 따른 이름을 통한 구분 필요 없어짐
CategoryService.java
  - 정책에 맞게 검증 수준을 변경

<footer>
- 관련: #48
<body>
- Category.java, CategoryConverter.java
  - kind 를 Category에 넣게끔 추가
- SocialUtils.java
  - 네이버 로그인 시에는 nickname이 null 값으로 받아집니다.
  - 공통 로직 toUser 를 냅두는 방향으로 변경했습니다.
  - 좀 더 좋은 구조를 고민해 보면 좋을 것 같아요.
- CategoryKind.java, UserFacade.java
  - Enum 타입의 활용을 위한 변수명 추가
  - Enum 타입을 활용하기 위한 Facade 변경

<footer>
- 관련: #48
<body>
- querydsl 을 이용해서 kind 를 기반으로 스케줄을 입력 받게 변경

<footer>
- 관련: #48
Copy link
Member

@luke0408 luke0408 left a comment

Choose a reason for hiding this comment

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

👍 수고하셨습니다! 질문이 몇가지가 있어서 해당 부분만 한번만 봐주시면, Approve 가능할 것 같아요!

@@ -46,13 +46,17 @@ public class Category extends BaseTimeEntity {
@Enumerated(EnumType.STRING)
private CategoryStatus status;

@Enumerated(EnumType.STRING)
private CategoryKind kind;
Copy link
Member

Choose a reason for hiding this comment

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

❓ 해당 데이터 DB 스키마에도 적용이 되어있나요?

Copy link
Member

Choose a reason for hiding this comment

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

만약 안되어있다면 merge 하기 전에 스키마 수정 부탁드릴게요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

혹시 스키마에 적용해달라고 하시는게 그 저희 운영 서버에 적용해야하는 건가요?

@@ -226,16 +227,18 @@ private User saveOrNot(User user) {

private void makeBaseCategory(User save) {
Category baseCategory = CategoryConverter.toCategory(
"일정",
CategoryKind.SCHEDULE.getCategoryName(),
Copy link
Member

Choose a reason for hiding this comment

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

👍 Enum을 통해서 관리해 주니까 더 보기 좋네요!

@luke0408 luke0408 merged commit a38b20e into dev Mar 30, 2024
@luke0408 luke0408 deleted the feature/48 branch April 1, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug 버그 관련 ♻️ refactor 리펙터링 관련
Projects
None yet
2 participants