/**
 * @ProjectName: 智慧评标-主观分助手
 * @Package: com.zhpb.gdyd_zhpb_zgf.entity.mysql
 * @ClassName: OcrResult
 * @Description: OCR识别结果实体类，映射t_ocr_result表
 * @Author: 张志锋
 * @Date: 2025-12-09
 * @Version: 1.0
 * @Copyright: © 2025 智慧评标-主观分助手
 */
package com.zhpb.gdyd_zhpb_zgf.entity.mysql;

import jakarta.persistence.*;
import lombok.Data;
import java.time.LocalDateTime;

/**
 * OCR识别结果实体类
 */
@Entity
@Table(name = "t_ocr_result")
@Data
public class OcrResult {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 文件ID（关联t_file表）
     */
    @Column(name = "file_id", nullable = false)
    private Long fileId;

    /**
     * 项目ID
     */
    @Column(name = "project_id", nullable = false, length = 64)
    private String projectId;

    /**
     * 供应商ID
     */
    @Column(name = "supplier_id", length = 64)
    private String supplierId;

    /**
     * OCR任务ID
     */
    @Column(name = "ocr_task_id", length = 100)
    private String ocrTaskId;

    /**
     * 识别状态（processing-处理中, success-成功, failed-失败）
     */
    @Column(name = "status", length = 32, columnDefinition = "varchar(32) default 'processing'")
    private String status = "processing";

    /**
     * 识别文本内容
     */
    @Column(name = "recognized_text", columnDefinition = "TEXT")
    private String recognizedText;

    /**
     * 下载链接（OCR结果文件下载链接）
     */
    @Column(name = "download_url", columnDefinition = "TEXT")
    private String downloadUrl;

    /**
     * 下载文件名
     */
    @Column(name = "download_file_name", length = 512)
    private String downloadFileName;

    /**
     * 处理页数
     */
    @Column(name = "processed_pages")
    private Integer processedPages;

    /**
     * 总页数
     */
    @Column(name = "total_pages")
    private Integer totalPages;

    /**
     * 错误信息
     */
    @Column(name = "error_message", columnDefinition = "TEXT")
    private String errorMessage;

    /**
     * 开始时间
     */
    @Column(name = "start_time")
    private LocalDateTime startTime;

    /**
     * 完成时间
     */
    @Column(name = "end_time")
    private LocalDateTime endTime;

    /**
     * 创建时间
     */
    @Column(name = "create_time", nullable = false)
    private LocalDateTime createTime = LocalDateTime.now();

    /**
     * 更新时间
     */
    @Column(name = "update_time", nullable = false)
    private LocalDateTime updateTime = LocalDateTime.now();
}
