package cn.sagacloud.server.datacenter.models.entities.topo

import cn.sagacloud.server.datacenter.models.entities.PointPosition
import cn.sagacloud.server.datacenter.models.entities.base.RBaseInfo
import com.alibaba.fastjson.annotation.JSONField
import io.swagger.annotations.ApiModelProperty
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table

/**
 * 关联关系表 - relation
 *
 * @author zhangweixin
 */
@Table(name = "topo.relation")
class TopoRelation : RBaseInfo(){

    /** 关系ID */
    @ApiModelProperty(value = "关系ID")
    @Id
    @Column(name = "id")
    @JSONField(name = "Id")
    var id: String? = null

    /** 项目id */
    @ApiModelProperty(value = "项目id")
    @Column(name = "project_id")
    @JSONField(name = "ProjectId")
    var projectId: String? = null

    /** 图id */
    @ApiModelProperty(value = "图id")
    @Column(name = "graph_id")
    @JSONField(name = "GraphId")
    var graphId: String? = null

    /** 关联节点1_ID */
    @ApiModelProperty(value = "关联节点1_ID")
    @Column(name = "node1_id")
    @JSONField(name = "Node1Id")
    var node1Id: String? = null

    /** 关联节点2_ID */
    @ApiModelProperty(value = "关联节点2_ID")
    @Column(name = "node2_id")
    @JSONField(name = "Node2Id")
    var node2Id: String? = null

    /** 关联锚点1_ID */
    @ApiModelProperty(value = "关联锚点1_ID")
    @Column(name = "anchor1_id")
    @JSONField(name = "Anchor1Id")
    var anchor1Id: String? = null

    /** 关联锚点2_ID */
    @ApiModelProperty(value = "关联锚点2_ID")
    @Column(name = "anchor2_id")
    @JSONField(name = "Anchor2Id")
    var anchor2Id: String? = null

    /** 关系拆线的拐点坐标。格式：[{“X”:12,"Y":20},...{“X”:120,"Y":280}] */
    @ApiModelProperty(value = "关系拆线的拐点坐标。格式：[{“X”:12,\"Y\":20},...{“X”:120,\"Y\":280}]")
    @Column(name = "point_list")
    @JSONField(name = "PointList")
    var pointList: ArrayList<PointPosition>? = null

} // Class TopoRelation