feat: 完善备注
This commit is contained in:
parent
2992a6cfc8
commit
0f6bc1e931
@ -14,9 +14,27 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
* @since 2025/6/14
|
||||
*/
|
||||
public interface AuthService {
|
||||
/**
|
||||
* 登录系统
|
||||
*
|
||||
* @param loginRequest 登录请求
|
||||
* @return token
|
||||
*/
|
||||
String login(LoginRequest loginRequest);
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*
|
||||
* @param loginRequest 退出登录请求
|
||||
* @return 请求结果
|
||||
*/
|
||||
ApiResponse<?> logout(HttpServletRequest request) throws SecurityException;
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*
|
||||
* @param request 注册请求
|
||||
* @return 请求结果
|
||||
*/
|
||||
ApiResponse<?> register(RegisterRequest request) throws Exception;
|
||||
}
|
||||
|
||||
@ -33,4 +33,10 @@ public interface UserService {
|
||||
* @return 更新状态
|
||||
*/
|
||||
ApiResponse<?> updateUserInfo(UpdateUserRequest request);
|
||||
|
||||
/**
|
||||
* 更改用户角色信息
|
||||
* @return 请求结果
|
||||
*/
|
||||
ApiResponse<?> updateUserRole();
|
||||
}
|
||||
|
||||
@ -43,6 +43,12 @@ public class AuthServiceImpl implements AuthService {
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
private final UserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 登录系统
|
||||
*
|
||||
* @param loginRequest 登录请求
|
||||
* @return token
|
||||
*/
|
||||
@Override
|
||||
public String login(LoginRequest loginRequest) {
|
||||
Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(
|
||||
@ -54,6 +60,12 @@ public class AuthServiceImpl implements AuthService {
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*
|
||||
* @param loginRequest 退出登录请求
|
||||
* @return 请求结果
|
||||
*/
|
||||
@Override
|
||||
public ApiResponse<?> logout(HttpServletRequest request) throws SecurityException {
|
||||
try {
|
||||
@ -64,6 +76,12 @@ public class AuthServiceImpl implements AuthService {
|
||||
return ApiResponse.ofStatus(Status.LOGOUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*
|
||||
* @param request 注册请求
|
||||
* @return 请求结果
|
||||
*/
|
||||
@Override
|
||||
public ApiResponse<?> register(RegisterRequest request) throws Exception {
|
||||
|
||||
|
||||
@ -108,4 +108,9 @@ public class UserServiceImpl implements UserService {
|
||||
return ApiResponse.ofSuccess("更新失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<?> updateUserRole() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user