package com.hz.pm.api.performance.enumration;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

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

/**
 * AppIndexTypeEnum
 * @return
 * @author CMM
 * @since 2023/07/26 16:44
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum AppIndexTypeEnum {
    /**
     * 应用指标类型
     */
    COMMON(1, "通用指标"),
    AUX(2, "辅助指标"),
    BUSINESS(3,"业务指标");

    private Integer code;
    private String desc;

    public static String getDesc(Integer code) {
        if (Objects.isNull(code)) {
            return StringUtils.EMPTY;
        }
        for (AppIndexTypeEnum t : AppIndexTypeEnum.values()) {
            if (code.equals(t.getCode())) {
                return t.desc;
            }
        }
        return StringUtils.EMPTY;
    }
}
