-
Notifications
You must be signed in to change notification settings - Fork 3
[feature] 개인정보 활용 동의 API 추가 #1160
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
Changes from all commits
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,4 +1,4 @@ | ||
| package moadong.user.payload.response; | ||
|
|
||
| public record LoginResponse(String accessToken,String clubId) { | ||
| public record LoginResponse(String accessToken, String clubId, Boolean allowedPersonalInformation) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ public LoginResponse loginUser(UserLoginRequest userLoginRequest, | |
|
|
||
| user.addRefreshToken(refreshToken); | ||
| userRepository.save(user); | ||
| return new LoginResponse(accessToken, club.getId()); | ||
| return new LoginResponse(accessToken, club.getId(), user.getAllowedPersonalInformation()); | ||
| } catch (MongoWriteException e) { | ||
| throw new RestApiException(ErrorCode.USER_ALREADY_EXIST); | ||
| } | ||
|
|
@@ -178,6 +178,14 @@ public String findClubIdByUserId(String userID) { | |
| return club.getId(); | ||
| } | ||
|
|
||
| @Transactional | ||
| public void allowPersonalInformation(String userId) { | ||
| User user = userRepository.findUserByUserId(userId) | ||
| .orElseThrow(() -> new RestApiException(ErrorCode.USER_NOT_EXIST)); | ||
| user.allowPersonalInformation(); | ||
| userRepository.save(user); | ||
| } | ||
|
Comment on lines
180
to
+187
Member
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. 코드 보면서 AI와 함께 리뷰해봤는데, 트랜잭션 내에서 조회한 영속 엔티티라면 save 없이도 변경 사항이 반영될 수 있다고 하네요
Member
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. 명시적으로 save를 두는게 좋아요
Contributor
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. 맞워요 더티 체킹 되긴하지만 명시적으로 표시하는게 햇갈리지도않구요~ |
||
|
|
||
| private User createUser(UserRegisterRequest request, String userId, String clubId) { | ||
| User user = request.toUserEntity(passwordEncoder); | ||
| user.updateId(userId); | ||
|
|
||
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.
인증도 잘 챙겨서 해줬네요
Swagger도 👍👍