package com.fs.common.utils;


import com.fs.common.utils.spring.SpringUtils;

import java.util.Arrays;

public class CloudHostUtils {

    /**
     * 是否指定项目名称配置
     */
    public static boolean hasCloudHostName(String... cloudHostName) {
        String cloudHostNameConfig = SpringUtils.getProperty("cloud_host.company_name");
        if (StringUtils.isBlank(cloudHostNameConfig)) {
            return false;
        }

        return Arrays.stream(cloudHostName)
                .filter(StringUtils::isNotBlank)
                .map(String::trim)
                .anyMatch(name -> cloudHostNameConfig.equalsIgnoreCase(name.trim()));
    }
}
