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;

/**
 * EvalObjectEnum
 * @return
 * @author CMM
 * @since 2023/07/26 16:44
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum EvalObjectEnum {
    /**
     * 评价对象
     */
    PROJECT("1", "项目"),
    APP("2", "应用"),
    PROJECT_APP("1,2", "项目、应用");

    private String code;
    private String desc;

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