package com.platform.modules.plm.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.data.annotation.Transient;
import org.springframework.web.multipart.MultipartFile;

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

/**
 * 资源分块表
 *
 * @author troy
 * @email
 * @date 2019-05-22 14:33:17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PlmChunkEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	
	// 数据ID
	@NotBlank(message = "id不能为空")
	@TableId
	private Long id;
	//当前文件块，从1开始
	@NotBlank(message = "chunkNumber不能为空")
	private Integer chunkNumber;
	//分块大小
	@NotBlank(message = "chunkSize不能为空")
	private Long chunkSize;
	//当前分块大小
	@NotBlank(message = "currentChunkSize不能为空")
	private Long currentChunkSize;
	//总大小
	@NotBlank(message = "totalSize不能为空")
	private Long totalSize;
	//文件标识
	@NotBlank(message = "identifier不能为空")
	private String identifier;
	//文件名
	@NotBlank(message = "filename不能为空")
	private String filename;
	//相对路径
	@NotBlank(message = "relativePath不能为空")
	private String relativePath;
	//总块数
	@NotBlank(message = "totalChunks不能为空")
	private Integer totalChunks;
	//文件类型
	@NotBlank(message = "type不能为空")
	private String type;
	@Transient
	private MultipartFile file;

}
