――Ich poste es als mein eigenes Memo.
URL:http://localhost:8080/date/2018-02-02/2019-01-01
Wichtiger Cousin
Nr. 1. Passen Sie das URL-Muster an (diesmal: 2018-02-02)
@RestController
@RequestMapping(value = "/date/{from}/{to}", method = RequestMethod.GET)
public class CsvController {
@GetMapping
public String get(@DateTimeFormat(pattern = "yyyy-MM-dd") @PathVariable LocalDate from,
@DateTimeFormat(pattern = "yyyy-MM-dd") @PathVariable LocalDate to) {
return "fromDate:" + from.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
+ "toDate:" + to.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
}
Recommended Posts