Skip to content

[问题咨询 - 5.1.0版本] 如何重写AbstractParser类中的getMaxQueryDepth()方法?我需要修改这个方法返回的数值大小 #812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AwenJackson opened this issue Apr 18, 2025 · 1 comment

Comments

@AwenJackson
Copy link
Contributor

Description

Image
@TommyLemon 我这边新建了一个MyAPIJSONParser类继承了APIJSONParser,虽然设置了getMaxQueryDepth数值,但是在上图运行的时候还是没有生效,依旧使用的是AbstractParser类中的getMaxQueryDepth方法获取当前类中的MAX_QUERY_DEPTH数值

Image

Image

@TommyLemon
Copy link
Collaborator

TommyLemon commented Apr 19, 2025

APIJSON 相关自定义解析类需要注册后才会使用
https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/boot/DemoApplication.java#L161-L189

    // 使用本项目的自定义处理类
    APIJSONApplication.DEFAULT_APIJSON_CREATOR = new APIJSONCreator<Long>() {

      @Override
      public Parser<Long> createParser() {
        return new DemoParser();
      }

      @Override
      public FunctionParser createFunctionParser() {
        return new DemoFunctionParser();
      }

      @Override
      public Verifier<Long> createVerifier() {
        return new DemoVerifier();
      }

      @Override
      public SQLConfig createSQLConfig() {
        return new DemoSQLConfig();
      }

      @Override
      public SQLExecutor createSQLExecutor() {
        return new DemoSQLExecutor();
      }

    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants