-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 회원정보(학번, 전화번호) 수정 API 삭제 #156
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
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,6 @@ | |
| import gg.agit.konect.domain.university.repository.UniversityRepository; | ||
| import gg.agit.konect.domain.user.dto.SignupRequest; | ||
| import gg.agit.konect.domain.user.dto.UserInfoResponse; | ||
| import gg.agit.konect.domain.user.dto.UserUpdateRequest; | ||
| import gg.agit.konect.domain.user.enums.Provider; | ||
| import gg.agit.konect.domain.user.enums.UserRole; | ||
| import gg.agit.konect.domain.user.model.UnRegisteredUser; | ||
|
|
@@ -192,30 +191,6 @@ public UserInfoResponse getUserInfo(Integer userId) { | |
| return UserInfoResponse.from(user, joinedClubCount, studyTime, unreadCouncilNoticeCount, isClubManager); | ||
|
||
| } | ||
|
|
||
| @Transactional | ||
| public void updateUserInfo(Integer userId, UserUpdateRequest request) { | ||
| User user = userRepository.getById(userId); | ||
|
|
||
| validateStudentNumberDuplication(user, request); | ||
| validatePhoneNumberDuplication(user, request); | ||
|
|
||
| user.updateInfo(request.name(), request.studentNumber(), request.phoneNumber()); | ||
| } | ||
|
|
||
| private void validateStudentNumberDuplication(User user, UserUpdateRequest request) { | ||
| if (user.hasSameStudentNumber(request.studentNumber())) { | ||
| return; | ||
| } | ||
|
|
||
| boolean exists = userRepository.existsByUniversityIdAndStudentNumberAndIdNot( | ||
| user.getUniversity().getId(), request.studentNumber(), user.getId() | ||
| ); | ||
|
|
||
| if (exists) { | ||
| throw CustomException.of(ApiResponseCode.DUPLICATE_STUDENT_NUMBER); | ||
| } | ||
| } | ||
|
|
||
| private void validateStudentNumberDuplicationOnSignup(Integer universityId, String studentNumber) { | ||
| boolean exists = userRepository.existsByUniversityIdAndStudentNumber(universityId, studentNumber); | ||
|
|
||
|
|
@@ -224,20 +199,6 @@ private void validateStudentNumberDuplicationOnSignup(Integer universityId, Stri | |
| } | ||
| } | ||
|
|
||
| private void validatePhoneNumberDuplication(User user, UserUpdateRequest request) { | ||
| String phoneNumber = request.phoneNumber(); | ||
|
|
||
| if (!StringUtils.hasText(phoneNumber) || user.hasSamePhoneNumber(phoneNumber)) { | ||
| return; | ||
| } | ||
|
|
||
| boolean exists = userRepository.existsByPhoneNumberAndIdNot(phoneNumber, user.getId()); | ||
|
|
||
| if (exists) { | ||
| throw CustomException.of(ApiResponseCode.DUPLICATE_PHONE_NUMBER); | ||
| } | ||
| } | ||
|
|
||
| @Transactional | ||
| public void deleteUser(Integer userId) { | ||
| User user = userRepository.getById(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.
UserUpdateRequest DTO 파일이 더 이상 사용되지 않으므로 삭제해야 합니다. 현재 src/main/java/gg/agit/konect/domain/user/dto/UserUpdateRequest.java 파일이 여전히 존재하지만 어디서도 참조되지 않습니다.