@PostMapping("/add/book/novel") public ResponseEntity add(@RequestParam(name = "title") String title, @RequestParam(name = "author") String author, @RequestParam(name = "word_count") String wordCount, @RequestParam(name = "public_date") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date publicDate
Date publicDate 就会报上边的错,改为string就不报错
封装一个类,然后把这个
@DateTimeFormat
注解在字段上面
@DateTimeFormat private Date publicDate