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

当需要值到键的映射时,希望可以不需要在注解中指定 props 属性 #190

Closed
Createsequence opened this issue Jan 17, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Createsequence
Copy link
Collaborator

比如说,我配置了一个枚举容器:

@ContainerEnum(namespace = "resource_type", key = "code", value = "name")
@Getter
@RequiredArgsConstructor
public enum ResourceTypeEnum {
    // ... ...
}

该枚举容器 key 值为 code,而 value 为 name。

现在,我希望在容器中直接使用 name 替换 value,比如下面这个配置:

@AssembleResourceType(props = @Mapping)
@ApiModelProperty(value = "资源类型")
private String resourceType;

光秃秃的一个 @Mapping 看起来很突兀,因此建议在这种情况,干脆就不要指定 props 了。

@Createsequence Createsequence added the enhancement New feature or request label Jan 17, 2024
@Createsequence Createsequence added this to the release 2.5.0 milestone Jan 17, 2024
@Createsequence Createsequence self-assigned this Jan 17, 2024
Createsequence added a commit that referenced this issue Jan 17, 2024
Createsequence added a commit that referenced this issue Jan 17, 2024
Createsequence added a commit that referenced this issue Jan 17, 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

1 participant