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.ApiModel
import io.swagger.annotations.ApiModelProperty
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table

/**
 *对象锚点信息表 - anchor
 *
 * @author zhangweixin
 */
@ApiModel(description = "对象锚点信息表 - anchor")
@Table(name = "topo.anchor")
class Anchor : 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 = "node_id")
    @JSONField(name = "NodeId")
    var nodeId: String? = null

    /** 锚点位置坐标（相对于对象）。格式：{“X”:12,"Y":20} */
    @ApiModelProperty(value = "锚点位置坐标（相对于对象）。格式：{“X”:12,\"Y\":20}")
    @Column(name = "pos")
    @JSONField(name = "Pos")
    var pos: PointPosition? = null

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

} // Class Anchor