Fixed WebAPI registration

This commit is contained in:
Rsl1122 2017-09-26 20:01:08 +03:00
parent 5506e66e35
commit 7dcbac3fa7
2 changed files with 23 additions and 11 deletions

View File

@ -54,18 +54,24 @@ public class WebServer {
} }
private void registerWebAPIs() { private void registerWebAPIs() {
webAPI.registerNewAPI(new AnalyzeWebAPI()); webAPI.registerNewAPI(
webAPI.registerNewAPI(new ConfigurationWebAPI()); new AnalysisReadyWebAPI(),
webAPI.registerNewAPI(new InspectWebAPI()); new AnalyzeWebAPI(),
webAPI.registerNewAPI(new IsOnlineWebAPI()); new ConfigurationWebAPI(),
webAPI.registerNewAPI(new PingWebAPI()); new InspectWebAPI(),
webAPI.registerNewAPI(new RequestInspectPluginsTabBukkitWebAPI()); new IsOnlineWebAPI(),
new RequestInspectPluginsTabBukkitWebAPI(),
new PingWebAPI()
);
webAPI.registerNewAPI(new IsCachedWebAPI()); webAPI.registerNewAPI(
webAPI.registerNewAPI(new PostHtmlWebAPI()); new IsCachedWebAPI(),
webAPI.registerNewAPI(new PostInspectPluginsTabWebAPI()); new PostHtmlWebAPI(),
webAPI.registerNewAPI(new RequestPluginsTabWebAPI()); new PostInspectPluginsTabWebAPI(),
webAPI.registerNewAPI(new PostOriginalBukkitSettingsWebAPI()); new PostNetworkPageContentWebAPI(),
new PostOriginalBukkitSettingsWebAPI(),
new RequestPluginsTabWebAPI()
);
} }
/** /**

View File

@ -21,6 +21,12 @@ public class WebAPIManager {
registry = new HashMap<>(); registry = new HashMap<>();
} }
public void registerNewAPI(WebAPI... api) {
for (WebAPI webAPI : api) {
registerNewAPI(webAPI);
}
}
public void registerNewAPI(WebAPI api) { public void registerNewAPI(WebAPI api) {
registry.put(api.getClass().getSimpleName().toLowerCase(), api); registry.put(api.getClass().getSimpleName().toLowerCase(), api);
} }