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

import com.pavis.admin.common.model.resp.BaseResp;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.time.LocalDateTime;

/**
 * 向量存储配置信息
 *
 * @author semi
 * @since 2025/05/26 17:28
 */
@Data
@Schema(description = "向量存储配置信息")
public class EmbedStoreResp extends BaseResp {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 存储配置名称(唯一)
     */
    @Schema(description = "存储配置名称(唯一)")
    private String name;

    /**
     * 供应商:milvus/pinecone/qdrant/pgvector/faiss
     */
    @Schema(description = "供应商:milvus/pinecone/qdrant/pgvector/faiss")
    private String provider;

    /**
     * 连接端点 {"host":"192.168.1.10","port":19530}
     */
    @Schema(description = "连接端点 {\"host\":\"192.168.1.10\",\"port\":19530}")
    private String endpoints;

    /**
     * 认证配置 {
     * "username":"admin",
     * "password":"****"
     * }
     */
    @Schema(description = "认证配置 {\"username\":\"admin\",\"password\":\"****\"}")
    private String authConfig;

    /**
     * 数据库配置 {"database":"pavis_admin","table":"sys_user"}
     */
    @Schema(description = "数据库配置 {\"database\":\"pavis_admin\",\"table\":\"sys_user\"}")
    private String databaseConfig;

    /**
     * 向量配置 {
     * "dimension":768,
     * "metric_type":"L2",
     * "index_type":"HNSW",
     * "max_conn":16
     * }
     */
    @Schema(description = "向量配置 {\"dimension\":768,\"metric_type\":\"L2\",\"index_type\":\"HNSW\",\"max_conn\":16}")
    private String vectorConfig;

    /**
     * 连接池配置 {
     * "max_conn":50,
     * "timeout":5000,
     * "retry_policy":"exponential"
     * }
     */
    @Schema(description = "连接池配置 {\"max_conn\":50,\"timeout\":5000,\"retry_policy\":\"exponential\"}")
    private String poolConfig;

    /**
     * 代理配置 {
     * "proxy_host":"gateway.example.com",
     * "proxy_port":443,
     * "proxy_type":"https"
     * }
     */
    @Schema(description = "代理配置 {\"proxy_host\":\"gateway.example.com\",\"proxy_port\":443,\"proxy_type\":\"https\"}")
    private String proxyConfig;

    /**
     * 最后健康检查时间
     */
    @Schema(description = "最后健康检查时间")
    private LocalDateTime lastHealth;

    /**
     * 健康状态:0异常 1正常
     */
    @Schema(description = "健康状态:0异常 1正常")
    private Boolean healthStatus;

    /**
     * 向量数量
     */
    @Schema(description = "向量数量")
    private Long vectorCount;

    /**
     * 存储使用量(字节)
     */
    @Schema(description = "存储使用量(字节)")
    private Long storageUsage;

    /**
     * 修改人
     */
    @Schema(description = "修改人")
    private Long updateUser;

    /**
     * 修改时间
     */
    @Schema(description = "修改时间")
    private LocalDateTime updateTime;

    private String host;
    private Integer port;
    private String databaseName;
    private Integer dimension;
    private String username;
    private String password;
    private String tableName;
}