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

通用字段 diff 自定义 function 问题 #165

Open
mgzu opened this issue Aug 16, 2024 · 0 comments
Open

通用字段 diff 自定义 function 问题 #165

mgzu opened this issue Aug 16, 2024 · 0 comments

Comments

@mgzu
Copy link
Contributor

mgzu commented Aug 16, 2024

需求

  • 对于使用枚举常量的字段,能否扩展通用的 diff function,可以直接从枚举取值,而不需要每个枚举自定义一个 function
  • 对于配置的字典表,能否扩展通用的 diff function,可以直接查询出对应的字典值,而不需要每个不同的字典项自定义一个 function

问题

当前框架的 function,字段 diff 与 @LogRecord 注解都是使用的 IFunctionService,但是在实际场景下还是有些不同
当前自定义 function 只传入参数值,而无法获取其他信息(LogRecordContext 无法获取字段信息),那么对于上方的两个需求就没办法很好实现
如果自定义 function 在字段 diff 时能够传入 DiffNode,那么可以通过 DiffNode 获取字段上自定义的注解,通过自定义注解,字段 diff 的扩展性将会大大加强

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant