其他分享
首页 > 其他分享> > Feign接口传递Date参数,接收时前后 差14小时(Feign传时间遇到的坑,注意事项。)

Feign接口传递Date参数,接收时前后 差14小时(Feign传时间遇到的坑,注意事项。)

作者:互联网

直接上解决方法吧:

1、对于对象参数中有Date类型的,如果使用@SpringQueryMap 传对象,不要使用Date类型,使用String 来传时间。

2、如果使用Post方式,则使用@RequestBody注解来传递和接收。时间不会有问题。

3、如果通过 get传单个date参数,则需要使用 @DateTimeFormat提前格式化。

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @RequestParam(required = true) Date bookDate

 

标签:Feign,14,DateTimeFormat,参数,使用,Date,接收
来源: https://www.cnblogs.com/whl-jx911/p/15024056.html