package com.bocloud.ims.entity.topology;

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

/**
 * Ci_relation_category CI关系类型实体类
 *
 * @author tangcq
 * @Version 1.0
 * @since 2017年12月5日
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("ci_relation_category")
public class RelationCategory extends Generic {
    @PK(value = PKStrategy.AUTO)
    private Long id;
    /**
     * 关系类型名称
     */
    @Column("name")
    private String name;
    /**
     * 创建时间
     */
    @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_reserved")
    private Boolean reserved;

    public RelationCategory(String name, Date gmtCreate, Date gmtModify, Long creatorId, Long menderId,
                            Boolean reserved) {
        super();
        this.name = name;
        this.gmtCreate = gmtCreate;
        this.gmtModify = gmtModify;
        this.creatorId = creatorId;
        this.menderId = menderId;
        this.reserved = reserved;
    }
}
