-
Notifications
You must be signed in to change notification settings - Fork 0
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
불필요한 필드 삭제 및 start_time, end_time 기능 수정 #42
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,10 +26,10 @@ public class Application { | |
@Column(name = "application_id") | ||
private Long id; | ||
|
||
@Column(name = "start_time", nullable = false) | ||
@Column(name = "start_time", nullable = false, columnDefinition = "TIMESTAMP(0)") // 밀리초 자릿수를 0으로 지정 | ||
private LocalDateTime startTime; | ||
|
||
@Column(name = "end_time", nullable = false) | ||
@Column(name = "end_time", nullable = false, columnDefinition = "TIMESTAMP(0)") // 밀리초 자릿수를 0으로 지정 | ||
private LocalDateTime endTime; | ||
|
||
@Column(name = "applied_date", nullable = false) | ||
|
@@ -39,8 +39,11 @@ public class Application { | |
@Column(name = "status", nullable = false) | ||
private ApplicationStatus status = ApplicationStatus.PENDING; // 기본값 설정 | ||
|
||
@Column(name = "participant_count") | ||
private Integer participantCount; | ||
@Column(name = "count_cp_with_applicant") // 신청자 포함 사용 인원 수 | ||
private Integer countCpWithApplicant; | ||
|
||
@Column(name = "count_cp_only") // 신청자 제외 사용 인원 수 | ||
private Integer countCpOnly; | ||
Comment on lines
+42
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 변수명이 길어지더라도 풀네임으로 적어주시는 게 명확할 것 같습니다! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 의견 감사합니다~ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 사실 웬만하면 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 피드백 감사합니다 !! ㅋㅋㅋ 그렇긴 한데 필드명을 똑같이 하니까 DB에서 꼬여서 따로 만들었습니다 😂😂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네 뭔가 기존처럼 @Column(name = "participant_count")
private Integer participantCount; 요렇게 하고 혹시 필드명이 DB에서 꼬인다는 게 어떤 뜻인가유? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 신청서를 신청, 수정, 조회하는 과정에서 DB에 데이터가 잘못 계산되어 들어갔다는 뜻이었습니다! 변수를 2개 사용한 이유가 DB에 데이터가 잘못 저장되어서 그랬는데, 아니면 서버 쪽에서는 신청자를 포함한 사용 인원만 저장해두고, 프론트엔드에서 필요에 의해 participantCount - 1로 데이터를 바꿔 화면에 보여주는 방법은 어떤가요?? 사실 제가 이런 협업을 안 해봐서 잘 모르겠습니다... 아직 기초가 부족해서 조금 비효율적으로 코드를 작성한 것 같습니다..🥲 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아아 이해했습니다 ㅋㅋㅋㅋ 신청자 제외 사용 인원 같은 경우는 백엔드 측에서 처리하면 좋을 것 같긴 합니다. 보통 변경이 잦은 값이면 프론트엔드 측에서 알아서 가공해서 사용하게 되는데, 제 생각엔 Application 엔티티에 있는 필드는 말씀하신대로 1개로 유지하고, DTO에만 도움이 됐다니 다행이네요 ^ㅡ^ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오호 좋습니다! DTO에 모두 추가해서 반환하는 방법이 있었군요 ㅋㅋㅋ 친절한 답변 감사합니다🙇🏻🙇🏻 |
||
|
||
@ElementCollection // JPA에서 값 타입 컬렉션을 매핑할 때 사용하는 어노테이션 | ||
@CollectionTable( | ||
|
@@ -60,9 +63,4 @@ public void updateStatus(ApplicationStatus status){ | |
this.status = status; | ||
} | ||
|
||
private String applicantName; // Member의 name | ||
private String applicantLoginId; // Member의 loginId | ||
private String applicantPhone; // Member의 phoneNumber | ||
private String applicantEmail; // Member의 email | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
columnDefinition 디테일 좋네요 ㄷㄷ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
감사합니다 ㅎㅎ