package com.sdtool.common.entity.system;

import com.sweetfish.util.Comment;
import org.rex.db.RColumn;

/**
 * Created by jlutt on 2018-07-13.
 *
 * @author jlutt
 */
public class RoleMenu {

    @Comment("")
    @RColumn("roleid")
    private long roleId;

    @Comment("菜单ID")
    @RColumn("menuid")
    private long menuId;

    @Comment("菜单参数")
    @RColumn("menuperms")
    private String menuPerms;

    @Comment("菜单类型")
    @RColumn("menutype")
    private String menuType;

    @Comment("父级ID")
    @RColumn("parentid")
    private long parentId;

    public long getRoleId() {
        return roleId;
    }

    public void setRoleId(long roleId) {
        this.roleId = roleId;
    }

    public long getMenuId() {
        return menuId;
    }

    public void setMenuId(long menuId) {
        this.menuId = menuId;
    }

    public String getMenuPerms() {
        return menuPerms;
    }

    public void setMenuPerms(String menuPerms) {
        this.menuPerms = menuPerms;
    }

    public String getMenuType() {
        return menuType;
    }

    public void setMenuType(String menuType) {
        this.menuType = menuType;
    }

    public long getParentId() {
        return parentId;
    }

    public void setParentId(long parentId) {
        this.parentId = parentId;
    }

    public String getKey() {
        if ("F".equalsIgnoreCase(menuType)) {
            return String.valueOf(parentId) + "-" + String.valueOf(menuId);
        } else {
            return String.valueOf(menuId);
        }
    }
}
