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

/**
 *对象 - item
 */
@ApiModel(description = "节点 - item")
@Table(name = "topo.node")
class Item : 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 = "attach_id")
    @JSONField(name = "AttachId")
    var attachId: String? = null

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

    /** 类型（可为建筑、楼层、空间、系统、设备、部件、资产、竖井等） */
    @ApiModelProperty(value = "类型（可为建筑、楼层、空间、系统、设备、部件、资产、竖井等）")
    @Column(name = "type")
    @JSONField(name = "Type")
    var type: String? = null

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

    /** 对象的大小。格式：{"width":, "height": 300} */
    @ApiModelProperty(value = "对象的大小。格式：{\"width\":, \"height\": 300}")
    @Column(name = "size")
    @JSONField(name = "Size")
    var size: TopoSize? = null

    @ApiModelProperty(value = "锚点列表")
    @JSONField(name = "AnchorList")
    var anchorList: ArrayList<Anchor>? = null

    /** 对象列表 */
    var property:TopoObject? = null


} // Class Item