package org.dromara.system.domain.bo;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.springframework.web.multipart.MultipartFile;

/**
 * OSS分片上传对象
 *
 * @author shihongwei
 */
@Data
public class SysOssChunkBo {

    /**
     * 文件唯一标识(MD5)
     */
    @NotBlank(message = "文件标识不能为空", groups = {AddGroup.class, EditGroup.class})
    private String identifier;

    /**
     * 当前分片索引(从1开始)
     */
    @NotNull(message = "分片索引不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer chunkNumber;

    /**
     * 分片大小
     */
    @NotNull(message = "分片大小不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long chunkSize;

    /**
     * 当前分片大小
     */
    @NotNull(message = "当前分片大小不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long currentChunkSize;

    /**
     * 总分片数
     */
    @NotNull(message = "总分片数不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer totalChunks;

    /**
     * 总大小
     */
    @NotNull(message = "总大小不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long totalSize;

    /**
     * 文件名
     */
    @NotBlank(message = "文件名不能为空", groups = {AddGroup.class, EditGroup.class})
    private String filename;

    /**
     * 分片文件
     */
    @NotNull(message = "分片文件不能为空", groups = {AddGroup.class, EditGroup.class})
    private MultipartFile file;

}
