package com.hzs.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ESaOrderSyncStatus {
    FAIL(1,  "失败"),
    Handled(0, "已处理")
    ;

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;

    /**
     * 根据枚举值获取枚举
     *
     * @param value
     * @return
     */
    public static String getLabelByValue(Integer value) {
        if (null == value) {
            return "";
        }
        for (ESaOrderSyncStatus enums : ESaOrderSyncStatus.values()) {
            if (enums.getValue() == value) {
                return enums.getLabel();
            }
        }
        return "";
    }
}
