package com.ruoyi.project.business.enums;

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

@Getter
@AllArgsConstructor
public enum OperationEnum {
    /**
     * 等于
     */
    EQUAL("=", "=","=","=","00"),
    /**
     * 大于
     */
    GREATER_THAN(">",">",">",">", "01"),
    /**
     * 小于
     */
    LESS_THAN("<", "<","<","<","02"),
    /**
     * 大于等于
     */
    GREATER_THAN_OR_EQUAL(">=",">=",">=",">=", "03"),
    /**
     * 小于等于
     */
    LESS_THAN_OR_EQUAL("<=","<=","<=","<=", "04"),
    /**
     * 包含 中、英、西、饿
     */
    CONTAIN("包含","contains","contiene","содерж", "05"),
    /**
     * 不包含
     */
    NOT_CONTAIN("不包含","exclude","No contiene","Не содержит", "06"),
    ;

    private final String nameZH;
    private final String nameUS;
    private final String nameES;
    private final String nameRU;

    private final String code;

    public static OperationEnum fromByValue(String value) {
        for (OperationEnum auditFlowEnum : values()) {
            if (auditFlowEnum.getCode().equals(value)) {
                return auditFlowEnum;
            }
        }
        throw new ServiceErrorException("非法的运算类型");
    }


}
