-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor: 어드민 유저 리팩토링 #1068
refactor: 어드민 유저 리팩토링 #1068
Conversation
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.
고생 많으셨습니다.
혹시 테스트 코드는 따로 작업을 진행하시지 않으신건가요 ?? 관련해서 진행하면 좋을 것 같아요 !
코멘트 남겼습니당
src/main/java/in/koreatech/koin/admin/owner/controller/AdminOwnerController.java
Outdated
Show resolved
Hide resolved
src/main/java/in/koreatech/koin/admin/owner/service/AdminOwnerService.java
Outdated
Show resolved
Hide resolved
src/main/java/in/koreatech/koin/admin/owner/service/AdminOwnerService.java
Outdated
Show resolved
Hide resolved
src/main/java/in/koreatech/koin/admin/owner/service/AdminOwnerService.java
Outdated
Show resolved
Hide resolved
src/main/java/in/koreatech/koin/admin/owner/service/AdminOwnerService.java
Outdated
Show resolved
Hide resolved
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.
관규님이 꼼꼼히 잘 해주셔서 저는 간단한 거 정리해봤어요~!
고생하셨습니다!
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(hidden = true))), | ||
} | ||
) | ||
@Operation(summary = "회원 정보 수정") |
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.
A
간단한 거긴한데, 학생 정보 수정으로 하면 좋을 거 같아요
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.
오,, 그부분을 캐치하시다니
@Transactional | ||
public AdminStudentUpdateResponse updateStudent(Integer id, AdminStudentUpdateRequest adminRequest) { | ||
Student student = adminStudentRepository.getById(id); | ||
User user = student.getUser(); | ||
validateNicknameDuplication(adminRequest.nickname(), id); | ||
validateDepartmentValid(adminRequest.major()); | ||
user.update(adminRequest.nickname(), adminRequest.name(), | ||
adminRequest.phoneNumber(), UserGender.from(adminRequest.gender())); | ||
user.updateStudentPassword(passwordEncoder, adminRequest.password()); | ||
student.update(adminRequest.studentNumber(), adminRequest.major()); | ||
adminStudentRepository.save(student); |
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.
A
제가 이번에 User와 Student를 수정하면서, 메소드 수정할 사항이 좀 생겼어요!!! 리팩토링 끝나고 한 번 다시 정리해도 될까요?
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.
넵!
|
||
private void validateNicknameDuplication(String nickname, Integer userId) { | ||
if (nickname != null && | ||
adminUserRepository.existsByNicknameAndIdNot(nickname, userId)) { | ||
throw DuplicationNicknameException.withDetail("nickname : " + nickname); | ||
} | ||
} | ||
|
||
private void validateDepartmentValid(String department) { | ||
if (department != null && !StudentDepartment.isValid(department)) { | ||
throw StudentDepartmentNotValidException.withDetail("학부(학과) : " + department); | ||
} | ||
} | ||
} |
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.
A
이번에 User팀에서는 ValidationService를 분리했는데, 어떻게 생각하시나요?
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.
수정하겠습니다!
@@ -26,10 +26,10 @@ | |||
|
|||
import in.koreatech.koin.AcceptanceTest; | |||
import in.koreatech.koin.admin.user.model.Admin; | |||
import in.koreatech.koin.admin.user.repository.AdminOwnerRepository; | |||
import in.koreatech.koin.admin.user.repository.AdminOwnerShopRedisRepository; | |||
import in.koreatech.koin.admin.owner.repository.AdminOwnerRepository; |
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.
C
테스트 관련 수정 소요는 없으셨나요?
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.
깜빡했습니다..ㅎ 수정하겠습니다
🔥 연관 이슈
🚀 작업 내용
💬 리뷰 중점사항