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 CloudTypeEnum {
    /**
     * 云类型
     */
    GOV_CLOUD_NON_LETTER(1, "政务云(非信创)"),
    GOV_CLOUD_LETTER(2, "数字政府"),
    OTHER(3,"其他");


    private Integer code;
    private String desc;

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