package com.njcn.user.pojo.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.bo.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;


/**
 * @author xuyang
 * @since 2021-12-13
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_component")
public class Component extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 组件Id
     */
    private String id;

    /**
     * 资源Id
     */
    private String functionId;

    /**
     * 父节点Id
     */
    private String pid;

    /**
     * 上层所有节点Id
     */
    private String pids;

    /**
     * 功能组件名称
     */
    private String name;

    /**
     * 功能组件表示
     */
    private String code;

    /**
     * 组件路径
     */
    private String path;

    /**
     * 功能数组
     */
    private String functionGroup;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 状态：0-删除 1-正常
     */
    private Integer state;

    /**
     * 系统类型
     */
    private String systemType;

    /**
     * 组件类型
     */
    private String componentType;

    private String icon;

    private String image;

    private String timeKey;

    @TableField(exist = false)
    private List<String> timeKeys;

    public String getTimeKey() {
        if (timeKeys != null) {
            timeKey = String.join(",", timeKeys);
        }
        return timeKey;
    }
}
