-
Notifications
You must be signed in to change notification settings - Fork 97
[그리디] 정명준 Spring Data JPA 6단계 제출합니다. #270
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
base: htdufhc-bit
Are you sure you want to change the base?
Changes from all commits
db19123
b6ba2cb
5e7b687
ec6ee6d
b17debb
6e1c475
ba98c27
2b95ab2
1c8cfde
ab7f70c
eae5e9a
bf6ac7b
fd847c1
8acaa21
787f1a6
6d4cc45
219413c
5d94f7e
7daa481
1e3fdb3
aac8aa3
4093c0b
557971d
1d58693
7c289c3
a5fa426
50a30f4
31bb114
4975da3
5bc54ca
6eb6095
b400cf2
753f82a
dded032
5e0c8a7
ccb028c
e1b65c3
ce5ad9a
0a3086e
0a7c180
da760e9
b325fc5
3c1f8f2
4108114
f7b7531
f16fde7
084d3eb
4b53082
1902301
6813feb
fb8ea71
72a68ca
0a710ce
5a080cf
85ad22d
363a773
436ecde
8d117f1
dc5b5e7
621f6a1
f81cc37
322d8c1
fa7cd36
787091a
2343bc4
e1fac12
c3bda17
6402408
eaec41b
63bc184
6eaf8f3
ca1f694
6e99544
f2fd69f
4ff2550
795d0ad
d1da150
1e36599
69db99b
5b1a969
72349b2
773b636
e385e04
dfba04f
bada4a5
14acc26
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 |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| package roomescape.auth.dto; | ||
|
|
||
| import roomescape.auth.domain.LoginMember; | ||
|
|
||
| public record LoginCheckResponse( | ||
| String name | ||
| ) { | ||
|
|
||
| public static LoginCheckResponse from(LoginMember loginMember) { | ||
| return new LoginCheckResponse(loginMember.name()); | ||
| } | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,17 @@ | ||
| package roomescape.auth.repository; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.stereotype.Repository; | ||
| import roomescape.auth.entity.RefreshToken; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| public interface RefreshTokenRepository { | ||
|
|
||
| void save(RefreshToken refreshToken); | ||
| @Repository | ||
| public interface RefreshTokenRepository extends JpaRepository<RefreshToken, Long> { | ||
|
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. 시간이 좀 있으면 JpaRepository 내부 구현체가 대략적으로 어떤 클래스로 나뉘고 각각 어떤 역할을 하는지 찾아보시면 좋아보여요~
Author
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. 넵! 한 번 따로 공부해보겠습니다!! |
||
|
|
||
| Optional<RefreshToken> findByToken(String token); | ||
|
|
||
| Optional<RefreshToken> findByMemberId(Long memberId); | ||
|
|
||
| void deleteByMemberId(Long memberId); | ||
|
|
||
| void flush(); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package roomescape.global.entity; | ||
|
|
||
| import jakarta.persistence.EntityListeners; | ||
| import jakarta.persistence.MappedSuperclass; | ||
| import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.time.ZoneId; | ||
|
|
||
| @MappedSuperclass | ||
| @EntityListeners(AuditingEntityListener.class) | ||
| public class BaseSoftDeleteEntity { | ||
|
|
||
| private static final ZoneId KST_ZONE = ZoneId.of("Asia/Seoul"); | ||
|
|
||
| private LocalDateTime deletedAt; | ||
|
|
||
| public void markDeleted() { | ||
| this.deletedAt = LocalDateTime.now(KST_ZONE); | ||
| } | ||
|
|
||
| public LocalDateTime getDeletedAt() { | ||
| return deletedAt; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package roomescape.exception; | ||
| package roomescape.global.exception; | ||
|
|
||
| import org.springframework.http.HttpStatus; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| package roomescape.exception; | ||
| package roomescape.global.exception; | ||
|
|
||
| public record ErrorResponse(String message) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,14 @@ | ||
| package roomescape.member.dto; | ||
|
|
||
| public class MemberResponse { | ||
| private Long id; | ||
| private String name; | ||
| private String email; | ||
| import roomescape.member.entity.Member; | ||
|
|
||
| public MemberResponse(Long id, String name, String email) { | ||
| this.id = id; | ||
| this.name = name; | ||
| this.email = email; | ||
| } | ||
|
|
||
| public Long getId() { | ||
| return id; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
| public record MemberResponse( | ||
| Long id, | ||
| String name, | ||
| String email | ||
| ) { | ||
|
|
||
| public String getEmail() { | ||
| return email; | ||
| public static MemberResponse from(Member member) { | ||
| return new MemberResponse(member.getId(), member.getName(), member.getEmail()); | ||
| } | ||
| } |
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.
👍👍 팀마다 다르긴한데 제 팀은 DTO에 정팩메 쓰는게 암묵적 컨벤션이라 정팩메 있으니 편안하네요