package com.pavis.admin.aigc.model.entity;

import lombok.Data;

import com.baomidou.mybatisplus.annotation.TableName;

import com.pavis.admin.common.model.entity.BaseDO;

import java.io.Serial;
import java.time.*;

/**
 * 向量存储配置实体
 *
 * @author semi
 * @since 2025/05/26 17:28
 */
@Data
@TableName("aigc_embed_store")
public class EmbedStoreDO extends BaseDO {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 存储配置名称(唯一)
     */
    private String name;

    /**
     * 供应商:milvus/pgvector/reids
     */
    private String provider;

    /**
     * 连接端点 {
     * "host":"192.168.1.10",
     * "port":19530
     * }
     */
    private String endpoints;

    /**
     * 认证配置 {
     * "username":"admin",
     * "password":"****"
     * }
     */
    private String authConfig;

    /**
     * 数据库配置 {
     * "database":"pavis_admin",
     * "table":"sys_user"
     * }
     */
    private String databaseConfig;

    /**
     * 向量配置 {
     * "dimension":768,
     * "metric_type":"L2",
     * "index_type":"HNSW",
     * "max_conn":16
     * }
     */
    private String vectorConfig;

    /**
     * 连接池配置 {
     * "max_conn":50,
     * "timeout":5000,
     * "retry_policy":"exponential"
     * }
     */
    private String poolConfig;

    /**
     * 代理配置 {
     * "proxy_host":"gateway.example.com",
     * "proxy_port":443,
     * "proxy_type":"https"
     * }
     */
    private String proxyConfig;

    /**
     * 最后健康检查时间
     */
    private LocalDateTime lastHealth;

    /**
     * 健康状态:0异常 1正常
     */
    private Boolean healthStatus;

    /**
     * 向量数量
     */
    private Long vectorCount;

    /**
     * 存储使用量(字节)
     */
    private Long storageUsage;
}
