package com.yeejoin.amos.boot.module.jg.api.enums;

import lombok.Getter;

/**
 * 业务类型枚举
 *
 * @author Administrator
 */
public enum SafetyProblemStatusEnum {

    /**
     * 问题主体类型
     */
    UNHANDLED("0", "未处理"),

    HANDLED("1", "已处理");

    @Getter
    private final String code;

    @Getter
    private final String name;

    SafetyProblemStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByType(String code) {
        String name = null;
        for (SafetyProblemStatusEnum enumOne : SafetyProblemStatusEnum.values()) {
            if (enumOne.getCode().equals(code)) {
                name = enumOne.getName();
                break;
            }
        }
        return name;
    }
}
