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

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

/**
 * <p>
 * PerformanceTemplateStageNameEnum
 * </p>
 *
 * @author Poffy
 * @since 16:56 2023/6/27
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum PerformanceTemplateStageNameEnum {
    /**
     * 模板阶段名称枚举
     */
    STAGE_1(1, "立项阶段"),
    STAGE_2(2, "建设阶段"),
    STAGE_3(3, "运行阶段"),
    STAGE_4(4, "附加阶段");

    private Integer code;
    private String desc;

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