package com.bocloud.ims.entity.resource.manageone;

import com.bocloud.common.utils.DateDeserializer;
import com.bocloud.common.utils.DateSerializer;
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.Generic;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * vdc数据模型
 * 
 * @author wangyu
 * @version 1.0
 * @since 2020年6月17日
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Table("manage_one_vdc")
public class ManageOneVdc extends Generic {

	@PK(PKStrategy.AUTO)
	private Long id;
	@Column("name")
	private String name;
	@Column("vdc_id")
	private String vdcId;
	@Column("create_user_id")
	private String createUserId;
	@Column("manage_one_user_id")
	private Long manageOneUserId;
	@Column("upper_vdc_id")
	private String upperVdcId;
	@Column("create_user_name")
	private String createUserName;
	@Column("level")
	private Integer level;
	@Column("remark")
	private String remark;
	@Column("enabled")
	private Boolean enabled;
	@Column("domain_id")
	private String domainId;
	@Column("domain_name")
	private String domainName;
	@Column("tag")
	private String tag;
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column("create_at")
	private Date createAt;
	@Column("third_type")
	private String thirdType;
	@Column("tenant_id")
	private Long tenantId;
	@Column("parent_id")
	private Long parentId;
	@Column("vendor_id")
	private Long vendorId;
	@IgnoreAll
	private List<ManageOneProject> projects;
}
