package com.hz.pm.api.projectlib.model.enumeration;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

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

/**
 * 四大体系枚举
 *
 * @return
 * @author CMM
 * @since 2023/03/16 16:27
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum FourSystemEnum {
    /**
     * 项目类型
     */
    BUSINESS_APPLICATION(1, "业务应用"),
    APPLICATION_SUPPORT(2, "应用支撑"),
    DATA_RESOURCES(3, "数据资源"),
    INFRASTRUCTURE(4, "基础设施");

    private Integer code;
    private String desc;

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