package com.pcloud.book.applet.enums;

public enum SubscribeCountTypeEnum {

    ADD_SUBSCRIBE(1, "增加订阅次数", 1),

    SUB_SUBSCRIBE(2, "减少订阅次数", -1);



    public Integer value;
    public String desc;
    public Integer subscribeCount;

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

    public static  Integer getCountByValue(Integer value){
        SubscribeCountTypeEnum[] subscribeRecordTypeEnums = values();
        for (int i = 0; i < subscribeRecordTypeEnums.length; i++) {
            SubscribeCountTypeEnum subscribeRecordTypeEnum = subscribeRecordTypeEnums[i];
            if (subscribeRecordTypeEnum.value.equals(value)){
                return subscribeRecordTypeEnum.subscribeCount;
            }
        }
        return null;
    }
}
