package com.yuchen.saas.park.api.enums.property;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Author: caiwq
 * @Date: 2023/11/29 15:18
 * @Description: 企业入驻登记审核状态枚举类型
 */
@Getter
@AllArgsConstructor
public enum AuditStatusEnum {

    //审核状态(1:待审核 2:已通过 3:已驳回)
    /**
     * 待审核
     */
    AUDIT(1, "机构"),
    /**
     * 已通过
     */
    PASS(2, "个人"),
    /**
     * 已驳回
     */
    rejected(3, "个人");

    private final int value;
    private final String desc;

    public static String getDescByCode(Integer value) {
        if (Objects.isNull(value)) {
            return "";
        }
        AuditStatusEnum[] enumArray = AuditStatusEnum.values();
        for (AuditStatusEnum e : enumArray) {
            if (e.getValue() == value) {
                return e.getDesc();
            }
        }
        return "";
    }

}
