后台管理功能开发,AI配置管理

This commit is contained in:
2025-10-30 14:50:44 +08:00
parent dc0413d084
commit 8b6e3d0815
23 changed files with 4463 additions and 4 deletions
@@ -0,0 +1,214 @@
package com.emotion.dto.request.aiconfig;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
/**
* 创建AI配置请求
*
* @author system
* @date 2025-10-30
*/
@Data
public class AiConfigCreateRequest {
/**
* 配置名称
*/
@NotBlank(message = "配置名称不能为空")
private String configName;
/**
* 配置键值 (唯一标识)
*/
@NotBlank(message = "配置键值不能为空")
private String configKey;
/**
* 配置类型: coze-扣子, openai-OpenAI, claude-Claude, gemini-Gemini等
*/
@NotBlank(message = "配置类型不能为空")
private String configType;
/**
* 服务提供商: coze, openai, anthropic, google等
*/
@NotBlank(message = "服务提供商不能为空")
private String provider;
/**
* API基础URL
*/
@NotBlank(message = "API基础URL不能为空")
private String apiBaseUrl;
/**
* API访问令牌 (加密存储)
*/
@NotBlank(message = "API访问令牌不能为空")
private String apiToken;
/**
* API版本
*/
private String apiVersion;
/**
* 模型名称
*/
private String modelName;
/**
* Bot ID (Coze专用)
*/
private String botId;
/**
* Workflow ID (Coze专用)
*/
private String workflowId;
/**
* 超时时间(毫秒)
*/
private Integer timeoutMs;
/**
* 重试次数
*/
private Integer retryCount;
/**
* 重试延迟(毫秒)
*/
private Integer retryDelayMs;
/**
* 最大Token数
*/
private Integer maxTokens;
/**
* 温度参数 (0.0-2.0)
*/
private BigDecimal temperature;
/**
* Top-p参数 (0.0-1.0)
*/
private BigDecimal topP;
/**
* 是否支持流式输出: 0-不支持, 1-支持
*/
private Integer supportStream;
/**
* 是否支持函数调用: 0-不支持, 1-支持
*/
private Integer supportFunctionCall;
/**
* 是否支持视觉理解: 0-不支持, 1-支持
*/
private Integer supportVision;
/**
* 是否支持文件上传: 0-不支持, 1-支持
*/
private Integer supportFileUpload;
/**
* 使用场景: chat-聊天, summary-总结, emotion_analysis-情绪分析, content_generation-内容生成等
*/
@NotBlank(message = "使用场景不能为空")
private String usageScenario;
/**
* 优先级 (数值越大优先级越高)
*/
private Integer priority;
/**
* 输入Token价格(每1K)
*/
private BigDecimal inputPricePer1k;
/**
* 输出Token价格(每1K)
*/
private BigDecimal outputPricePer1k;
/**
* 货币单位
*/
private String currency;
/**
* 每分钟请求限制
*/
private Integer rateLimitPerMinute;
/**
* 每小时请求限制
*/
private Integer rateLimitPerHour;
/**
* 每日请求限制
*/
private Integer rateLimitPerDay;
/**
* 是否启用: 0-禁用, 1-启用
*/
private Integer isEnabled;
/**
* 是否为默认配置: 0-否, 1-是
*/
private Integer isDefault;
/**
* 环境: development-开发, testing-测试, production-生产
*/
private String environment;
/**
* 自定义请求头
*/
private String customHeaders;
/**
* 自定义参数
*/
private String customParams;
/**
* Webhook回调地址
*/
private String webhookUrl;
/**
* 健康检查URL
*/
private String healthCheckUrl;
/**
* 健康检查间隔(分钟)
*/
private Integer healthCheckIntervalMinutes;
/**
* 配置描述
*/
private String description;
/**
* 使用说明
*/
private String usageNotes;
}
@@ -0,0 +1,26 @@
package com.emotion.dto.request.aiconfig;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* AI配置默认设置请求
*
* @author system
* @date 2025-10-30
*/
@Data
public class AiConfigDefaultRequest {
/**
* 配置ID
*/
@NotBlank(message = "配置ID不能为空")
private String id;
/**
* 是否为默认配置: 0-否, 1-是
*/
private Integer isDefault;
}
@@ -0,0 +1,26 @@
package com.emotion.dto.request.aiconfig;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* AI配置启用/禁用请求
*
* @author system
* @date 2025-10-30
*/
@Data
public class AiConfigEnableRequest {
/**
* 配置ID
*/
@NotBlank(message = "配置ID不能为空")
private String id;
/**
* 是否启用: 0-禁用, 1-启用
*/
private Integer isEnabled;
}
@@ -0,0 +1,51 @@
package com.emotion.dto.request.aiconfig;
import com.emotion.dto.request.PageRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* AI配置分页查询请求
*
* @author system
* @date 2025-10-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AiConfigPageRequest extends PageRequest {
/**
* 关键词搜索(配置名称、配置键值、描述)
*/
private String keyword;
/**
* 配置类型
*/
private String configType;
/**
* 服务提供商
*/
private String provider;
/**
* 使用场景
*/
private String usageScenario;
/**
* 是否启用: 0-禁用, 1-启用
*/
private Integer isEnabled;
/**
* 是否为默认配置: 0-否, 1-是
*/
private Integer isDefault;
/**
* 环境: development-开发, testing-测试, production-生产
*/
private String environment;
}
@@ -0,0 +1,212 @@
package com.emotion.dto.request.aiconfig;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
/**
* 更新AI配置请求
*
* @author system
* @date 2025-10-30
*/
@Data
public class AiConfigUpdateRequest {
/**
* 配置ID
*/
@NotBlank(message = "配置ID不能为空")
private String id;
/**
* 配置名称
*/
private String configName;
/**
* 配置键值 (唯一标识)
*/
private String configKey;
/**
* 配置类型: coze-扣子, openai-OpenAI, claude-Claude, gemini-Gemini等
*/
private String configType;
/**
* 服务提供商: coze, openai, anthropic, google等
*/
private String provider;
/**
* API基础URL
*/
private String apiBaseUrl;
/**
* API访问令牌 (加密存储)
*/
private String apiToken;
/**
* API版本
*/
private String apiVersion;
/**
* 模型名称
*/
private String modelName;
/**
* Bot ID (Coze专用)
*/
private String botId;
/**
* Workflow ID (Coze专用)
*/
private String workflowId;
/**
* 超时时间(毫秒)
*/
private Integer timeoutMs;
/**
* 重试次数
*/
private Integer retryCount;
/**
* 重试延迟(毫秒)
*/
private Integer retryDelayMs;
/**
* 最大Token数
*/
private Integer maxTokens;
/**
* 温度参数 (0.0-2.0)
*/
private BigDecimal temperature;
/**
* Top-p参数 (0.0-1.0)
*/
private BigDecimal topP;
/**
* 是否支持流式输出: 0-不支持, 1-支持
*/
private Integer supportStream;
/**
* 是否支持函数调用: 0-不支持, 1-支持
*/
private Integer supportFunctionCall;
/**
* 是否支持视觉理解: 0-不支持, 1-支持
*/
private Integer supportVision;
/**
* 是否支持文件上传: 0-不支持, 1-支持
*/
private Integer supportFileUpload;
/**
* 使用场景: chat-聊天, summary-总结, emotion_analysis-情绪分析, content_generation-内容生成等
*/
private String usageScenario;
/**
* 优先级 (数值越大优先级越高)
*/
private Integer priority;
/**
* 输入Token价格(每1K)
*/
private BigDecimal inputPricePer1k;
/**
* 输出Token价格(每1K)
*/
private BigDecimal outputPricePer1k;
/**
* 货币单位
*/
private String currency;
/**
* 每分钟请求限制
*/
private Integer rateLimitPerMinute;
/**
* 每小时请求限制
*/
private Integer rateLimitPerHour;
/**
* 每日请求限制
*/
private Integer rateLimitPerDay;
/**
* 是否启用: 0-禁用, 1-启用
*/
private Integer isEnabled;
/**
* 是否为默认配置: 0-否, 1-是
*/
private Integer isDefault;
/**
* 环境: development-开发, testing-测试, production-生产
*/
private String environment;
/**
* 自定义请求头
*/
private String customHeaders;
/**
* 自定义参数
*/
private String customParams;
/**
* Webhook回调地址
*/
private String webhookUrl;
/**
* 健康检查URL
*/
private String healthCheckUrl;
/**
* 健康检查间隔(分钟)
*/
private Integer healthCheckIntervalMinutes;
/**
* 配置描述
*/
private String description;
/**
* 使用说明
*/
private String usageNotes;
}
@@ -0,0 +1,206 @@
package com.emotion.dto.response.aiconfig;
import com.emotion.dto.response.BaseResponse;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* AI配置响应类
*
* @author system
* @date 2025-10-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class AiConfigResponse extends BaseResponse {
/**
* 配置名称
*/
private String configName;
/**
* 配置键值 (唯一标识)
*/
private String configKey;
/**
* 配置类型: coze-扣子, openai-OpenAI, claude-Claude, gemini-Gemini等
*/
private String configType;
/**
* 服务提供商: coze, openai, anthropic, google等
*/
private String provider;
/**
* API基础URL
*/
private String apiBaseUrl;
/**
* API访问令牌 (脱敏显示)
*/
private String apiToken;
/**
* API版本
*/
private String apiVersion;
/**
* 模型名称
*/
private String modelName;
/**
* Bot ID (Coze专用)
*/
private String botId;
/**
* Workflow ID (Coze专用)
*/
private String workflowId;
/**
* 超时时间(毫秒)
*/
private Integer timeoutMs;
/**
* 重试次数
*/
private Integer retryCount;
/**
* 重试延迟(毫秒)
*/
private Integer retryDelayMs;
/**
* 最大Token数
*/
private Integer maxTokens;
/**
* 温度参数 (0.0-2.0)
*/
private Double temperature;
/**
* Top-p参数 (0.0-1.0)
*/
private Double topP;
/**
* 是否支持流式输出: 0-不支持, 1-支持
*/
private Integer supportStream;
/**
* 是否支持函数调用: 0-不支持, 1-支持
*/
private Integer supportFunctionCall;
/**
* 是否支持视觉理解: 0-不支持, 1-支持
*/
private Integer supportVision;
/**
* 是否支持文件上传: 0-不支持, 1-支持
*/
private Integer supportFileUpload;
/**
* 使用场景: chat-聊天, summary-总结, emotion_analysis-情绪分析, content_generation-内容生成等
*/
private String usageScenario;
/**
* 优先级 (数值越大优先级越高)
*/
private Integer priority;
/**
* 输入Token价格(每1K)
*/
private Double inputPricePer1k;
/**
* 输出Token价格(每1K)
*/
private Double outputPricePer1k;
/**
* 货币单位
*/
private String currency;
/**
* 每分钟请求限制
*/
private Integer rateLimitPerMinute;
/**
* 每小时请求限制
*/
private Integer rateLimitPerHour;
/**
* 每日请求限制
*/
private Integer rateLimitPerDay;
/**
* 是否启用: 0-禁用, 1-启用
*/
private Integer isEnabled;
/**
* 是否为默认配置: 0-否, 1-是
*/
private Integer isDefault;
/**
* 环境: development-开发, testing-测试, production-生产
*/
private String environment;
/**
* 自定义请求头
*/
private String customHeaders;
/**
* 自定义参数
*/
private String customParams;
/**
* Webhook回调地址
*/
private String webhookUrl;
/**
* 健康检查URL
*/
private String healthCheckUrl;
/**
* 健康检查间隔(分钟)
*/
private Integer healthCheckIntervalMinutes;
/**
* 配置描述
*/
private String description;
/**
* 使用说明
*/
private String usageNotes;
}