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 ESmsSendStatus {

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

    /**
     * 已发送
     */
    SEND(1, "已发送"),

    ;

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

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

}
