package com.bocloud.ims.entity.resource;

import com.bocloud.common.utils.DateDeserializer;
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.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import lombok.Data;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Table("vpn")
@Data
public class Vpn extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;
	@Column("vpn_uuid")
	private String vpnUuid;
	@Column("subnet_id")
	private Long subnetId;
	@Column("router_id")
	private Long routerId;
	@Column("router_code")
	private String routerCode;
	@Column("region")
	private String region;
	@Column("vendor_id")
	private Long vendorId;
	@Column("tenant_id")
	private Long tenantId;
	@Column("uuid")
	private String uuid;
	@Column("bandwidth")
	private Integer bandwidth;
	@Column("admin_state_up")
	private Boolean adminStateUp;
	@Column("tenant_uuid")
	private String tenantUuid;
	@Column("ip_v6")
	private String ipV6;
	@Column("ip_v4")
	private String ipV4;
	@Column("gwqos_uuid")
	private String gwqosUuid;
	@Column("gwqos_sn")
	private String gwqosSn;
	@Column("expired_time")
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date expiredTime;
	@IgnoreAll
	private Boolean expired;
	@IgnoreAll
	private String cidr;
	@IgnoreAll
	private String routerName;
	@IgnoreAll
	private String osTenantName;
	@IgnoreAll
	private String vpnType;

}
