-
Notifications
You must be signed in to change notification settings - Fork 6
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
[BE] Refactor/#540 지연로딩의 경우, soft delete을 반영할 수 없는 문제 해결 #553
Changes from all commits
8ef8e54
9db5da3
ca7948b
1af7a11
28e0e4e
83efb4b
c030c84
5f90719
279566f
d3c8c7e
05c62bc
946c65a
43fc9fc
26d98b8
b75fdb6
9df7456
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,17 +1,16 @@ | ||
package com.mapbefine.mapbefine.bookmark.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Modifying; | ||
|
||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface BookmarkRepository extends JpaRepository<Bookmark, Long> { | ||
|
||
Optional<Bookmark> findByMemberIdAndTopicId(Long memberId, Long topicId); | ||
|
||
boolean existsByMemberIdAndTopicId(Long memberId, Long topicId); | ||
|
||
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. 이건 쥬니 글에서 보았듯 @query 어노테이션이 동반되지 않으면 짜피 clearAutomatically 가 동작하지 않으니까 빼신게 맞나요 ? 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. 맞아요! |
||
@Modifying(clearAutomatically = true) | ||
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. 이 부분 JPQL로 해결해야하는데... 도이꺼 PR 머지되면 브랜치 따서 해결할게요. 잊지말자 !!!!!!!!!!!! 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. Service에서 EntityManager 불러오는 대신 JPQL로 바꾸고 |
||
void deleteAllByMemberId(Long memberId); | ||
|
||
Optional<Bookmark> findByMemberIdAndTopicId(Long memberId, Long topicId); | ||
void deleteAllByTopicId(Long topicId); | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,12 +104,16 @@ private static String createNicknameSuffix() { | |
.substring(0, DEFAULT_NICKNAME_SUFFIX_LENGTH); | ||
} | ||
|
||
public void update( | ||
public void updateNickName( | ||
String nickName | ||
) { | ||
memberInfo = memberInfo.createUpdatedMemberInfo(nickName); | ||
} | ||
|
||
public void updateStatus(Status status) { | ||
memberInfo = memberInfo.createUpdatedMemberInfo(status); | ||
} | ||
|
||
public void addTopic(Topic topic) { | ||
Comment on lines
+113
to
117
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. 형태를 통일해주셨군요 굳 |
||
createdTopics.add(topic); | ||
} | ||
|
@@ -147,14 +151,4 @@ public List<Topic> getTopicsWithPermissions() { | |
public boolean isNormalStatus() { | ||
return memberInfo.getStatus() == Status.NORMAL; | ||
} | ||
|
||
public void updateStatus(Status status) { | ||
memberInfo = MemberInfo.of( | ||
memberInfo.getNickName(), | ||
memberInfo.getEmail(), | ||
memberInfo.getImageUrl(), | ||
memberInfo.getRole(), | ||
status | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,8 +56,7 @@ public ResponseEntity<TopicAccessDetailResponse> findTopicAccessDetailByTopicId( | |
return ResponseEntity.ok(response); | ||
} | ||
|
||
// TODO 이 API를 쓰는 곳이 있나? + 결국 특정 회원을 조회하는 건데 어떤 API인지 알기 어렵다.. | ||
// 회원 정보 조회는 /members 에서 하는 걸로 충분하지 않나? 재사용성이 떨어진다. 테스트의 DisplayName도 매칭이 안된다. | ||
@Deprecated(since = "2023.10.06") | ||
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. 👍 |
||
@LoginRequired | ||
@GetMapping("/{permissionId}") | ||
public ResponseEntity<PermissionMemberDetailResponse> findPermissionById(@PathVariable Long permissionId) { | ||
|
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.
하나의 repository 가 flush 의무를 갖는 것이 애매하기 때문에 모든 repository 가 flush 를 호출할 수 있도록 하셨군요! 좋습니다.
그리고, 이 부분은 추후에 개선할 수 있으면 개선하도록 해보죠! (명시적으로 flush 호출 안해보도록)
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.
앗 저 각각 해야 하는줄알았어요...ㅎㅎ 근데 매튜 말대로 곧 사라질 내용인걸로!