package com.yeejoin.amos.patrol.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author keyong
 * @title: DefectLevelEnum
 * <pre>
 * @description: TODO
 * </pre>
 * @date 2023/4/23 8:30
 */
@AllArgsConstructor
@Getter
public enum DefectLevelEnum {

    GENERAL(1, "一般"),
    SEVERITY(2, "严重"),
    URGENT(3, "危急");

    private Integer key;
    private String value;

    public static DefectLevelEnum getByKey(Integer key) {
        for (DefectLevelEnum enums : DefectLevelEnum.values())
        {
            if (enums.getKey() == key)
            {
                return enums;
            }
        }
        return null;
    }
}
