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

datetime类型返回问题 #388

Closed
silveryMole opened this issue Apr 19, 2022 · 5 comments
Closed

datetime类型返回问题 #388

silveryMole opened this issue Apr 19, 2022 · 5 comments

Comments

@silveryMole
Copy link

大神,有个问题请教一下:
字段类型是datetime,格式yyyy-MM-dd HH:mm:ss
取全表数据,这个格式返回里
image
但是页面接到的是数组
image
请问这个是什么原因,要怎么设置

@TommyLemon
Copy link
Collaborator

TommyLemon commented Apr 19, 2022

应该是 fastjson 序列化 LocalDateTime 的问题,可以在 DemoSQLExecutor 重写
getValue,判断是这个类型,就转成对应格式的 String 或者 Time。
直接改父类 AbstractSQLExecutor 也行,顺便提个 Pull Request 贡献代码~

https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md
image

@silveryMole
Copy link
Author

OK解决了 感谢大神 有时间会提个 Pull Request

@MentosL
Copy link
Contributor

MentosL commented May 8, 2022

当前问题请问是否已经solved? 没有解决以及没人指派的话 我这边提交一个PR上去? @TommyLemon

@TommyLemon
Copy link
Collaborator

当前问题请问是否已经solved? 没有解决以及没人指派的话 我这边提交一个PR上去? @TommyLemon

还没有,可以的,非常感谢~

@TommyLemon
Copy link
Collaborator

感谢 @MentosL 修复了这个 bug

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

No branches or pull requests

3 participants