Skip to content

Commit

Permalink
update jboot to newest
Browse files Browse the repository at this point in the history
  • Loading branch information
yangfuhai committed Sep 23, 2020
1 parent ebf8e61 commit c109251
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
10 changes: 4 additions & 6 deletions jpress-core/src/main/java/io/jpress/JPressCoreInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
import com.jfinal.template.Engine;
import io.jboot.aop.jfinal.JfinalHandlers;
import io.jboot.core.listener.JbootAppListenerBase;
import io.jboot.web.fixedinterceptor.FixedInterceptors;
import io.jpress.commons.utils.JPressJson;
import io.jpress.core.addon.AddonManager;
import io.jpress.core.addon.controller.AddonControllerProcesser;
import io.jpress.core.addon.handler.AddonHandlerProcesser;
import io.jpress.core.addon.interceptor.AddonInterceptorProcesser;
import io.jpress.core.install.InstallHandler;
import io.jpress.core.menu.MenuManager;
import io.jpress.core.support.ehcache.EhcacheManager;
Expand Down Expand Up @@ -80,10 +78,10 @@ public void onRouteConfig(Routes routes) {
routes.setClearAfterMapping(false);
}

@Override
public void onFixedInterceptorConfig(FixedInterceptors fixedInterceptors) {
fixedInterceptors.add(new AddonInterceptorProcesser());
}
// @Override
// public void onFixedInterceptorConfig(FixedInterceptors fixedInterceptors) {
// fixedInterceptors.add(new AddonInterceptorProcesser());
// }


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import io.jboot.Jboot;
import io.jboot.web.fixedinterceptor.FixedInterceptor;
import io.jboot.aop.InterceptorBuilder;
import io.jboot.aop.Interceptors;
import io.jboot.aop.annotation.AutoLoad;

import java.lang.reflect.Method;

public class AddonInterceptorProcesser implements FixedInterceptor {
@AutoLoad
public class AddonInterceptorProcesser implements Interceptor, InterceptorBuilder {

@Override
public void intercept(Invocation invocation) {
Expand All @@ -37,6 +40,13 @@ public void intercept(Invocation invocation) {
}
}

@Override
public void build(Class<?> serviceClass, Method method, Interceptors interceptors) {
if (Controller.class.isAssignableFrom(serviceClass)){
interceptors.add(this);
}
}


public static class AddonInvocation extends Invocation {

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<properties>
<jdk.version>1.8</jdk.version>
<jboot.version>3.4.3</jboot.version>
<jboot.version>3.5.1</jboot.version>
<jfinal-weixin.version>2.6</jfinal-weixin.version>
<jjwt.version>0.9.1</jjwt.version>
<logback.version>1.2.3</logback.version>
Expand Down

0 comments on commit c109251

Please sign in to comment.