package com.bocloud.ims.entity.common;

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.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
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;

/**
 * 服务
 *
 * @author Administrator
 */
@Table("cloud_service")
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class CloudService extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;
	@Column("sn")
	private String sn; // 产品编码
	@Column("catalog_id")
	private Long catalogId; // 目录ID
	@Column("code")
	private String code;
	@Column("icon_id")
	private Long iconId;// 图标id
	@Column("template_name")
	private String templateName;// 模板名称
	@Column("off_date")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
	private Date offDate;// 服务定时下架时间
	@Column("unit")
	private String unit; // 单位
	@IgnoreAll
	private String catalogName;
	@IgnoreAll
	private Long tenantId;
	@IgnoreAll
	private String icon;
	@IgnoreAll
	private Integer priority; // 排序字段
	@IgnoreAll
	private Long quota;// 配额数
	@IgnoreAll
	private Long minQuota;// 最小配额数
	@IgnoreAll
	private Long maxQuota;// 最大配额数
	@IgnoreAll
	private Boolean releasable;// 能否解除
	@IgnoreAll
	private Long slaId;
}
