package com.hzs.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: 短信发送状态
 * @Author: jiang chao
 * @Time: 2023/3/8 15:02
 * @Classname: ESmsSendStatus
 * @PackageName: com.hzs.common.core.enums
 */
@AllArgsConstructor
@Getter
public enum ESmsSendResult {

    /**
     * 未发送
     */
    NOT_SEND(0, "未发送"),

    /**
     * 成功
     */
    SUCCESS(1, "成功"),

    /**
     * 失败
     */
    FAIL(2, "失败"),

    ;

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

    /**
     * 根据枚举值获取枚举
     *
     * @param val
     * @return
     */
    public static ESmsSendResult getEnumByValue(int val) {
        for (ESmsSendResult value : ESmsSendResult.values()) {
            if (value.getValue() == val) {
                return value;
            }
        }
        return null;
    }

}
