temp
This commit is contained in:
22
urbanLifelineServ/apis/api-auth/pom.xml
Normal file
22
urbanLifelineServ/apis/api-auth/pom.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.xyzh</groupId>
|
||||
<artifactId>apis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-auth</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,74 @@
|
||||
package org.xyzh.api.auth.service;
|
||||
|
||||
import org.xyzh.common.core.domain.LoginDomain;
|
||||
import org.xyzh.common.core.domain.LoginParam;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @description 认证服务接口
|
||||
* @filename AuthService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface AuthService {
|
||||
|
||||
/**
|
||||
* @description 登录
|
||||
* @param LoginParam loginParam 登录参数
|
||||
* @param HttpServletRequest request 请求
|
||||
* @return ResultDomain<LoginDomain> 登录结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> login(LoginParam loginParam, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* @description 刷新token
|
||||
* @param HttpServletRequest request 请求
|
||||
* @return ResultDomain<LoginDomain> 刷新token结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> refreshToken(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* @description 登出
|
||||
* @param HttpServletRequest request 请求
|
||||
* @return ResultDomain<LoginDomain> 登出结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> logout(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* @description 根据验证码类型获取验证码
|
||||
* @param LoginParam loginParam 登录参数
|
||||
* @return ResultDomain<LoginDomain> 获取验证码结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> getCaptcha(LoginParam loginParam);
|
||||
|
||||
/**
|
||||
* @description 根据 token 获取登录信息,供其他服务调用以判定用户登录状态
|
||||
* @param token 鉴权 token(例如 JWT 或会话 token)
|
||||
* @return ResultDomain<LoginDomain> 登录信息,若 token 无效或未登录则在 ResultDomain 中返回相应状态/错误
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> getLoginByToken(String token);
|
||||
|
||||
/**
|
||||
* @description 简单校验 token 是否有效(用于快速判断是否已登录)
|
||||
* @param token 鉴权 token
|
||||
* @return ResultDomain<Boolean> true 表示有效/已登录,false 表示无效/未登录
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<Boolean> isTokenValid(String token);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user