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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 肖祥
 * @date 2022/12/05 10:08
 * 0：地下层、1：地面层
 */
@Getter
@AllArgsConstructor
public enum SpaceLevelTypeEnum {

    SUB_LAYER(0, "地下层"),

    FLOOR_LAYER(1, "地面层");

    private Integer code;

    private String description;

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