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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 肖祥
 * @date 2022/10/20 17:11
 * 巡查状态:0是未巡查,1是已巡查
 */
@Getter
@AllArgsConstructor
public enum InspectStatusEnum {

    NO_START(0, "未巡查"),

    STARTING(1, "已巡查");

    private Integer code;

    private String description;

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