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

YEL-181 [feat] Notice, UserData entity 추가 #396

Merged
merged 3 commits into from
Jan 7, 2024
Merged

Conversation

euije
Copy link
Member

@euije euije commented Jan 6, 2024

☘️ Related Issue

✅ Work description

💡 PR point

@euije euije requested a review from hyeonjeongs January 6, 2024 12:03
Copy link

github-actions bot commented Jan 6, 2024

Test Results

136 tests  ±0   136 ✅ ±0   10s ⏱️ +2s
 23 suites ±0     0 💤 ±0 
 23 files   ±0     0 ❌ ±0 

Results for commit 233eac4. ± Comparison against base commit 6496656.

♻️ This comment has been updated with latest results.

Copy link
Member

@hyeonjeongs hyeonjeongs left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 ! 다음 step으로 고고

Comment on lines +26 to +30
@Column(nullable = false)
private ZonedDateTime startDate;

@Column(nullable = false)
private ZonedDateTime endDate;
Copy link
Member

Choose a reason for hiding this comment

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

LocalDateTime이 아닌 ZonedDateTime으로 설정하신 이유가 있나요?
둘의 어떤 차이로 인해 결정한것인가요?

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

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

오 굳굳

Comment on lines +12 to +13
@Entity
@Getter
Copy link
Member

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
어노테이션도 추가해야하지 않을까요?!

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +12 to +13
@Entity
@Getter
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@Entity
@Getter
@Entity
@Getter
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Builder

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +14 to +15
@Getter
@Entity
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@Getter
@Entity
@Getter
@Entity
@Builder
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)

Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +14 to +15
@Getter
@Entity
Copy link
Member

Choose a reason for hiding this comment

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

여기도 어노테이션 추가가 필요할 것 같습니다

Copy link
Member Author

Choose a reason for hiding this comment

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

@euije euije merged commit 4aa5e71 into develop Jan 7, 2024
3 checks passed
@euije euije deleted the feat/YEL-181 branch January 7, 2024 09:24
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.

2 participants