Spring Boot GET请求使用Date接收时间戳
@GetMapping("/get")
public String get(Studert student){
return 'student';
}
public class Studert {
private Date birthday;
}
请求:localhost:8080/get?birthday=1611647725682
结果:springboot会将birthday当作String处理,然后报错。
解决方法: 对应属性的set方法中做转换处理。
public class
原创
2021-01-26 15:59:08 ·
3014 阅读 ·
0 评论