package com.lingyue.ai.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lingyue.common.domain.entity.SimpleModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 批注实体
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("annotations")
@Schema(description = "批注实体")
public class Annotation extends SimpleModel {
    
    @Schema(description = "文档ID")
    @TableField("document_id")
    private String documentId;
    
    @Schema(description = "用户ID")
    @TableField("user_id")
    private String userId;
    
    @Schema(description = "文本")
    @TableField("text")
    private String text;
    
    @Schema(description = "位置")
    @TableField(value = "position", typeHandler = com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
    private Object position; // {page, start: {x, y}, end: {x, y}}
    
    @Schema(description = "类型")
    @TableField("type")
    private String type; // highlight/strikethrough/suggestion
    
    @Schema(description = "建议")
    @TableField("suggestion")
    private String suggestion;
    
    @Schema(description = "AI生成")
    @TableField("ai_generated")
    private Boolean aiGenerated = false;
    
    @Schema(description = "置信度")
    @TableField("confidence")
    private BigDecimal confidence;
    
    @Schema(description = "状态")
    @TableField("status")
    private String status = "pending"; // pending/accepted/rejected
}
