mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-03-20 08:03:45 +08:00
refactor(chat): 重构聊天服务架构,引入Handler模式
主要变更: 1. 移除ruoyi-ai-copilot模块 2. 重构docker配置目录结构,统一迁移至docs/docker/ 3. 聊天服务引入Handler模式: - 新增ChatHandler接口及多种实现 - DefaultChatHandler: 默认聊天处理 - AgentChatHandler: Agent模式处理 - WorkflowChatHandler: 工作流处理 - ResumeChatHandler: 恢复会话处理 - ChatContextBuilder: 上下文构建器 4. 简化AbstractStreamingChatService和ChatServiceFacade代码 5. 优化各Provider实现,统一代码风格 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,10 +80,16 @@ public class AuthController {
|
||||
// 授权类型和客户端id
|
||||
String clientId = loginBody.getClientId();
|
||||
String grantType = loginBody.getGrantType();
|
||||
log.info("登录请求 - clientId: {}, grantType: {}", clientId, grantType);
|
||||
SysClientVo client = clientService.queryByClientId(clientId);
|
||||
log.info("查询客户端结果 - client: {}, grantType: {}", client, client != null ? client.getGrantType() : "null");
|
||||
// 查询不到 client 或 client 内不包含 grantType
|
||||
if (ObjectUtil.isNull(client) || !StringUtils.contains(client.getGrantType(), grantType)) {
|
||||
log.info("客户端id: {} 认证类型:{} 异常!.", clientId, grantType);
|
||||
if (ObjectUtil.isNull(client)) {
|
||||
log.info("客户端id: {} 不存在!", clientId);
|
||||
return R.fail(MessageUtils.message("auth.grant.type.error"));
|
||||
}
|
||||
if (!StringUtils.contains(client.getGrantType(), grantType)) {
|
||||
log.info("客户端id: {} 认证类型:{} 不匹配! 数据库grantType: {}", clientId, grantType, client.getGrantType());
|
||||
return R.fail(MessageUtils.message("auth.grant.type.error"));
|
||||
} else if (!SystemConstants.NORMAL.equals(client.getStatus())) {
|
||||
return R.fail(MessageUtils.message("auth.grant.type.blocked"));
|
||||
|
||||
Reference in New Issue
Block a user