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

Operator 接口支持基于 @AutoOperate 注解的自动填充 #185

Closed
Createsequence opened this issue Jan 13, 2024 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Createsequence
Copy link
Collaborator

Createsequence commented Jan 13, 2024

根据用户反映,目前可能存在一种情况,即用户有复数的方法需要支持自动填充,但是这些方法的填充配置完全相同,在不便/不希望反复配置的前提下,希望能有一个更优雅的方式复用填充方法上的配置。

按目前的做法,可以考虑基于 Operator 接口做一个扩展,即基于现有的组件直接提供一个新的代理方法工厂去支持类似这样的效果:

@OperatorInterface
public interface OperatorInterface {

    @AutoOperate(type = Foo.class)
    void fill(Object parameter);
}

甚至,进一步的,在不需要指定类型和执行器的情况下,练 @AutoOperate 注解都不需要:

@OperatorInterface
public interface OperatorInterface {

    // 默认即按参数类型进行填充
    void fill(Foo parameter);
}
@Createsequence Createsequence added the enhancement New feature or request label Jan 13, 2024
@Createsequence Createsequence added this to the release 2.4.0 milestone Jan 13, 2024
@Createsequence Createsequence self-assigned this Jan 13, 2024
@Createsequence
Copy link
Collaborator Author

see #187

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