mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-16 05:13:41 +00:00
v3.0.0 init
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 计费类型枚举
|
||||
*
|
||||
* @author ageerle@163.com
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BillingType {
|
||||
|
||||
TOKEN("1", "token计费"),
|
||||
COUNT("2", "次数计费"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 模型分类
|
||||
*
|
||||
* @author ageerle@163.com
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Getter
|
||||
public enum ChatModeType {
|
||||
OLLAMA("ollama", "ollama本地部署模型"),
|
||||
ZHI_PU("zhipu", "智谱清言"),
|
||||
DEEP_SEEK("deepseek", "深度求索"),
|
||||
QIAN_WEN("qianwen", "通义千问"),
|
||||
OPEN_AI("openai", "openai");
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
ChatModeType(String code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*
|
||||
* @author ageerle@163.com
|
||||
* @date 2025-12-14
|
||||
*/
|
||||
@Getter
|
||||
public enum DisplayType {
|
||||
HIDDEN("1", "不显示"),
|
||||
VISIBLE("0", "显示");
|
||||
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
DisplayType(String code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 图谱构建状态枚举
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Getter
|
||||
public enum GraphStatusEnum {
|
||||
|
||||
/**
|
||||
* 未构建
|
||||
*/
|
||||
NOT_BUILT(0, "未构建", "NOT_BUILT"),
|
||||
|
||||
/**
|
||||
* 构建中
|
||||
*/
|
||||
BUILDING(10, "构建中", "BUILDING"),
|
||||
|
||||
/**
|
||||
* 已完成
|
||||
*/
|
||||
COMPLETED(20, "已完成", "COMPLETED"),
|
||||
|
||||
/**
|
||||
* 失败
|
||||
*/
|
||||
FAILED(30, "失败", "FAILED");
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
private final String statusKey;
|
||||
|
||||
GraphStatusEnum(Integer code, String description, String statusKey) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
this.statusKey = statusKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取枚举
|
||||
*/
|
||||
public static GraphStatusEnum getByCode(Integer code) {
|
||||
for (GraphStatusEnum status : values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据前端状态字符串获取状态码
|
||||
*/
|
||||
public static Integer getCodeByStatusKey(String statusKey) {
|
||||
if (statusKey == null || statusKey.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
for (GraphStatusEnum status : values()) {
|
||||
if (status.getStatusKey().equals(statusKey)) {
|
||||
return status.getCode();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据状态码获取前端状态字符串
|
||||
*/
|
||||
public static String getStatusKeyByCode(Integer code) {
|
||||
GraphStatusEnum status = getByCode(code);
|
||||
return status != null ? status.getStatusKey() : "NOT_BUILT";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
/**
|
||||
* 模态类型
|
||||
*/
|
||||
public enum ModalityType {
|
||||
TEXT, IMAGE, AUDIO, VIDEO, MULTI
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 模型分类枚举
|
||||
*
|
||||
* @author ageerle@163.com
|
||||
* @date 2025-12-30
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ModelType {
|
||||
|
||||
/**
|
||||
* 聊天模型
|
||||
*/
|
||||
CHAT(0, "chat", "聊天模型"),
|
||||
|
||||
/**
|
||||
* 图片识别模型
|
||||
*/
|
||||
IMAGE(1, "image", "图片识别模型"),
|
||||
|
||||
/**
|
||||
* 知识库向量模型
|
||||
*/
|
||||
VECTOR(3, "vector", "知识库向量模型"),
|
||||
|
||||
/**
|
||||
* 知识库内容重新排序模型
|
||||
*/
|
||||
RERANKER(4, "reranker", "知识库内容重新排序模型"),
|
||||
|
||||
/**
|
||||
* 语音生成模型
|
||||
*/
|
||||
AUDIO(5, "audio", "语音生成模型"),
|
||||
|
||||
/**
|
||||
* 语音转文本模型
|
||||
*/
|
||||
TEXT(6, "text", "语音转文本模型"),
|
||||
|
||||
/**
|
||||
* 文生视频模型
|
||||
*/
|
||||
VIDEO(7, "video", "文生视频模型"),
|
||||
|
||||
/**
|
||||
* 文生PPT模型
|
||||
*/
|
||||
PPT(8, "ppt", "文生PPT模型"),
|
||||
|
||||
/**
|
||||
* 文生音乐模型
|
||||
*/
|
||||
MUSIC(9, "music", "文生音乐模型"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private final Integer code;
|
||||
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
private final String key;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private final String description;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 角色枚举
|
||||
*
|
||||
* @author ageerle@163.com
|
||||
* @date 2025-12-17
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RoleType {
|
||||
|
||||
SYSTEM("system"),
|
||||
USER("user"),
|
||||
ASSISTANT("assistant"),
|
||||
FUNCTION("function"),
|
||||
TOOL("tool"),
|
||||
;
|
||||
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 构建任务状态枚举
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Getter
|
||||
public enum TaskStatusEnum {
|
||||
|
||||
/**
|
||||
* 待执行
|
||||
*/
|
||||
PENDING(1, "待执行"),
|
||||
|
||||
/**
|
||||
* 执行中
|
||||
*/
|
||||
RUNNING(2, "执行中"),
|
||||
|
||||
/**
|
||||
* 成功
|
||||
*/
|
||||
SUCCESS(3, "成功"),
|
||||
|
||||
/**
|
||||
* 失败
|
||||
*/
|
||||
FAILED(4, "失败");
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
|
||||
TaskStatusEnum(Integer code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取枚举
|
||||
*/
|
||||
public static TaskStatusEnum getByCode(Integer code) {
|
||||
for (TaskStatusEnum status : values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.ruoyi.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 构建任务类型枚举
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-30
|
||||
*/
|
||||
@Getter
|
||||
public enum TaskTypeEnum {
|
||||
|
||||
/**
|
||||
* 全量构建
|
||||
*/
|
||||
FULL_BUILD(1, "全量构建"),
|
||||
|
||||
/**
|
||||
* 增量更新
|
||||
*/
|
||||
INCREMENTAL_UPDATE(2, "增量更新"),
|
||||
|
||||
/**
|
||||
* 重建
|
||||
*/
|
||||
REBUILD(3, "重建");
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
|
||||
TaskTypeEnum(Integer code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取枚举
|
||||
*/
|
||||
public static TaskTypeEnum getByCode(Integer code) {
|
||||
for (TaskTypeEnum type : values()) {
|
||||
if (type.getCode().equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user