-
Notifications
You must be signed in to change notification settings - Fork 0
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
탈퇴 기능, 유저 state enum 추가 #5
Conversation
@@ -52,4 +52,11 @@ public ResponseEntity<RegistUserResponse> registUser(@RequestBody @Valid RegistU | |||
|
|||
return new ResponseEntity<RegistUserResponse>(response, httpStatus); | |||
} | |||
|
|||
@PostMapping("/withdraw") |
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.
@DelteMapping 쓰시는게
|
||
@Override | ||
public UserState convertToEntityAttribute(Integer code) { | ||
if(code == null) return null; |
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.
null 보다는 default를 넣는게 낫지 않을까
} | ||
|
||
public static UserState getValue(int code) { | ||
return Arrays.stream(UserState.values()).filter(state -> state.getCode() == code).findFirst().orElse(null); |
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.
good~
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.
null보다는 default 만들기~
public void withdrawUser(String loginId) { | ||
User user = userRepository.findByLoginId(loginId).orElseThrow(UserNotFoundException::new); | ||
user.setState(UserState.WITHDRAW); | ||
user.setName(null); |
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.
user.withdraw() 안에서 다 해버리기~
No description provided.