package cn.reghao.tnb.oss.store.model.po;

import cn.reghao.jutil.jdk.web.db.BaseObject;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

/**
 * @author reghao
 * @date 2022-11-24 10:25:18
 */
@NoArgsConstructor
@Setter
@Getter
public class DataBlock extends BaseObject<Integer> {
    @NotBlank
    @Size(max = 255)
    private String contentId;
    @NotBlank
    @Size(max = 255)
    private String blockId;
    @NotBlank
    @Size(max = 255)
    private String host;
    @NotBlank
    @Size(max = 255)
    private String absolutePath;
    @NotNull
    private Long size;
    //private String baseDir;
    //private String relativeDir;
    //private int index;
    //private long start;
    //private long end;
    //private String objectId;

    public DataBlock(String contentId, String blockId, String host, String absolutePath, long size) {
        this.contentId = contentId;
        this.blockId = blockId;
        this.host = host;
        this.absolutePath = absolutePath;
        this.size = size;
    }
}
