package com.bocloud.ims.entity.topology;

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.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;

/**
 * 模型实体类
 * 
 * @author lyy
 * @Version 1.0
 * @since 2017年9月13日
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("ci_module")
public class Module extends Generic {
	@PK(value = PKStrategy.AUTO)
	private Long id;
	/**
	 * 模型名称
	 */
	@Column("name")
	private String name;
	/**
	 * 模型编码
	 */
	@Column("code")
	private String code;
	/**
	 * 图标ID
	 */
	@Column("icon_id")
	private Long iconId;
	/**
	 * CI分类ID
	 */
	@Column("category_id")
	private Long categoryId;
	/**
	 * 创建时间
	 */
	@Column("gmt_create")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtCreate;
	/**
	 * 修改时间
	 */
	@Column("gmt_modify")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date gmtModify;
	/**
	 * 创建人
	 */
	@Column("creator_id")
	private Long creatorId;
	/**
	 * 修改人
	 */
	@Column("mender_id")
	private Long menderId;
	@Column("is_deleted")
	private Boolean deleted;
	@Column("is_disabled")
	private Boolean disabled;
	@Column("is_reserved")
	private Boolean reserved;
	@Column("is_sync_alarm")
	private Boolean syncAlarm;
	// 图标
	@IgnoreAll
	private String icon;
	// 通过target_id查询的Module数据
	@IgnoreAll
	private List<Object> nodes;
	// 查询的模型关系
	@IgnoreAll
	private List<Object> links;
	// 模型关系表的id
	@IgnoreAll
	private Long relationId;
	// 模型与自身的关系
	@IgnoreAll
	private String relationName;
	@IgnoreAll
	private String relationCategoryName;
}
