package com.hzs.common.core.enums;

import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Description: 修改收益状态枚举
 * Author: zhangjing
 * Time: 2022/9/1 9:06
 * Classname: EProfitState
 * PackageName: com.hzs.common.core.enums
 */
@AllArgsConstructor
@Getter
public enum EProfitState {

    /**
     * 1=正常
     */
    NORMAL(0, "正常", 0, EnumsPrefixConstants.EPROFIT_STATE + "0"),
    /**
     * 2=禁止收益
     */
    PROHIBIT(1, "禁止收益", 0, EnumsPrefixConstants.EPROFIT_STATE + "1"),



    ;

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;
    /**
     * 是否启用（0=是,1=否） -- 来源EYesNo
     */
    private final int enable;
    /**
     * 国际化翻译key值
     */
    private final String key;


    /**
     * 根据枚举值获取枚举
     *
     * @param value 枚举值
     * @return
     */
    public static EProfitState getEnumByValue(int value) {
        for (EProfitState eApproveStatus : EProfitState.values()) {
            if (eApproveStatus.getValue() == value) {
                return eApproveStatus;
            }
        }
        return null;
    }

}
