package com.cusc.nirvana.user.rnr.fp.dto;

import java.util.Arrays;

/**
 * 短信业务类型
 *
 * @author yubo
 * @since 2022-05-03 17:44
 */
public enum MessageBizTypeEnum {

    BIND(1, "一车多卡绑定", "surplusMessageCallBackHandler"),
    UBIND(2, "原车主解绑", "cardUnBindMessageCallBackHandler"),
    SECOND_UNBIND(3, "二手车解绑", ""),
    CHANGETBOX(4, "换件", "changeTBoxMessageCallBackHandler"),
    UNBIND(5,"企业解绑", "enterpriseUnBindCallBackHandler");


    //存入数据库值
    private int code;
    //说明
    private String value;
    //短信回调
    private String callBackHandlerName;

    MessageBizTypeEnum(int code, String value, String callBackHandlerName) {
        this.code = code;
        this.value = value;
        this.callBackHandlerName = callBackHandlerName;
    }

    public static MessageBizTypeEnum getBizType(int code) {
        return Arrays.stream(MessageBizTypeEnum.values()).filter(b -> b.getCode() == code)
                .findFirst().get();
    }

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public String getMessageCallBackHandlerName() {
        return callBackHandlerName;
    }
}
