package jnpf.model.authority.vo.menu;

import jnpf.model.authority.po.FtbPermissionFunctionMenu;
import jnpf.util.treeutil.SumTree;
import lombok.Data;

/**
 * @Author: peng.hao
 * @create: 2025/3/11
 */
@Data
public class FtbPermissionMenuConfigTree  extends SumTree {
    /**
     * 主键Id
     */
    private String id;
    /**
     * 名称
     */
    private String name;

    private String parentId;
    //菜单类型,0子页面1按钮
    private Integer funType;
    //页面类型,0web菜单1app菜单
    private Integer pageType;
    /**
     * 是否勾选
     */
    private Boolean isChecked = false;
    /**
     * 模块类型
     */
    private Integer moduleType;

    public static FtbPermissionMenuConfigTree convert(FtbPermissionFunctionMenu entity) {
        if (entity == null) {
            return null;
        }
        FtbPermissionMenuConfigTree ftbPermissionMenuConfigTree = new FtbPermissionMenuConfigTree();
        ftbPermissionMenuConfigTree.setName(entity.getFunName());
        ftbPermissionMenuConfigTree.setFunType(entity.getFunType());
        ftbPermissionMenuConfigTree.setParentId(entity.getParentId());
        ftbPermissionMenuConfigTree.setPageType(entity.getPageType());
        ftbPermissionMenuConfigTree.setId(entity.getId());
        return ftbPermissionMenuConfigTree;
    }
}
