package cn.stylefeng.team.project.modular.filing.entity;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.team.project.modular.filing.pojo.aidesign.aiparse.ParseToBusinessResult;
import com.baomidou.mybatisplus.annotation.IdType;
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 lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@TableName(value = "devops_business_ai_parse_log", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class BusinessAiParseLog extends BaseEntity {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键id")
    private Long id;

    @TableField("business_id")
    @ChineseDescription("所属业务id")
    private Long businessId;

    @TableField("origin_excel_file_id")
    @ChineseDescription("原始excel文件id")
    private Long originExcelFileId;

    @TableField("origin_pic_file_id")
    @ChineseDescription("excel转化为png的文件id")
    private Long originPicFileId;

    @TableField("parse_status")
    @ChineseDescription("解析状态：10-进行中，20-解析成功，30-解析失败，40-手动停止")
    private Integer parseStatus;

    @TableField("begin_time")
    @ChineseDescription("开始解析时间")
    private Date beginTime;

    @TableField("end_time")
    @ChineseDescription("结束解析时间")
    private Date endTime;

    @TableField("ai_response_string")
    @ChineseDescription("AI解析的结果")
    private String aiResponseString;

    @TableField(value = "parse_business_result", typeHandler = JacksonTypeHandler.class)
    @ChineseDescription("AI解析为业务数据的结果")
    private ParseToBusinessResult parseBusinessResult;

    @TableField("error_message")
    @ChineseDescription("解析过程中的报错信息")
    private String errorMessage;

}