package com.mvc.iot.aep.enums;

public enum AepCommandResponseResult {
    SUCCESSFUL(0,"成功"),
    SENT(1,"已发送"),
    DELIVERED(2,"已送达"),
    FAILED(3,"失败");

    private int code;
    private String desc;

    AepCommandResponseResult(int code,String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AepCommandResponseResult getByName(String name) {
        for (AepCommandResponseResult result : AepCommandResponseResult.values()) {
            if (result.toString().equals(name)) {
                return result;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }
}
