package com.hz.pm.api.dashboard.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum CockpitAppcationTypeEnum {
    /**
     * 驾驶舱 应用类型
     */
    OPTIMAL(1,"最佳应用"),
    MAJOR(2,"重大应用");

    private Integer code;
    private String desc;

    public static CockpitAppcationTypeEnum match(Integer code) {
        if (Objects.isNull(code)) {
            return null;
        }
        for (CockpitAppcationTypeEnum t : CockpitAppcationTypeEnum.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
}
