package com.rj.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * AI 问答子表
 *
 * <p>对应表：ai_qa_item</p>
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "ai_qa_item", autoResultMap = true)
@Schema(description = "AI问答子表")
public class AiQaItem implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键，UUID")
    @TableId("id")
    private String id;

    @Schema(description = "主表ID（ai_qa_main.id）")
    @TableField("parent_id")
    private String parentId;

    @Schema(description = "问题来源")
    @TableField("quest_src")
    private String questSrc;

    @Schema(description = "回答内容(JSON)")
    @TableField(value = "answer_text", typeHandler = JacksonTypeHandler.class)
    private JsonNode answerText;

    @Schema(description = "租户ID")
    @TableField("tenant_id")
    private String tenantId;

    @Schema(description = "备注")
    @TableField("remarks")
    private String remarks;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
