package com.tzld.piaoquan.api.common.enums.wecom;

import lombok.Getter;

@Getter
public enum MsgSendStatusEnum {
    FAIL(0, "失败"),
    NORMAL(1, "正常"),

    other(999, "其他");

    private final int val;
    private final String description;

    MsgSendStatusEnum(int val, String description) {
        this.val = val;
        this.description = description;
    }

    public static MsgSendStatusEnum from(int val) {
        for (MsgSendStatusEnum statusEnum : MsgSendStatusEnum.values()) {
            if (statusEnum.getVal() == val) {
                return statusEnum;
            }
        }

        return other;
    }


}
