package com.ruoyi.project.business.enums;

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

/**
 * @author jubs
 */

@AllArgsConstructor
@Getter
public enum DelFlagEnum {
    //正常
    NORMAL("0"),
    //逻辑删除
    DELETED("1");

    private String value;


    public static DelFlagEnum from(String value) {
        for (DelFlagEnum delFlagEnum : values()) {
            if (delFlagEnum.getValue().equals(value)) {
                return delFlagEnum;
            }
        }
        throw new ServiceErrorException("非法的删除标识符");
    }

}
