package tech.easyflow.agent.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.mybatisflex.core.handler.FastjsonTypeHandler;
import tech.easyflow.common.entity.DateEntity;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Agent 知识库绑定实体。
 */
@Table("tb_agent_knowledge_binding")
public class AgentKnowledgeBinding extends DateEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id(keyType = KeyType.Generator, value = "snowFlakeId")
    private BigInteger id;
    @Column(tenantId = true)
    private BigInteger tenantId;
    private BigInteger agentId;
    private BigInteger knowledgeId;
    private String retrievalMode;
    private Boolean enabled;
    @Column(typeHandler = FastjsonTypeHandler.class)
    private Map<String, Object> optionsJson = new LinkedHashMap<>();
    @Column(ignore = true)
    private Map<String, Object> resourceSnapshot = new LinkedHashMap<>();
    @Column(ignore = true)
    private Map<String, Object> resourceSummary = new LinkedHashMap<>();
    private Integer sortNo;
    private Date created;
    private BigInteger createdBy;
    private Date modified;
    private BigInteger modifiedBy;

    public BigInteger getId() { return id; }
    public void setId(BigInteger id) { this.id = id; }
    public BigInteger getTenantId() { return tenantId; }
    public void setTenantId(BigInteger tenantId) { this.tenantId = tenantId; }
    public BigInteger getAgentId() { return agentId; }
    public void setAgentId(BigInteger agentId) { this.agentId = agentId; }
    public BigInteger getKnowledgeId() { return knowledgeId; }
    public void setKnowledgeId(BigInteger knowledgeId) { this.knowledgeId = knowledgeId; }
    public String getRetrievalMode() { return retrievalMode; }
    public void setRetrievalMode(String retrievalMode) { this.retrievalMode = retrievalMode; }
    public Boolean getEnabled() { return enabled; }
    public void setEnabled(Boolean enabled) { this.enabled = enabled; }
    public Map<String, Object> getOptionsJson() { return optionsJson; }
    public void setOptionsJson(Map<String, Object> optionsJson) { this.optionsJson = optionsJson == null ? new LinkedHashMap<>() : optionsJson; }
    public Map<String, Object> getResourceSnapshot() { return resourceSnapshot; }
    public void setResourceSnapshot(Map<String, Object> resourceSnapshot) { this.resourceSnapshot = resourceSnapshot == null ? new LinkedHashMap<>() : resourceSnapshot; }
    public Map<String, Object> getResourceSummary() { return resourceSummary; }
    public void setResourceSummary(Map<String, Object> resourceSummary) { this.resourceSummary = resourceSummary == null ? new LinkedHashMap<>() : resourceSummary; }
    public Integer getSortNo() { return sortNo; }
    public void setSortNo(Integer sortNo) { this.sortNo = sortNo; }
    @Override public Date getCreated() { return created; }
    @Override public void setCreated(Date created) { this.created = created; }
    public BigInteger getCreatedBy() { return createdBy; }
    public void setCreatedBy(BigInteger createdBy) { this.createdBy = createdBy; }
    @Override public Date getModified() { return modified; }
    @Override public void setModified(Date modified) { this.modified = modified; }
    public BigInteger getModifiedBy() { return modifiedBy; }
    public void setModifiedBy(BigInteger modifiedBy) { this.modifiedBy = modifiedBy; }
}
