package com.jianshui.common.constant;

public enum ServiceMode {
    SERVICE_MODE_0("0", "免费"),
    SERVICE_MODE_1("1", "预付费"),
    SERVICE_MODE_2("2", "定期结算");

    private String serviceModeCode;
    private String serviceModeMsg;

    ServiceMode(String serviceModeCode, String serviceModeMsg){
        this.serviceModeCode = serviceModeCode;
        this.serviceModeMsg = serviceModeMsg;
    }

    public String getServiceModeMsg(){
        return serviceModeMsg;
    }

    public String getServiceModeCode(){
        return serviceModeCode;
    }

    public static String getRebackType(String code){
        for(ServiceMode rebackType : ServiceMode.values()){
            if(rebackType.getServiceModeCode().equals(code)){
                return rebackType.getServiceModeMsg();
            }
        }
        return "未知服务模式";
    }
}
