package com.gic.haoban.manage.api.enums.chat;

import java.util.Objects;

/**
 * Created by wangzubo on 2023/3/13.
 */
public enum ChatActivityJoinRuleEnum {

    /**
     * 入群规则 1邀请人所在企微群2服务门店3协管门店4LBS定位
     */
    INVITER_CHAT(1, "邀请人所在企微群"),
    MAIN_STORE(2, "服务门店"),
    OTHER_STORE(3, "协管门店"),
    LBS(4, "LBS定位"),
    ;

    public final Integer value;
    public final String desc;

    ChatActivityJoinRuleEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDescByValue(Integer value) {
        for (ChatActivityJoinRuleEnum joinRuleEnum : ChatActivityJoinRuleEnum.values()) {
            if (Objects.equals(value, joinRuleEnum.value)) {
                return joinRuleEnum.desc;
            }
        }
        return null;
    }

    public static ChatActivityJoinRuleEnum getByValue(Integer value) {
        for (ChatActivityJoinRuleEnum joinRuleEnum : ChatActivityJoinRuleEnum.values()) {
            if (Objects.equals(value, joinRuleEnum.value)) {
                return joinRuleEnum;
            }
        }
        return null;
    }
}
