feat(processor): 支持在注解上使用 @AutoMapping- 新增处理注解上存在 @AutoMapping 的逻辑#114
Merged
linpeilie merged 1 commit intolinpeilie:mainfrom Nov 17, 2024
Merged
feat(processor): 支持在注解上使用 @AutoMapping- 新增处理注解上存在 @AutoMapping 的逻辑#114linpeilie merged 1 commit intolinpeilie:mainfrom
linpeilie merged 1 commit intolinpeilie:mainfrom
Conversation
- 修改 @automapping 注解,增加对 ElementType.ANNOTATION_TYPE 的支持 可以实现如下效果: //新增dto使用注解,自动将当前用户映射到创建人字段 @automapping(source = "operatorUserId", target = "createBy") public @interface CreateMapper { } @automapping(source = "operatorUserId", target = "createBy") // 更新dto使用注解,自动将当前用户映射到updateBy字段 @automapping(source = "operatorUserId", target = "updateBy") public @interface UpdateMapper{ } 这样就可以将基类中的operatorUserId根据dto的不同,映射到对应的字段
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Owner
|
看起来是个好主意,等我有空看一下 |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这样就可以将基类dto中的operatorUserId根据dto的不同,映射到对应的不同字段上面