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

[fix] ENUM 어노테이션 추가 #251

Merged
merged 1 commit into from
Apr 19, 2024
Merged

[fix] ENUM 어노테이션 추가 #251

merged 1 commit into from
Apr 19, 2024

Conversation

KwonJuHwan
Copy link
Collaborator

Pull Request 요약

  • 주요 변경 사항에 대한 간단한 설명을 여기에 작성하세요.

변경 사항

  • 이 PR의 코드 주요 내용은 무엇인가요?

관련 이슈

  • 이 PR은 어떤 이슈로부터 만들어졌나요? (예: #123)

개발 유형

  • 버그 수정
  • 새로운 기능 개발
  • 리팩토링
  • 테스트 코드 작성
  • 문서 업데이트
  • 기타 (아래에 설명 추가)

작업 기간

  • 작업 시작일: (YYYY-MM-DD)
  • 작업 종료일: (YYYY-MM-DD)

유의사항

  • 이 PR로부터 발생할 수 있는 유의사항이 있나요? 이 PR이 다른 부분에 미칠 수 있는 영향 등을 설명하세요.

참고문헌

  • 이 PR을 작성하며 참조한 문헌이나 가이드가 있다면 여기에 링크를 추가하세요.

@@ -31,6 +33,7 @@ public class Study extends BaseTimeEntity {

private String content;

@Enumerated(EnumType.STRING)
private StudyState studyState;

private String skill;
Copy link
Collaborator

Choose a reason for hiding this comment

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

코드 리뷰:

  1. EnumType.STRING을 사용하여 Enum 값들이 문자열로 저장됨. 이는 데이터베이스에서 각 Enum의 문자열 값을 저장하게 되며, Enum 값이 변경되었을 때 문제가 발생할 수 있음. EnumType.ORDINAL을 고려해보세요.
  2. 주석(comment)이 부족합니다. 코드를 보다 이해하기 쉽게 코드 주석을 추가하는 것이 좋습니다.
  3. Study 클래스에서 ID 컬럼에 대한 어노테이션(JPA) 설정이 필요합니다. 다음과 같이 추가하세요:
    @Column(name = "study_id")
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
  4. 코드 스타일 일관성 유지 및 가독성을 위해 들여쓰기를 통일하도록 수정하세요.

개선 제안 포함하여 코드 리뷰를 완료했습니다.

@@ -16,7 +16,7 @@ CREATE TABLE study
progress_start DATE NOT NULL,
progress_end DATE NOT NULL,
contact VARCHAR(255) NOT NULL,
study_state enum ('DURING','CLOSED') NOT NULL,
study_state ENUM('DURING','CLOSED') NOT NULL,
CONSTRAINT pk_study PRIMARY KEY (id)
);

Copy link
Collaborator

Choose a reason for hiding this comment

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

이 코드 패치를 간단히 검토해보겠습니다.

  1. 좋은 점:

    • 데이터베이스 테이블 study가 잘 정의되었습니다.
    • 필수적인 필드들 (id, progress_start, progress_end, contact, study_state)이 적절한 형식으로 정의되었습니다.
  2. 수정 제안:

    • ENUM 타입의 'study_state' 필드가 대문자로 정의되어 있어서 대소문자 구분에 주의할 필요가 있습니다.
  3. 버그 리스크:

    • 현재 코드에 큰 버그 리스크는 보이지 않습니다.
  4. 개선 제안:

    • 이외에 추가적인 사항은 따로 없습니다.

코드에 큰 문제는 없고, ENUM('DURING','CLOSED')을 대문자로 사용하는 것 외에는 여타 개선사항이나 버그는 보이지 않습니다.

@ghrltjdtprbs ghrltjdtprbs merged commit 4e71a04 into develop Apr 19, 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.

3 participants