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

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

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

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

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

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

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

} //  Class GraphCategory