【发布时间】:2019-06-30 06:50:40
【问题描述】:
我一直在做 jhipster 的一个项目。到目前为止,我正在努力使用休息 api 来获取当前日期的表(约会)的记录。该代码没有错误但没有输出任何内容。(我的表中也有数据)。
`GET /appointmentspending : 获取所有状态为pending的约会。
@param filter the filter of the request
@return the ResponseEntity with status 200 (OK) and the list of appointments in body
/
@GetMapping("/searchappointment")
@Timed
public List<Appointment> getAllAppointmentOfToday(@RequestParam(required = false) String filter) {
//LocalDate localDate = LocalDate.now();
// System.out.println("localDate");
log.debug("REST request to get all Appointments with status pending");
//LocalDate date = '2019-02-06'
return StreamSupport
.stream(appointmentRepository.findAll().spliterator(), false)
.filter(appointment -> appointment.getLastvisited() == LocalDate.now())
.collect(Collectors.toList());
}`
【问题讨论】:
标签: mysql rest spring-boot jpa jhipster