package com.ruoyi.project.business.enums;

import com.ruoyi.common.exception.ServiceErrorException;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ModuleEnum {

    COMMON("COMMON", "通用");

    private String value;
    private String desc;

    public static ModuleEnum from(String value) {
        for (ModuleEnum moduleEnum : values()) {
            if (moduleEnum.getValue().equals(value)) {
                return moduleEnum;
            }
        }
        throw new ServiceErrorException("非法的模块类型");
    }
}
