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

import com.persagy.labsl.models.entities.tpt.Pos
import com.persagy.labsl.models.entities.tpt.Size
import com.persagy.service.models.SBaseEntity
import io.swagger.v3.oas.annotations.media.Schema
import java.io.Serializable
import javax.persistence.Column
import javax.persistence.Id
import javax.persistence.Table

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

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

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

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

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

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

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

    /** 节点类型(image / zone) */
    @Schema(description = "节点类型(image / zone)")
    @Column(name = "type")
    var type: String? = null

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

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

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

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

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

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

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

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

    @Schema(description = "对象 id 列表 ")
    @Column(name = "attach_object_ids")
    var attachObjectIds: ArrayList<String>? = null

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

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

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

} // Class