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

    NO_START(0, "未巡查"),
    STARTING(1, "进行中"),
    OVER(2, "已巡查");

    private Integer code;

    private String description;

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