feat: login logic

This commit is contained in:
Tim
2025-07-16 12:54:10 +08:00
parent ea85af4a52
commit e42b5db5a0
4 changed files with 10 additions and 2 deletions

View File

@@ -124,6 +124,13 @@ public class UserService {
return userRepository.save(user);
}
public User updateReason(String username, String reason) {
User user = userRepository.findByUsername(username)
.orElseThrow(() -> new com.openisle.exception.NotFoundException("User not found"));
user.setRegisterReason(reason);
return userRepository.save(user);
}
public User updateProfile(String currentUsername, String newUsername, String introduction) {
User user = userRepository.findByUsername(currentUsername)
.orElseThrow(() -> new com.openisle.exception.NotFoundException("User not found"));