package com.persagy.server.labsl.models.entities.pub

import com.persagy.server.labsl.models.entities.Pos
import com.persagy.server.labsl.models.entities.Size
import com.persagy.service.models.SBaseEntity
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import java.io.Serializable
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table

/**
 * 图例节点
 *
 * @author wx
 */
@ApiModel(description = "图例节点")
@Table(name = "labsl.node_pub")
class NodePub : SBaseEntity(), Serializable {

    /** 全局id */
    @ApiModelProperty(value = "全局id" )
    @Id
    @Column(name = "id")
    var id: String? = null

    /** 图例节点id */
    @ApiModelProperty(value = "图例节点id",required = true )
    @Id
    @Column(name = "node_id")
    var nodeId: String? = null

    /** 图例节点名称 */
    @ApiModelProperty(value = "图例节点名称")
    @Column(name = "name")
    var name: String? = null

    /** 图例类型 None/Line/Zone/Image:非图例/线条/区域类型/图标 */
    @ApiModelProperty(value = "图例类型 None/Line/Zone/Image:非图例/线条/区域类型/图标")
    @Column(name = "graph_element_type")
    var graphElementType: String? = null

    /** 图元ID */
    @ApiModelProperty(value = "图元ID")
    @Column(name = "graph_element_id")
    var graphElementId: String? = null

    /** 图例数量 */
    @ApiModelProperty(value = "图例数量")
    @Column(name = "num")
    var num: Int? = null

    /** 节点类型(image / zone) */
    @ApiModelProperty(value = "节点类型(image / zone)")
    @Column(name = "type")
    var type: Int? = null

    /** 位置信息 */
    @ApiModelProperty(value = "位置信息")
    @Column(name = "pos")
    var pos: Pos? = null

    /** 缩放 */
    @ApiModelProperty(value = "缩放")
    @Column(name = "scale")
    var scale: Pos? = null

    /** 旋转 */
    @ApiModelProperty(value = "旋转")
    @Column(name = "rolate")
    var rolate: Pos? = null

    /** 大小 */
    @ApiModelProperty(value = "大小")
    @Column(name = "size")
    var size: Size? = null

    /** 轮廓线 */
    @ApiModelProperty(value = "轮廓线")
    @Column(name = "outline")
    var outline: ArrayList<ArrayList<Pos>>? = null

    @ApiModelProperty(value = "应用自定义")
    @Column(name = "properties")
    var properties : HashMap<String,Any?>? = null

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

    /** 锚点列表 */
    @ApiModelProperty(value = "锚点列表")
    var anchorList: ArrayList<AnchorPub>? = null

    @ApiModelProperty(value = "图例节点与对象的关系")
    var attachObjectIds: ArrayList<AttachObjectIdsPub>? = null

    /** 图状态（1一般，2待审核，3审核完成，0发布） */
    @ApiModelProperty(value = "图状态（1一般，2待审核，3审核完成，0发布）")
    @Column(name = "state")
    var state: Int? = null

    @ApiModelProperty(value = "线的绘图样式")
    @Column(name = "style")
    var style : HashMap<String,Any?>? = null

} // Class