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

import java.util.Objects;

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

    /**
     * 奖励类型 1积分2成长值3卡券
     */
    INTEGRAL(1, "积分"),
    GROWTH(2, "成长值"),
    COUPON(3, "卡券"),
    ;

    public final Integer value;
    public final String desc;

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

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


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