-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
@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
Labels
enhancementNew feature or requestNew feature or request