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

基于枚举类做通用转换器遇到的问题 #4048

Open
yexinSama opened this issue Nov 13, 2024 · 0 comments
Open

基于枚举类做通用转换器遇到的问题 #4048

yexinSama opened this issue Nov 13, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@yexinSama
Copy link

目前存在一个需求,想要通过一个通用枚举转换器,来对导出的枚举类型转换为字符串:
image

如上图所示,若将该转换器注册进去,由于enum是所有枚举的超类,这里会存在map映射问题,导致找不到转换器;
于是想到使用@ExcelProperty 的convert来做类型转换,但是导出需求要求动态列(静态列公式计算出来的列,这一部分是前端传入),
所以在设置表头的时候是拼接了动态列的,如果要使用@ExcelProperty需要head写入对应class,这又会导致异常(由于实际表头和类的静态表头不一致)
image

所以在此想要咨询下有没有方法可以完成这个枚举类的通用转换器

@yexinSama yexinSama added the help wanted Extra attention is needed label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant