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

"message": "接口 [/user/add] 内部错误,请联系管理员"bug已解决 #213

Open
HeiKeJi6 opened this issue Mar 26, 2020 · 2 comments

Comments

@HeiKeJi6
Copy link

HeiKeJi6 commented Mar 26, 2020

@PostMapping("/add")
public Result add(@requestbody User user) {
System.out.println(user);
userService.save(user);
return ResultGenerator.genSuccessResult();
}

加上@requestbody

终于找错错误的原因了,作者的框架没有错,是我自己registerDate参数没有传对,import java.util.Date的默认格式是2020/03/26,大家要注意了!另外感谢作者的源码!有个问题,不知道mapper.xml的sql语句在哪里

@HeiKeJi6
Copy link
Author

HeiKeJi6 commented Mar 28, 2020 via email

@hhqiwei
Copy link

hhqiwei commented Mar 31, 2020

我的也和你报错一样,但是我不需要加@requestbody,而是registerDate数据改为{"key":"registerDate","value":"2020/03/31"}就行了,为了避免中文乱码,在连接数据库的语句后面加上?useUnicode=true&characterEncoding=utf-8
image

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

2 participants