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

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.pavis.admin.common.model.resp.BaseDetailResp;
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
@ExcelIgnoreUnannotated
@Schema(description = "向量存储配置详情信息")
public class EmbedStoreDetailResp extends BaseDetailResp {

    @Serial
    private static final long serialVersionUID = 1L;

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

    /**
     * 供应商:milvus/pgvector/redis
     */
    @Schema(description = "供应商:milvus/pgvector/redis")
    @ExcelProperty(value = "供应商:milvus/pgvector/redis")
    private String provider;

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

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

    /**
     * 数据库配置 {"database":"pavis_admin","table":"sys_user"}
     */
    @Schema(description = "数据库配置 {\"database\":\"pavis_admin\",\"table\":\"sys_user\"}")
    @ExcelProperty(value = "数据库配置")
    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}")
    @ExcelProperty(value = "向量配置 ")
    private String vectorConfig;

    /**
     * 连接池配置 {"max_conn":50,"timeout":5000,"retry_policy":"exponential"}
     */
    @Schema(description = "连接池配置 {\"max_conn\":50,\"timeout\":5000,\"retry_policy\":\"exponential\"}")
    @ExcelProperty(value = "连接池配置 ")
    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\"}")
    @ExcelProperty(value = "代理配置 ")
    private String proxyConfig;

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

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

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

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