package com.bocloud.ims.entity.resource;

import java.util.Date;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;

import lombok.Data;

/**
 * 对象存储元素实体类
 * 
 * @date 2021/09/08
 */
@Table("bucket_object")
@Data
public class BucketObject extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;
	@Column("object_key")
	private String key;
	@Column("size")
	private Long size; // 大小
	@Column("bucket_id")
	private Long bucketId;
	@Column("bucket_uuid")
	private Long bucketUuid; // 桶id
	@Column("upload_url")
	private String uploadUrl; // 用户上传的路径
	@Column("bucket_name")
	private String bucketName; // 容器名称
	@Column("vendor_id")
	private Long vendorId;
	@Column("tenant_id")
	private Long tenantId;
	@Column("type")
	private String type;
	@Column("region_id")
	private String regionId;
	@Column("is_directory")
	private Boolean isDirectory;
	@Column("parent_id")
	private Long parentId;
	@Column("object_acl")
	private String objectAcl;
	@IgnoreAll
	private String objectSize;

	@Column("object_user_id")
	private Long objectUserId;
	@Column("object_user_uuid")
	private Long objectUserUuid;
	@Column("object_user_name")
	private String objectUserName;

	@Column("absolute_path")
	private String absolutePath;
	@Column("parent_key")
	private String parentKey;
	@Column("last_modified")
	@com.fasterxml.jackson.databind.annotation.JsonSerialize(using = com.bocloud.common.utils.DateSerializer.class)
	@com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = com.bocloud.common.utils.DateDeserializer.class)
	@org.springframework.format.annotation.DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date lastModified;
	@Column("object_index")
	private Integer objectIndex;

}
