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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 肖祥
 * @date 2022/12/02 18:48
 * 类型（1：层、2：区、3：建筑）
 */
@Getter
@AllArgsConstructor
public enum SpaceTypeEnum {

    LEVEL(1, "层"),

    AREA(2, "区"),

    BUILDING(3, "建筑");

    private Integer code;

    private String description;

    public static String getDescByCode(Integer code) {
        SpaceTypeEnum[] maskEnumArray = SpaceTypeEnum.values();
        for (SpaceTypeEnum maskEnum : maskEnumArray) {
            if (maskEnum.getCode().equals(code)) {
                return maskEnum.getDescription();
            }
        }
        return null;
    }
}
