package com.agent.management.model.entity;
import com.agent.management.rag.model.RagSourceType; import jakarta.persistence.*; import lombok.Data; import java.time.LocalDateTime;
@Data @Entity @Table(name="rag_knowledge_source_binding", indexes=@Index(name="idx_rag_binding_kb",columnList="knowledge_base_id"))
public class RagKnowledgeSourceBinding { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; @Column(name="knowledge_base_id",nullable=false) private Long knowledgeBaseId; @Enumerated(EnumType.STRING) @Column(nullable=false) private RagSourceType sourceType; @Column(nullable=false) private String sourceId; private boolean enabled=true; private Integer priority=0; @Column(columnDefinition="TEXT") private String configJson; private LocalDateTime createdAt; private LocalDateTime updatedAt; @PrePersist void create(){createdAt=updatedAt=LocalDateTime.now();} @PreUpdate void update(){updatedAt=LocalDateTime.now();}}
