package com.bocloud.ims.entity.resource;

import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;

/**
 * 存储中心文件
 *
 * @since
 */
@Table("data_store_file")
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class DataStoreFile extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;
	/**
	 * vdc id
	 */
	@Column("vdc_id")
	private Long vdcId;
	/**
	 * vdc id
	 */
	@Column("host_id")
	private Long hostId;
	/**
	 * 云供应商id
	 */
	@Column("vendor_id")
	private Long vendorId; // 云供应商ID
	/**
	 * 存储id
	 */
	@Column("store_id")
	private Long storeId;

	@Column("size")
	private BigDecimal size;
	/**
	 * 已用
	 */
	@Column("allocation")
	private BigDecimal allocation;
	/**
	 * 类型
	 */
	@Column("format")
	private String format;

	@Column("users")
	private String users;

	public void preSave(Long creatorId, Long menderId, Long vendorId, Long vdcId, Long hostId, Long storeId) {
		this.setCreatorId(creatorId);
		this.setMenderId(menderId);
		this.setVendorId(vendorId);
		this.setVdcId(vdcId);
		this.setHostId(hostId);
		this.setStoreId(storeId);
	}

}
