package com.ruoyi.project.business.enums;

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

@AllArgsConstructor
@Getter
public enum FunctionEnum {

    /**
     * 库存
     */
    STORAGE("STORAGE", "库存"),
    DISPATCH("DISPATCH", "发货"),
    RECOVERY("RECOVERY", "回收"),
    VERIFY("VERIFY", "校验"),
    RECOVERY_OUT("RECOVERY_OUT", "回收出库"),
    BASE_INFO("BASE_INFO", "基础信息"),
    MANAGE("MANAGE", "管理表"),
    INVENTORY("INVENTORY", "库存表");
    private String value;
    private String desc;

    public static FunctionEnum from(String value) {
        for (FunctionEnum functionEnum : values()) {
            if (functionEnum.getValue().equals(value)) {
                return functionEnum;
            }
        }
        throw new ServiceErrorException("非法的功能类型");
    }
}
