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

import lombok.Getter;

@Getter
public enum ConfigSyncEnum {
    NEW(0, "仅对新建群生效"),
    ALL(1, "所有群"),
    SPECIFY(2, "指定群生效"),

    other(999, "其他");

    // 0-仅对新建群生效 1-所有群 2-指定群生效
    private final int val;
    private final String description;

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

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

        return other;
    }


}
