package com.rj.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.springframework.web.multipart.MultipartFile;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 录音管理表，含信息卡字段
 * </p>
 *
 * @author 李中华 ,spllzh
 * @since 2025-08-07
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("audio_management")
@Schema(description="录音管理表，含信息卡字段")
public class AudioManagement implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

    @Schema(description = "录音名称")
    @TableField("recording_name")
    private String recordingName;

    @Schema(description = "录音时间")
    @TableField("recording_time")
    private LocalDateTime recordingTime;

    @Schema(description = "所属销售ID")
    @TableField("sales_id")
    private String salesId;

    @Schema(description = "所属销售名称")
    @TableField("sales_name")
    private String salesName;

    @Schema(description = "销售人员电话")
    @TableField("sales_phone")
    private String salesPhone;

    @Schema(description = "录音时长(分钟)")
    @TableField("duration")
    private BigDecimal duration;

    @Schema(description = "客户ID")
    @TableField("customer_id")
    private String customerId;

    @Schema(description = "客户姓名")
    @TableField("customer_name")
    private String customerName;

    @Schema(description = "客户手机号")
    @TableField("customer_phone")
    private String customerPhone;

    @Schema(description = "上传时间")
    @TableField("upload_time")
    private LocalDateTime uploadTime;

    @Schema(description = "意向级别（高意向， 中意向  , 低意向）")
    @TableField("intention_level")
    private String intentionLevel;

    @Schema(description = "所属门店ID")
    @TableField("dealership_id")
    private String dealershipId;

    @Schema(description = "所属门店名称")
    @TableField("dealership_name")
    private String dealershipName;

    @Schema(description = "所属项目ID")
    @TableField("project_id")
    private String projectId;

    @Schema(description = "所属项目名称")
    @TableField("project_name")
    private String projectName;

    @Schema(description = "话术模型")
    @TableField("script_model")
    private String scriptModel;

    @Schema(description = "场景")
    @TableField("scenario")
    private String scenario;

    @Schema(description = "上传状态")
    @TableField("upload_status")
    private String uploadStatus;

    @Schema(description = "服务状态")
    @TableField("service_status")
    private String serviceStatus;

    @Schema(description = "是否合并(0否1是)")
    @TableField("is_merged")
    private Boolean isMerged;

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

    @Schema(description = "公司类型")
    @TableField("company_type")
    private String companyType;

    @Schema(description = "编辑状态")
    @TableField("edit_status")
    private String editStatus;

    @Schema(description = "编辑时间")
    @TableField("edit_time")
    private LocalDateTime editTime;

    @Schema(description = "信息卡类型（如意向车型、购买情况、来访目的、试驾结果、付款方式、试驾专员等）")
    @TableField("info_card_type")
    private String infoCardType;

    @Schema(description = "信息卡内容")
    @TableField("info_card_description")
    private String infoCarddescription;

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


    @Schema(description = "结束时间")
    @TableField("end_time")
    private LocalDateTime endTime;

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

    @Schema(description = "音频文件路径")
    @TableField("audio_file_path")
    private String audioFilePath;

    @Schema(description = "音频文件访问URL")
    @TableField("audio_file_url")
    private String audioFileUrl;

    @Schema(description = "音频文件大小(字节)")
    @TableField("audio_file_size")
    private Long audioFileSize;

    @Schema(description = "音频文件原始名称")
    @TableField("audio_file_original_name")
    private String audioFileOriginalName;

    @Schema(description = "音频文件扩展名")
    @TableField("audio_file_extension")
    private String audioFileExtension;

    @Schema(description = "录音文本内容")
    @TableField("recording_text")
    private String recordingText;


    @Schema(description = "合并状态，录音文本内容")
    @TableField("text_merged_status")
    private String textMergedStatus;

    @Schema(description = "概要总结")
    @TableField("summary")
    private String summary;

    @Schema(description = "大模型调用总 token 数")
    @TableField("total_tokens")
    private Integer totalTokens;

    @Schema(description = "大模型输入 token 数")
    @TableField("input_tokens")
    private Integer inputTokens;

    @Schema(description = "大模型输出 token 数")
    @TableField("output_tokens")
    private Integer outputTokens;

    /**
     * 前端上传的录音文件
     * 此字段不保存在数据库中，仅用于接收前端上传的文件
     */
    @Schema(description = "前端上传的录音文件")
    @TableField(exist = false)
    private MultipartFile audioFile;

}
