Skip to content

Commit

Permalink
[Feat] : 닉네임 변경 auth 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
wellbeing-dough committed Oct 5, 2023
1 parent 9d26e29 commit c5c038c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
public class UpdateNicknameInfo {
private Long userId;
private String nickname;
private boolean auth;

@Builder
public UpdateNicknameInfo(Long userId, String nickname, boolean auth) {
public UpdateNicknameInfo(Long userId, String nickname) {
this.userId = userId;
this.nickname = nickname;
this.auth = auth;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ public class UpdateNicknameRequest {
@Size(max = 10, message = "닉네임은 10자 이하여야 합니다")
private String nickname;

@Schema(description = "해당 유저가 기존 닉네임 중복검사를 실시했는지")
@NotNull(message = "접근권한이 없는 유저입니다")
private boolean auth;

public UpdateNicknameInfo toService(Long userId) {
return UpdateNicknameInfo.builder()
.userId(userId)
.nickname(nickname)
.auth(auth)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ public GetUserResponse getUser(Long userId) {
@Transactional
public void updateNickname(UpdateNicknameInfo info) {
UserEntity user = userRepository.findById(info.getUserId()).orElseThrow(UserNotFoundException::new);
if(!info.isAuth()) {
throw new UserNotAccessRightException();
}
user.updateNickname(info.getNickname());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class UserServiceTest {
UpdateNicknameInfo updateNicknameInfo = UpdateNicknameInfo.builder()
.nickname("나사나이이영재")
.userId(user.getId())
.auth(true)
.build();
BDDMockito.given(userRepository.findById(1L)).willReturn(Optional.ofNullable(user));

Expand Down

0 comments on commit c5c038c

Please sign in to comment.