package com.shining.cloud.enums;


import java.util.Arrays;

/**
 * 此处收集恶意攻击的响应回执
 *
 * @author hongawen
 * @version 1.0.0
 * @date 2023年08月24日 16:13
 */
public enum AliMsgResponseEnum {

    MOBILE_SEND_LIMIT("isv.BUSINESS_LIMIT_CONTROL", "单个号码日、月发送上限，流控超限，频繁发送超限"),

    MOBILE_NOT_ON_SERVICE("MOBILE_NOT_ON_SERVICE", "停机、空号、暂停服务、关机、不在服务区"),

    MOBILE_IN_BLACK("MOBILE_IN_BLACK", "手机号在黑名单");


    private final String code;

    private final String msg;

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    AliMsgResponseEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static AliMsgResponseEnum getAliMsgEnum(String code) {
        AliMsgResponseEnum[] aliMsgResponseEnums = AliMsgResponseEnum.values();
        AliMsgResponseEnum result = Arrays.stream(aliMsgResponseEnums)
                .filter(aliMsgResponseEnum -> aliMsgResponseEnum.getCode().equalsIgnoreCase(code))
                .findFirst().orElse(null);
        return result;
    }


}
