package org.springblade.file.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 *  业务解压任务分页对象
 * @author bfhuange
 * @date 2024/10/28
 */
@Data
@Schema(description = "业务解压任务分页对象")
public class BusinessUnzipTaskListVO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     *  主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "主键")
    private Long id;
    /**
     *  业务id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "业务id")
    private Long bizId;
    /**
     *  业务code
     */
    @Schema(description = "业务code")
    private String bizCode;
    /**
     *  文档编号
     */
    @Schema(description = "文档编号")
    private String docCode;
    /**
     *  关联类型，file_task 文件任务，attachment 附件
     */
    @Schema(description = "关联类型，file_task 文件任务，attachment 附件")
    private String relateType;
    /**
     *  关联id，文件任务id或附件id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "关联id，文件任务id或附件id")
    private Long relateId;

    //==========================文件任务属性=============================
    /**
     *  Md5
     */
    @Schema(description = "Md5")
    private String md5;

    /**
     *  OBS objectKey
     */
    @Schema(description = "OBS objectKey")
    private String objectKey;

    /**
     * 附件名
     */
    @Schema(description = "附件名")
    private String attachmentName;

    /**
     * 文件类型
     */
    @Schema(description = "文件类型")
    private String suffix;

    /**
     * 附件大小(单位:B)
     */
    @Schema(description = "附件大小(单位:B)")
    private Long size;

    /**
     *  分段大小
     */
    @Schema(description = "分段大小")
    private Integer chunkSize;

    /**
     *  分段数量
     */
    @Schema(description = "分段数量")
    private Integer chunkTotal;

    /**
     *  当前分段的位置(已上传完成的分段)，从0开始，上传完第1段，为1
     */
    @Schema(description = "当前分段的位置(已上传完成的分段)，从0开始，上传完第1段，为1")
    private Integer currentIndex;

    /**
     *  华为云初始化上传任务生成的uploadId
     */
    @Schema(description = "华为云初始化上传任务生成的uploadId")
    private String uploadId;

    /**
     * 状态 uploading:正在上传  completed：上传完成 failed：上传失败 paused：已暂停
     */
    @Schema(description = "状态 uploading:正在上传  completed：上传完成 failed：上传失败 paused：已暂停")
    private String status;

    /**
     * 状态名称
     */
    @Schema(description = "状态名称")
    private String statusStr;

    /**
     * 创建人-用户名称
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "创建人-用户名称")
    private String createUserName;

    /**
     * 创建人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "创建人")
    private Long createUser;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @Schema(description = "创建时间")
    private Date createTime;

    /**
     * 更新人-用户名称
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "创建人-用户名称")
    private String updateUserName;

    /**
     * 更新人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "更新人")
    private Long updateUser;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @Schema(description = "更新时间")
    private Date updateTime;
}
