-
Notifications
You must be signed in to change notification settings - Fork 1
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
YEL-181 [feat] Notice, UserData entity 추가 #396
Conversation
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.
수고하셨습니다 ! 다음 step으로 고고
@Column(nullable = false) | ||
private ZonedDateTime startDate; | ||
|
||
@Column(nullable = false) | ||
private ZonedDateTime endDate; |
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.
LocalDateTime이 아닌 ZonedDateTime으로 설정하신 이유가 있나요?
둘의 어떤 차이로 인해 결정한것인가요?
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.
public final class ZonedDateTime implements Temporal, ChronoZonedDateTime<LocalDate>, Serializable {
...
private final LocalDateTime dateTime;
private final ZoneOffset offset;
private final ZoneId zone;
...
ZonedDateTime의 구현체를 보면, LocalDateTime과 ZoneOffset, ZoneId의 Composition으로 이루어져 있는데,
이는 Java가 실행되는 컴퓨터(Local)에 의해 시간값의 상태가 달라지는 LocalDateTime의 문제를 해결하기 위해서 설계되었음.
컴퓨터의 시간대가 UTC(+0)으로 설정되어있으면, LocalDateTime 시간 기준은 UTC(+0)으로 값을 저장하게 됨.
우리는 한국시간대 KST(+9)을 기준으로 프로그램을 설계해야하기 때문에, ZonedDateTime으로 필드를 구성하였음.
활용법은 아래와 같이 활용하면 되니 레퍼런스 확인해주시면 감사링
final ZoneId SouthKoreaZoneId = ZoneId.of("Asia/Seoul");
final ZonedDateTime current = ZonedDateTime.now(SouthKoreaZoneId);
current.format(DateTimeFormatter.ISO_LOCAL_DATE); // 2024-01-07
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.
오 굳굳
@Entity | ||
@Getter |
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.
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@builder
어노테이션도 추가해야하지 않을까요?!
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.
@Entity | ||
@Getter |
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.
@Entity | |
@Getter | |
@Entity | |
@Getter | |
@AllArgsConstructor | |
@NoArgsConstructor(access = AccessLevel.PROTECTED) | |
@Builder |
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.
@Getter | ||
@Entity |
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.
@Getter | |
@Entity | |
@Getter | |
@Entity | |
@Builder | |
@AllArgsConstructor | |
@NoArgsConstructor(access = AccessLevel.PROTECTED) |
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.
@Getter | ||
@Entity |
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.
여기도 어노테이션 추가가 필요할 것 같습니다
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.
☘️ Related Issue
✅ Work description
💡 PR point