feat(model-provider): 完成模型服务商路由与RAG向量接入后端实现

This commit is contained in:
2026-05-27 22:14:13 +08:00
parent cc745cad47
commit 5d7ca5b31f
57 changed files with 2922 additions and 1 deletions

View File

@@ -0,0 +1,81 @@
package com.bruce.modelprovider.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bruce.common.domain.model.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 模型服务商配置实体。
* <p>
* 说明:
* 1. 数据库列名沿用英文下划线命名,便于与既有 SQL 设计保持一致;
* 2. 字段语义通过中文注释明确,减少后续维护者对英文缩写的理解成本;
* 3. 密钥类字段仅用于后端调用,不应返回明文到前端。
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("model_provider")
/**
* ModelProvider负责模型平台对应层的职责。
*/
public class ModelProvider extends BaseEntity {
/** 数据库字段provider_code服务商编码全局唯一用于路由规则与配置引用。 */
@TableField(value = "provider_code")
private String providerCode;
/** 数据库字段provider_name服务商展示名称。 */
@TableField(value = "provider_name")
private String providerName;
/** 数据库字段provider_type服务商类型例如 OLLAMA / SILICONFLOW / DASHSCOPE / OPENAI / CUSTOM。 */
@TableField(value = "provider_type")
private String providerType;
/** 数据库字段protocol_type协议类型首期固定为 OPENAI_COMPATIBLE。 */
@TableField(value = "protocol_type")
private String protocolType;
/** 数据库字段base_url上游服务基础地址通常包含 /v1。 */
@TableField(value = "base_url")
private String baseUrl;
/** 数据库字段auth_type鉴权类型例如 NONE / BEARER_TOKEN。 */
@TableField(value = "auth_type")
private String authType;
/** 数据库字段secret_ref密钥引用名通常是环境变量键例如 SILICONFLOW_API_KEY。 */
@TableField(value = "secret_ref")
private String secretRef;
/** 数据库字段api_key_cipher密钥密文可选首期不默认启用该方案。 */
@TableField(value = "api_key_cipher")
private String apiKeyCipher;
/** 数据库字段timeout_ms请求超时时间单位毫秒。 */
@TableField(value = "timeout_ms")
private Integer timeoutMs;
/** 调度优先级,数值越小优先级越高(用于后续扩展)。 */
private Integer priority;
/** 是否启用该服务商。 */
private Boolean enabled;
/** 数据库字段health_status健康状态例如 UNKNOWN / HEALTHY / UNHEALTHY。 */
@TableField(value = "health_status")
private String healthStatus;
/** 数据库字段last_health_check_time最近一次健康检查时间。 */
@TableField(value = "last_health_check_time")
private Date lastHealthCheckTime;
/** 备注信息。 */
private String remark;
}