package com.bocloud.ims.entity.resource;

import com.bocloud.common.model.RequestContext.Catalog;
import com.bocloud.common.utils.DateSerializer;
import com.bocloud.common.utils.DaySerializer;
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;
import java.util.List;
import java.util.Map;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Table("elastic_ip")
public class ElasticIp extends GenericEntity {
    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("instance_id")
    private String instanceId;
    @Column("public_ip")
    private String publicIp;
    @Column("elastic_ip_uuid")
    private String elasticIpUuid;
    @Column("association_id")
    private String associationId;
    @Column("domains")
    private String domains;
    @Column("network_interface_id")
    private String networkInterfaceId;
    @Column("private_ip_address")
    private String privateIpAddress;
    @Column("tags_json")
    private String tagsJson;
    @Column("public_ipv4_pool")
    private String publicIpv4Pool;
    @Column("vendor_id")
    private Long vendorId;
    @Column("region_id")
    private String regionId;// 所属域
    @Column("uuid")
    private String uuid;// uuid，对应子订单号
    @Column("expired_time")
    @JsonSerialize(using = DaySerializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expiredTime;// 过期时间
    @Column("resource_label")
    private String resourceLabel; //标签
    @IgnoreAll
    private String vmName;
    @IgnoreAll
    private String privateIps;
    @IgnoreAll
    private List<Map<String, String>> tags;
    @IgnoreAll
    private String regionName;
    @Column("tenant_id")
    private Long tenantId;// 租户ID
    @Column("project_id")
    private Long projectId;// 项目ID
    @Column("business_id")
    private Long businessId;
    @Column("catalog")
    private Catalog catalog;// 账号类别
    
	@Column("create_time")
	@JsonSerialize(using = DateSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

    @Column("bandwidth_uuid")
    private String bandwidthUuid;
    @Column("bandwidth_name")
    private String bandwidthName;
    @Column("bandwidth_share_type")
    private String bandwidthShareType;
    @Column("bandwidth_charge_mode")
    private String bandwidthChargeMode;
    @Column("type")
    private String type;
    @Column("public_ipv6_address")
    private String publicIpv6Address;
    @Column("ip_version")
    private String ipVersion;

    @Column("band_width")
    private String bandwidth; // EIP的带宽峰值，单位为Mbps
    @Column("instance_type")
    private String instanceType;
    @Column("resource_group_uuid")
    private String resourceGroupUuid;// 资源组
    @IgnoreAll
    private String resourceGroupName;// 资源组
    @IgnoreAll
    private String instanceName;// 实例名称
    @IgnoreAll
    private String vendorType;

    @IgnoreAll
    private String userName;// 用户名称
    @IgnoreAll
    private String businessName;// 业务
    @IgnoreAll
    private String creatorName;// 创建者名称
    @IgnoreAll
    private String ownerName;// 所属人名称
    @IgnoreAll
    private String menderName;// 维护人名称
    @IgnoreAll
    private String projectName;// 所属项目
    @IgnoreAll
    private String tenantName;

    @IgnoreAll
    private Boolean bindFlag;// 是否绑定SNAT标识 0：否 1：是
}