0
私のリソースは今まで正常に動作していました。そこに@QueryParamを追加しました。私はuriにクエリのparamを書かずにリクエストするとうまくいきます。 uri 404コードの応答にクエリのパラメータを書き込んだ後。RESTful APIリソースが追加されたときに404が返される@QueryParam
@GET
@Path("{id}/appointments")
@UnitOfWork
@JsonView(Views.DoctorView.class)
public List<?> getDoctorAppointments(@Auth LoggedUser loggedUser,
@QueryParam("date") Date date,
@QueryParam("timePeriod") TimePeriod timePeriod,
@PathParam("id") int id
) {
if(date != null && (timePeriod == null || timePeriod.equals(TimePeriod.TODAY))){
return appointmentDAO.getDoctorsAppointmentsByDate(id, date);
}
if(date != null && timePeriod.equals(TimePeriod.WEEK)){
return appointmentDAO.getDoctorsNumberOfAppointmentsForWeek(date, id);
}
return appointmentDAO.getAppointments(id, UserType.DOCTOR);
}
私はすでにそれを解決しました。問題は、日付クエリのparamがjavaのutil.Dateであることでした。私はそれを文字列に変更し、それをキャストし、今すぐ動作します:) –