package com.bocloud.ims.entity.resource;

import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.IgnoreUpdate;
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.JsonSerialize;

import lombok.Data;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author wangyu
 * @version 4.2.1-SNAPSHOT
 * @since 2019/11/14
 */
@Table("os_tenant")
@Data
public class OSTenant extends Generic {

	@PK(PKStrategy.AUTO)
	private Long id;// id
	@Column("name")
	private String name;// 名称
	@Column("remark")
	private String remark;// 描述
	@Column("tenant_uuid")
	private String tenantUuid;// 租户UUID
	@Column("enabled")
	private Boolean enabled;// 是否激活
	@Column("domain_uuid")
	private String domainUuid;// 域id
	@Column("domain_name")
	private String domainName;// 域名
	@Column("vendor_id")
	private Long vendorId;// 云平台id
	@Column("tenant_id")
	private Long tenantId;// 租户id
	@Column("creator_id")
	private Long creatorId;// 创建人id
	@Column("gmt_create")
	@IgnoreUpdate
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtCreate;// 创建时间
	@IgnoreAll
	private String creator;// 创建人

	@IgnoreAll
	private String newName;
	@IgnoreAll
	private String newRemark;
	@IgnoreAll
	private String tenantName;

	/**
	 *
	 */
	public OSTenant() {
	}

	/**
	 * @param name
	 * @param remark
	 * @param tenantUuid
	 * @param enabled
	 * @param domainUuid
	 * @param domainName
	 * @param vendorId
	 * @param tenantId
	 * @param creatorId
	 * @param gmtCreate
	 * @param creator
	 */
	public OSTenant(String name, String remark, String tenantUuid, Boolean enabled, String domainUuid,
			String domainName, Long vendorId, Long tenantId, Long creatorId, Date gmtCreate, String creator) {
		this.name = name;
		this.remark = remark;
		this.tenantUuid = tenantUuid;
		this.enabled = enabled;
		this.domainUuid = domainUuid;
		this.domainName = domainName;
		this.vendorId = vendorId;
		this.tenantId = tenantId;
		this.creatorId = creatorId;
		this.gmtCreate = gmtCreate;
		this.creator = creator;
	}

}
