package com.hzs.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 代付审核状态
 */
@AllArgsConstructor
@Getter
public enum EAgentApprovalStatus {

    /**
     * 审核中
     */
    UNAPPROVED(1, "审核中"),

    /**
     * 审核通过
     */
    APPROVED(2, "审核通过"),

    /**
     * 审核驳回
     */
    REFUSE(3, "审核驳回"),

    ;

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;

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