package com.ruoyi.project.business.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author fangk
 * @date 2024/6/14
 * @desc RoleEnum 角色枚举
 */
@AllArgsConstructor
@Getter
public enum RoleEnum {

    /**
     * 超级管理员,admin
     * 普通角色,common
     * demo,demo
     * 总经理,manager
     * 市场总监,MKT
     * 销售总监,sales_director
     * 销售支持,sales_support
     * 销售区域总监,area_sales_director
     * 代理商经理,agent_manager
     * 代理商销售,agent_sales
     * 销售经理,sales_manager
     * 系统管理员,system_manager
     * cs,cs
     * cs1,cs2
     * cs2,cs2
     * cs4,cs4
     * 技术人员,tech
     * test,test
     * 财务,finances
     * 技术,technical
     * 采购,purchase
     */

    ADMIN("admin", "超级管理员"),
    COMMON("common", "普通角色"),
    DEMO("demo", "demo"),
    MANAGER("manager", "总经理"),
    MKT("MKT", "市场总监"),
    SALES_DIRECTOR("sales_director", "销售总监"),
    SALES_SUPPORT("sales_support", "销售支持"),
    AREA_SALES_DIRECTOR("area_sales_director", "销售区域总监"),
    AGENT_MANAGER("agent_manager", "代理商经理"),
    AGENT_SALES("agent_sales", "代理商销售"),
    SALES_MANAGER("sales_manager", "销售经理"),
    SYSTEM_MANAGER("system_manager", "系统管理员"),
    TECH("tech", "技术人员"),
    TEST("test", "test"),
    FINANCES("finances", "财务"),
    TECHNICAL("technical", "技术"),
    PURCHASE("purchase", "采购");

    private final String key;
    private final String name;
    
    public static List<String> roleKeys() {
        return Arrays.stream(RoleEnum.values()).map(RoleEnum::getKey).collect(Collectors.toList());
    }
    
    public static List<String> roleKeys(RoleEnum... roleEnums) {
        return Arrays.stream(roleEnums).map(RoleEnum::getKey).collect(Collectors.toList());
    }
    
    

}
