Skip to content
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

支持直接通过 Crane4jGlobalConfiguration 获取 OperateTemplate #172

Closed
Createsequence opened this issue Oct 12, 2023 · 0 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@Createsequence
Copy link
Collaborator

Createsequence commented Oct 12, 2023

在非 spring 环境中,需要通过下述代码手动创建 OperateTemplate

OperateTemplate template = new OperateTemplate(
    configuration.getBeanOperationsParser(BeanOperationParser.class),
    configuration.getBeanOperationExecutor(BeanOperationExecutor.class),
    configuration.getTypeResolver()
);

作为需要直接与用户打交道的类,无法直接获取一个默认示例,而还需要手动创建,这显然并不合理。

因此,希望直接 Crane4jGlobalConfiguration 直接提供一个 getOperateTemplate 的 API 用于获取默认的示例。

此外,在非 spring 环境下,很多默认的组件实际上都需要手动创建,可考虑一下在 SimpleCrane4jGlobalConfiguration中——注意,不是 Crane4jGlobalConfiguration 接口中——额外提供一些 API,用于创建并获取这些组件。比如:

  • 操作者接口的代理工厂 OperatorProxyMethodFactory;
  • 自动填充功能的相关辅助类 AutoOperateAnnotatedElementResolver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant