Search in sources :

Example 6 with BizSystemModule

use of com.jeesuite.gateway.model.BizSystemModule in project jeesuite-libs by vakinge.

the class CurrentSystemHolder method loadLocalRouteModules.

private static void loadLocalRouteModules() {
    localModules = new ArrayList<>();
    Properties properties = ResourceUtils.getAllProperties("zuul.routes.");
    Set<Entry<Object, Object>> entrySet = properties.entrySet();
    BizSystemModule module;
    for (Entry<Object, Object> entry : entrySet) {
        String key = entry.getKey().toString();
        if (!key.endsWith(".path"))
            continue;
        String prefix = key.replace(".path", "");
        module = new BizSystemModule();
        module.setRouteName(entry.getValue().toString().substring(1).replace("/**", ""));
        module.setServiceId(properties.getProperty(prefix + ".serviceId"));
        module.setAnonymousUris(properties.getProperty(prefix + ".anonymousUris"));
        localModules.add(module);
    }
}
Also used : Entry(java.util.Map.Entry) BizSystemModule(com.jeesuite.gateway.model.BizSystemModule) Properties(java.util.Properties)

Aggregations

BizSystemModule (com.jeesuite.gateway.model.BizSystemModule)6 ApiInfo (com.jeesuite.common.model.ApiInfo)3 JeesuiteBaseException (com.jeesuite.common.JeesuiteBaseException)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Entry (java.util.Map.Entry)2 Properties (java.util.Properties)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 GlobalRuntimeContext (com.jeesuite.common.GlobalRuntimeContext)1 ResourceUtils (com.jeesuite.common.util.ResourceUtils)1 SystemMgtApi (com.jeesuite.gateway.api.SystemMgtApi)1 BizSystemPortal (com.jeesuite.gateway.model.BizSystemPortal)1 ApiPermission (com.jeesuite.security.model.ApiPermission)1 InstanceFactory (com.jeesuite.spring.InstanceFactory)1 GenericApiRequest (com.jeesuite.springweb.client.GenericApiRequest)1 AppMetadataHolder (com.jeesuite.springweb.exporter.AppMetadataHolder)1 AppMetadata (com.jeesuite.springweb.model.AppMetadata)1 RequestContext (com.netflix.zuul.context.RequestContext)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1