package com.tofly.feesapi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.util.StringUtils;

/**
 * 短信发送类型
 */
@Getter
@AllArgsConstructor
public enum SmsMessageFsztTypeEnum {

    SMSMESSAGE_FSZT_TYPE_UNTREATED("0", "未发送"),

    SMSMESSAGE_FSZT_TYPE_SUCCESS("1", "成功"),

    SMSMESSAGE_FSZT_TYPE_ERROR("2", "失败"),
    ;
    /**
     * 编码
     */
    private String code;
    /**
     * 内容
     */
    private String value;
    public static String getCodeForValue(String code) {
        String path = "";
        if (StringUtils.isEmpty(code)) {
            return path;
        }
        for (SmsMessageFsztTypeEnum e : SmsMessageFsztTypeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                path = e.value;
                break;
            }
        }
        return path;
    }
}
