参数直接跟在url上面用@DateTimeFormat接收

参数写在实体类中 用@JsonFormat接收

注意: pattern 中的表达式要和接受的数据类型格式一致。不然会报错。例如表达式是 yyyy-MM-dd 就只能匹配LocalDate ,不能用 LocalDateTime去接收。即使LocalDateTime是更细化的时间类型。
注意: pattern 中的表达式要和接受的数据类型格式一致。不然会报错。例如表达式是 yyyy-MM-dd 就只能匹配LocalDate ,不能用 LocalDateTime去接收。即使LocalDateTime是更细化的时间类型。