mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-11 16:57:12 +08:00
revert: 还原 终端 => 客户端(终端容易被误解)
This commit is contained in:
@@ -84,7 +84,7 @@ public abstract class AbstractLoginHandler<T extends LoginReq> implements LoginH
|
||||
* 认证
|
||||
*
|
||||
* @param user 用户信息
|
||||
* @param client 终端信息
|
||||
* @param client 客户端信息
|
||||
* @return token 令牌信息
|
||||
*/
|
||||
protected String authenticate(UserDO user, ClientResp client) {
|
||||
|
@@ -35,7 +35,7 @@ public interface LoginHandler<T extends LoginReq> {
|
||||
* 登录
|
||||
*
|
||||
* @param req 登录请求参数
|
||||
* @param client 终端信息
|
||||
* @param client 客户端信息
|
||||
* @param request 请求对象
|
||||
* @return 登录响应参数
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ public interface LoginHandler<T extends LoginReq> {
|
||||
* 登录前置处理
|
||||
*
|
||||
* @param req 登录请求参数
|
||||
* @param client 终端信息
|
||||
* @param client 客户端信息
|
||||
* @param request 请求对象
|
||||
*/
|
||||
void preLogin(T req, ClientResp client, HttpServletRequest request);
|
||||
@@ -54,7 +54,7 @@ public interface LoginHandler<T extends LoginReq> {
|
||||
* 登录后置处理
|
||||
*
|
||||
* @param req 登录请求参数
|
||||
* @param client 终端信息
|
||||
* @param client 客户端信息
|
||||
* @param request 请求对象
|
||||
*/
|
||||
void postLogin(T req, ClientResp client, HttpServletRequest request);
|
||||
|
@@ -44,9 +44,9 @@ public class OnlineUserQuery implements Serializable {
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 终端 ID
|
||||
* 客户端 ID
|
||||
*/
|
||||
@Schema(description = "终端 ID", example = "ef51c9a3e9046c4f2ea45142c8a8344a")
|
||||
@Schema(description = "客户端 ID", example = "ef51c9a3e9046c4f2ea45142c8a8344a")
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
|
@@ -47,10 +47,10 @@ public class LoginReq implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 终端 ID
|
||||
* 客户端 ID
|
||||
*/
|
||||
@Schema(description = "终端 ID", example = "ef51c9a3e9046c4f2ea45142c8a8344a")
|
||||
@NotBlank(message = "终端ID不能为空")
|
||||
@Schema(description = "客户端 ID", example = "ef51c9a3e9046c4f2ea45142c8a8344a")
|
||||
@NotBlank(message = "客户端ID不能为空")
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
|
@@ -69,15 +69,15 @@ public class OnlineUserResp implements Serializable {
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
* 客户端类型
|
||||
*/
|
||||
@Schema(description = "终端类型", example = "PC")
|
||||
@Schema(description = "客户端类型", example = "PC")
|
||||
private String clientType;
|
||||
|
||||
/**
|
||||
* 终端 ID
|
||||
* 客户端 ID
|
||||
*/
|
||||
@Schema(description = "终端 ID", example = "ef51c9a3e9046c4f2ea45142c8a8344a")
|
||||
@Schema(description = "客户端 ID", example = "ef51c9a3e9046c4f2ea45142c8a8344a")
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
|
@@ -68,11 +68,11 @@ public class AuthServiceImpl implements AuthService {
|
||||
@Override
|
||||
public LoginResp login(LoginReq req, HttpServletRequest request) {
|
||||
AuthTypeEnum authType = req.getAuthType();
|
||||
// 校验终端
|
||||
// 校验客户端
|
||||
ClientResp client = clientService.getByClientId(req.getClientId());
|
||||
ValidationUtils.throwIfNull(client, "终端不存在");
|
||||
ValidationUtils.throwIf(DisEnableStatusEnum.DISABLE.equals(client.getStatus()), "终端已禁用");
|
||||
ValidationUtils.throwIf(!client.getAuthType().contains(authType.getValue()), "该终端暂未授权 [{}] 认证", authType
|
||||
ValidationUtils.throwIfNull(client, "客户端不存在");
|
||||
ValidationUtils.throwIf(DisEnableStatusEnum.DISABLE.equals(client.getStatus()), "客户端已禁用");
|
||||
ValidationUtils.throwIf(!client.getAuthType().contains(authType.getValue()), "该客户端暂未授权 [{}] 认证", authType
|
||||
.getDescription());
|
||||
// 获取处理器
|
||||
LoginHandler<LoginReq> loginHandler = loginHandlerFactory.getHandler(authType);
|
||||
|
@@ -124,11 +124,11 @@ public class OnlineUserServiceImpl implements OnlineUserService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否匹配终端 ID
|
||||
* 是否匹配客户端 ID
|
||||
*
|
||||
* @param clientId 终端 ID
|
||||
* @param clientId 客户端 ID
|
||||
* @param userContext 用户上下文信息
|
||||
* @return 是否匹配终端 ID
|
||||
* @return 是否匹配客户端 ID
|
||||
*/
|
||||
private boolean isMatchClientId(String clientId, UserContext userContext) {
|
||||
if (StrUtil.isBlank(clientId)) {
|
||||
|
@@ -20,7 +20,7 @@ import top.continew.admin.system.model.entity.ClientDO;
|
||||
import top.continew.starter.data.mp.base.BaseMapper;
|
||||
|
||||
/**
|
||||
* 终端 Mapper
|
||||
* 客户端 Mapper
|
||||
*
|
||||
* @author KAI
|
||||
* @since 2024/12/03 16:04
|
||||
|
@@ -27,7 +27,7 @@ import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 终端实体
|
||||
* 客户端实体
|
||||
*
|
||||
* @author KAI
|
||||
* @author Charles7c
|
||||
@@ -41,12 +41,12 @@ public class ClientDO extends BaseDO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 终端 ID
|
||||
* 客户端 ID
|
||||
*/
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
* 客户端类型
|
||||
*/
|
||||
private String clientType;
|
||||
|
||||
|
@@ -27,23 +27,23 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 终端查询条件
|
||||
* 客户端查询条件
|
||||
*
|
||||
* @author KAI
|
||||
* @author Charles7c
|
||||
* @since 2024/12/03 16:04
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "终端查询条件")
|
||||
@Schema(description = "客户端查询条件")
|
||||
public class ClientQuery implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
* 客户端类型
|
||||
*/
|
||||
@Schema(description = "终端类型", example = "PC")
|
||||
@Schema(description = "客户端类型", example = "PC")
|
||||
private String clientType;
|
||||
|
||||
/**
|
||||
|
@@ -28,25 +28,25 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 创建或修改终端参数
|
||||
* 创建或修改客户端参数
|
||||
*
|
||||
* @author KAI
|
||||
* @author Charles7c
|
||||
* @since 2024/12/03 16:04
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "创建或修改终端参数")
|
||||
@Schema(description = "创建或修改客户端参数")
|
||||
public class ClientReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
* 客户端类型
|
||||
*/
|
||||
@Schema(description = "终端类型", example = "PC")
|
||||
@NotBlank(message = "终端类型不能为空")
|
||||
@Length(max = 32, message = "终端类型长度不能超过 {max} 个字符")
|
||||
@Schema(description = "客户端类型", example = "PC")
|
||||
@NotBlank(message = "客户端类型不能为空")
|
||||
@Length(max = 32, message = "客户端类型长度不能超过 {max} 个字符")
|
||||
private String clientType;
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ public class ClientReq implements Serializable {
|
||||
private DisEnableStatusEnum status;
|
||||
|
||||
/**
|
||||
* 终端 ID
|
||||
* 客户端 ID
|
||||
*/
|
||||
@Schema(hidden = true)
|
||||
private String clientId;
|
||||
|
@@ -31,7 +31,7 @@ import java.io.Serial;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 终端信息
|
||||
* 客户端信息
|
||||
*
|
||||
* @author KAI
|
||||
* @author Charles7c
|
||||
@@ -39,24 +39,24 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Schema(description = "终端信息")
|
||||
@Schema(description = "客户端信息")
|
||||
public class ClientResp extends BaseDetailResp {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 终端 ID
|
||||
* 客户端 ID
|
||||
*/
|
||||
@Schema(description = "终端 ID", example = "ef51c9a3e9046c4f2ea45142c8a8344a")
|
||||
@ExcelProperty(value = "终端 ID", order = 2)
|
||||
@Schema(description = "客户端 ID", example = "ef51c9a3e9046c4f2ea45142c8a8344a")
|
||||
@ExcelProperty(value = "客户端 ID", order = 2)
|
||||
private String clientId;
|
||||
|
||||
/**
|
||||
* 终端类型(取值于字典 client_type
|
||||
* 客户端类型(取值于字典 client_type
|
||||
*/
|
||||
@Schema(description = "终端类型(取值于字典 client_type)", example = "PC")
|
||||
@ExcelProperty(value = "终端类型", converter = ExcelDictConverter.class, order = 5)
|
||||
@Schema(description = "客户端类型(取值于字典 client_type)", example = "PC")
|
||||
@ExcelProperty(value = "客户端类型", converter = ExcelDictConverter.class, order = 5)
|
||||
@DictExcelProperty("client_type")
|
||||
private String clientType;
|
||||
|
||||
|
@@ -22,7 +22,7 @@ import top.continew.admin.system.model.resp.ClientResp;
|
||||
import top.continew.starter.extension.crud.service.BaseService;
|
||||
|
||||
/**
|
||||
* 终端业务接口
|
||||
* 客户端业务接口
|
||||
*
|
||||
* @author KAI
|
||||
* @author Charles7c
|
||||
@@ -31,10 +31,10 @@ import top.continew.starter.extension.crud.service.BaseService;
|
||||
public interface ClientService extends BaseService<ClientResp, ClientResp, ClientQuery, ClientReq> {
|
||||
|
||||
/**
|
||||
* 根据终端 ID 查詢
|
||||
* 根据客户端 ID 查詢
|
||||
*
|
||||
* @param clientId 终端 ID
|
||||
* @return 终端信息
|
||||
* @param clientId 客户端 ID
|
||||
* @return 客户端信息
|
||||
*/
|
||||
ClientResp getByClientId(String clientId);
|
||||
}
|
@@ -37,7 +37,7 @@ import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 终端业务实现
|
||||
* 客户端业务实现
|
||||
*
|
||||
* @author KAI
|
||||
* @author Charles7c
|
||||
@@ -63,7 +63,7 @@ public class ClientServiceImpl extends BaseServiceImpl<ClientMapper, ClientDO, C
|
||||
for (Long id : ids) {
|
||||
ClientDO client = this.getById(id);
|
||||
query.setClientId(client.getClientId());
|
||||
CheckUtils.throwIfNotEmpty(onlineUserService.list(query), "终端 [{}] 还存在在线用户,不能删除", client.getClientId());
|
||||
CheckUtils.throwIfNotEmpty(onlineUserService.list(query), "客户端 [{}] 还存在在线用户,不能删除", client.getClientId());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user