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

import com.alibaba.fastjson.annotation.JSONField
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
 * @date  2020/9/15 11:33
 */
@Schema(description = "图分类")
@Table(name = "labsl.graph_category")
class GraphCategory : SBaseEntity(), Serializable {

    /** 分类编码Code */
    @Schema(description = "分类编码Code")
    @Id
    @Column(name = "id")
    @JSONField(name = "code")
    var id: String? = null

    /** 分类名称 */
    @Schema(description = "分类名称")
    @Column(name = "name")
    var name: String? = null

    /** 上级节点 */
    @Schema(description = "上级节点")
    @Column(name = "parent_id")
    var parentId: String? = null

    @Schema(description = "子节点列表")
    var categoryList: ArrayList<GraphCategory>? = null

    @JSONField(name = "categoryList",serialize = false)
    var sign: Boolean = false

} //  Class GraphCategory