package com.bocloud.ims.entity.resource;

import java.util.Date;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

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.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Table("route_table")
public class RouteTable extends Generic {
    @PK(value = PKStrategy.AUTO)
    private Long id;
    @Column("uuid")
    private String uuid;
    @Column("name")
    private String name;
    @Column("propagating_vgws")
    private Object propagatingVgws;
    @Column("vpc_id")
    private Long vpcId;
    @Column("vpc_uuid")
    private String vpcUuid;
    @Column("owner_uuid")
    private String ownerUuid;
    @Column("vendor_id")
    private Long vendorId;
    @Column("region_id")
    private String regionId;
    @Column("is_deleted")
    private Boolean deleted;
    @Column("creator_id")
    private Long creatorId;
    @Column("mender_id")
    private Long menderId;
    @IgnoreUpdate
    @Column(value = "gmt_create", nullable = false)
    @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;
    @IgnoreAll
    private String regionName;
    @IgnoreAll
    private String vpcName;
    @IgnoreAll
    private Boolean main;
    @IgnoreAll
    private String subnetAssociations;
    @IgnoreAll
    private String edgeAssociations;

    @Column("type")
    private String type;
    @Column("remark")
    private String remark;
    @Column("resource_group_uuid")
    private String resourceGroupUuid;// 资源组
    @Column("status")
    private String status;
    @Column("router_id")
    private String routerId;// 路由器ID

    @IgnoreAll
    private List<String> subnetUuids;// 交换机

    @IgnoreAll
    private String resourceGroupName;// 资源组

    @IgnoreAll
    private Integer subnetCount;
}