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

使用容器提供者来获取容器时,希望也能够支持自动合并对相同容器的查询 #309

Open
falcon-jin opened this issue Jun 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@falcon-jin
Copy link

falcon-jin commented Jun 14, 2024

 @Data
    @RequiredArgsConstructor
    public static class UserInfo {
        // 其他属性......

        @Assemble(
                containerProvider = "dictContainerProvider",
                container = "sex-dict", // 总是查询固定的字典类型
                prop = "sexName"
        )
        private final Integer sex;
        private String sexName;

        @Assemble(
                containerProvider = "dictContainerProvider",
                container = "status-dict", // 总是查询固定的字典类型
                prop = "statusName"
        )
        private final String status;
        private String statusName;
    }

比如上面的类,有两个字段用到字典,字典就是常用的后台管理系统的字典管理,对 UserInfo user = new UserInfo("2","1") 这个对象执行填充后,sexName 为“男” statusName 为启“用”。

目前有一个问题,就是执行填充时,由于 dictContainerProvider 给出的 Container 不是同一个,所以最终会分别查两次库。不过,实际上两个容器最终会调用同一个接口,希望在后续的版本可以只用一次接口调用把两个字典类型的数据一次都查询出来。

@Createsequence Createsequence added the enhancement New feature or request label Jun 14, 2024
@Createsequence Createsequence added this to the release 2.10.0 milestone Jun 14, 2024
@Createsequence Createsequence changed the title 字典翻译 使用容器提供者来获取容器时,希望也能够支持自动合并对相同容器的查询 Jun 15, 2024
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

2 participants