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

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @Author: caiwq
 * @Date: 2024/4/29 15:18
 * @Description: 报修区域枚举类型
 */
@Getter
@AllArgsConstructor
public enum RepairAreaEnum {
    /**
     * 户内
     */
    INDOOR(1, "户内"),
    /**
     * 公区
     */
    PUBLIC_AREA(2, "公区");

    private final int value;
    private final String desc;

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

}
