Skip to content

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

Description

@falcon-jin
 @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 不是同一个,所以最终会分别查两次库。不过,实际上两个容器最终会调用同一个接口,希望在后续的版本可以只用一次接口调用把两个字典类型的数据一次都查询出来。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions