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

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  <zhangweixin@sagacloud.com>
 */
@Schema(description = "管线对象")
@Table(name = "labsl.relation")
open class Relation : SBaseEntity(), Serializable {

    /** 系统图对象id */
    @Schema(description = "系统图对象id",required = true )
    @Id
    @Column(name = "id")
    var id: String? = null

    /** 关系id */
    @Schema(description = "关系id",required = true )
    @Id
    @Column(name = "relation_id")
    var relationId: String? = null

    /** 关系名称 */
    @Schema(description = "关系名称",required = true)
    @Column(name = "name")
    var name: String? = null

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

    /** 关联节点1_id */
    @Schema(description = "关联节点1_id")
    @Column(name = "node1_id")
    var node1Id: String? = null

    /** 关联节点2_id */
    @Schema(description = "关联节点2_id")
    @Column(name = "node2_id")
    var node2Id: String? = null

    /** 关联锚点1_id */
    @Schema(description = "关联锚点1_id")
    @Column(name = "anchor1_id")
    var anchor1Id: String? = null

    /** 关联锚点2_id */
    @Schema(description = "关联锚点2_id")
    @Column(name = "anchor2_id")
    var anchor2Id: String? = null

    /** 方向（0:无向，1：节点1到节点2，2：节点2到节点1) */
    @Schema(description = "方向（0:无向，1：节点1到节点2，2：节点2到节点1)")
    @Column(name = "dir")
    var dir: Int? = null

    /** 直线（Line），水平垂直 */
    @Schema(description = "直线（Line），水平垂直")
    @Column(name = "line_type")
    var lineType: String? = null

    /** 线的顶点坐标 */
    @Schema(description = "线的顶点坐标")
    @Column(name = "point_list")
    var pointList: ArrayList<Pos>? = null

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

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

    /** 系统图 id */
    @Schema(description = "系统图 id",required = true)
    @Id
    @Column(name = "graph_id")
    var graphId: String? = null

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

} // Class Relation