代码结构优化

修复123pan解析错误的问题#9
This commit is contained in:
qaiu
2023-08-10 01:38:20 +08:00
parent 8ffd35f2f0
commit aafbf05d34
20 changed files with 215 additions and 236 deletions

View File

@@ -7,6 +7,7 @@ import cn.qaiu.vx.core.verticle.ReverseProxyVerticle;
import cn.qaiu.vx.core.verticle.RouterVerticle;
import cn.qaiu.vx.core.verticle.ServiceVerticle;
import io.vertx.core.*;
import io.vertx.core.impl.launcher.commands.VersionCommand;
import io.vertx.core.json.JsonObject;
import io.vertx.core.shareddata.LocalMap;
import org.slf4j.Logger;
@@ -95,7 +96,7 @@ public final class Deploy {
System.out.printf(logoTemplete,
conf.getString("version_app"),
conf.getString("version_vertx"),
VersionCommand.getVersion(),
conf.getString("copyright"),
year
);

View File

@@ -12,8 +12,10 @@ import io.vertx.ext.web.RoutingContext;
public interface Interceptor {
default Handler<RoutingContext> doHandle() {
return this::handle;
return this::beforeHandle;
}
void handle(RoutingContext context);
void beforeHandle(RoutingContext context);
void afterHandle(RoutingContext context);
}

View File

@@ -70,11 +70,11 @@ public final class ReflectionUtil {
// 发现注解api层 没有继承父类时 这里反射一直有问题(Scanner SubTypesScanner was not configured)
// 因此这里需要手动配置各种Scanner扫描器 -- https://blog.csdn.net/qq_29499107/article/details/106889781
configurationBuilder.setScanners(
new SubTypesScanner(false), //允许getAllTypes获取所有Object的子类, 不设置为false则 getAllTypes 会报错.默认为true.
Scanners.SubTypes.filterResultsBy(s -> true), //允许getAllTypes获取所有Object的子类, 不设置为false则 getAllTypes 会报错.默认为true.
new MethodParameterNamesScanner(), //设置方法参数名称 扫描器,否则调用getConstructorParamNames 会报错
new MethodAnnotationsScanner(), //设置方法注解 扫描器, 否则getConstructorsAnnotatedWith,getMethodsAnnotatedWith 会报错
Scanners.MethodsAnnotated, //设置方法注解 扫描器, 否则getConstructorsAnnotatedWith,getMethodsAnnotatedWith 会报错
new MemberUsageScanner(), //设置 member 扫描器,否则 getMethodUsage 会报错, 不推荐使用,有可能会报错 Caused by: java.lang.ClassCastException: javassist.bytecode.InterfaceMethodrefInfo cannot be cast to javassist.bytecode.MethodrefInfo
new TypeAnnotationsScanner() //设置类注解 扫描器 ,否则 getTypesAnnotatedWith 会报错
Scanners.TypesAnnotated //设置类注解 扫描器 ,否则 getTypesAnnotatedWith 会报错
);
configurationBuilder.filterInputsBy(filterBuilder);