package com.bocloud.ims.entity.resource;

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

import java.util.List;

/**
 * 端口实体类
 *
 * @author weiwei
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table("port")
public class Port extends GenericEntity {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("device_uuid")
    private String deviceUuid;// 设备uuid
    @Column("device_owner")
    private String deviceOwner;// 连接设备
    @Column("network_uuid")
    private String networkUuid;// 网络uuid
    @Column("mac_address")
    private String macAddress;// MAC地址
    @Column("port_uuid")
    private String portUuid;// 端口ID
    @Column("vendor_id")
    private Long vendorId; // 云供应商ID
    @Column("network_id")
    private Long networkId;// 网络ID
    @Column("tenant_uuid")
    private String tenantUuid;// openstack底层项目id
    @Column("region_id")
    private String regionId;
    @IgnoreAll
    private String networkName;
    @IgnoreAll
    List<PortFixedIp> portFixedIps;// 固定ip
    @IgnoreAll
    private String ipAddress;
    @IgnoreAll
    private String deviceName;
    @IgnoreAll
    private Long portId;
    @IgnoreAll
    private Long subnetId;
    @IgnoreAll
    private Long projectId;
    @IgnoreAll
    private Long subnetCount;

    @Column("qos_policy_uuid")
    private String qosPolicyUuid;
    @Column("max_kbps")
    private Integer maxKbps;
    @Column("guid")
    private String guid;


    public void preSave(Long creatorId, Long menderId, Long vendorId, Long networkId) {
        this.setCreatorId(creatorId);
        this.setMenderId(menderId);
        this.setVendorId(vendorId);
        this.setNetworkId(networkId);
    }

}
