package com.bocloud.ims.entity.resource;

import com.bocloud.common.utils.DateDeserializer;
import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.*;
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.NoArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

/**
 * 
 * @ClassName: CloudServerBusiness.java
 * @Description: 虚机业务数据
 *
 * @author: ymh
 * @date: 2021年4月1日 上午10:57:15
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table("cloud_server_business")
public class CloudServerBusiness extends Generic {

	private static Logger logger = LoggerFactory.getLogger(CloudServerBusiness.class);
	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("vendor_id")
	private Long vendorId; // 平台ID
	@Column("server_id")
	private Long serverId; // 资源ID
	@Column("instance_id")
	private String instanceId;// 虚拟机UUID
	@Column("sequence_id")
	private String sequenceId; // 序列ID
	@Column("app_id")
	private String appId; // 云桥流程编号
	@Column("apply_user_code")
	private String applyUserCode; // 申请人代码
	@Column("apply_user_name")
	private String applyUserName; // 申请人
	@Column("apply_team_code")
	private String applyTeamCode; // 申请团队代码
	@Column("apply_team_name")
	private String applyTeamName; // 申请团队
	@Column("env_code")
	private String envCode; // 环境编码
	@Column("env_name")
	private String envName; // 环境名称
	@Column("general_usage")
	private String generalUsage; // 用途
	@Column("app_sys_name")
	private String appSysName; // 应用系统名称
	@Column("is_deleted")
	private Boolean deleted;
	@IgnoreAll
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtPlanRemove;// 计划删除时间
	@IgnoreAll
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtRemove;// 实际删除时间
	@IgnoreUpdate
	@Column("creator_id")
	private Long creatorId;
	@Column("mender_id")
	private Long menderId;
	@IgnoreUpdate
	@Column(value = "gmt_create")
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtCreate;
	@Column("gmt_modify")
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtModify;

}
