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

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;

/**
 * 向量存储配置创建或修改参数
 *
 * @author semi
 * @since 2025/05/26 17:28
 */
@Data
@Schema(description = "向量存储配置创建或修改参数")
public class EmbedStoreReq implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 存储配置名称(唯一)
     */
    @Schema(description = "存储配置名称(唯一)")
    @NotBlank(message = "存储配置名称(唯一)不能为空")
    @Length(max = 100, message = "存储配置名称(唯一)长度不能超过 {max} 个字符")
    private String name;

    /**
     * 供应商:milvus/pinecone/qdrant/pgvector/faiss
     */
    @Schema(description = "供应商:milvus/pgvector/reids")
    @NotBlank(message = "供应商:milvus/pgvector/reids不能为空")
    @Length(max = 50, message = "供应商:milvus/pgvector/reids长度不能超过 {max} 个字符")
    private String provider;

    /**
     * 连接端点
     * {"host":"192.168.1.11","port":19530}
     */
    @Schema(description = "连接端点 {\"host\":\"192.168.1.11\",\"port\":19530}")
    @NotBlank(message = "连接端点不能为空")
    @Length(max = 1073741824, message = "连接端点长度不能超过 {max} 个字符")
    private String endpoints;

    /**
     * 认证配置 {"username":"admin","password":"****"}
     */
    @Schema(description = "认证配置 {\"username\":\"admin\",\"password\":\"****\"}")
    @NotBlank(message = "认证配置不能为空")
    @Length(max = 1073741824, message = "认证配置长度不能超过 {max} 个字符")
    private String authConfig;

    /**
     * 数据库配置 {"database":"pavis_admin","table":"sys_user"}
     */
    @Schema(description = "数据库配置 {\"database\":\"pavis_admin\",\"table\":\"sys_user\"}")
    @NotBlank(message = "数据库配置不能为空")
    @Length(max = 1073741824, message = "数据库配置长度不能超过 {max} 个字符")
    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}")
    @NotBlank(message = "向量配置不能为空")
    @Length(max = 1073741824, message = "向量配置长度不能超过 {max} 个字符")
    private String vectorConfig;
}