com.fastchar.systemtool.FastSystemToolWeb Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastchar-systemtool Show documentation
Show all versions of fastchar-systemtool Show documentation
FastChar-SystemTool is a FastChar-ExtJs plugin.
package com.fastchar.systemtool;
import com.fastchar.core.FastEngine;
import com.fastchar.interfaces.IFastWebRun;
import com.fastchar.systemtool.interceptor.FastSystemToolAfterInterceptor;
import com.fastchar.systemtool.provider.*;
/**
* @author 沈建(Janesen)
* @date 2021/6/3 15:15
*/
public class FastSystemToolWeb implements IFastWebRun {
@Override
public void onInit(FastEngine engine) throws Exception {
engine.getOverrides()
.add(FastExceptionProvider.class)
.add(FastBaseMenuProvider.class)
.add(FastJobMenuProvider.class);
}
@Override
public void onDestroy(FastEngine engine) throws Exception {
}
@Override
public void onRun(FastEngine engine) throws Exception {
FastSystemToolConfig config = engine.getConfig(FastSystemToolConfig.class);
if (config.isLogActionRequest() && config.getLogActionRequestUrlPatterns().size() > 0) {
engine.getInterceptors()
.addAfter(FastSystemToolAfterInterceptor.class,
config.getLogActionRequestUrlPatterns().toArray(new String[]{}));
}
if (config.isLogSql()) {
engine.getOverrides()
.add(FastSqlListener.class);
}
if (config.isLogHttp()) {
if (engine.getFindClass().test("com.fastchar.http.core.FastHttpRequest")) {
engine.getOverrides()
.add(FastHttpListener.class);
}
}
if (config.isLogSelenium()) {
if (engine.getFindClass().test("com.fastchar.selenium.FastSeleniumConfig")) {
engine.getOverrides()
.add(FastSeleniumListener.class);
}
}
}
}