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 MemberStatusEnum {

    /**
     * 正常
     */
    NORMAL(1, "正常"),
    /**
     * 无效
     */
    INVALID(3, "无效");

    private final int value;
    private final String desc;

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

}
