use of com.remswork.project.alice.model.Schedule in project classify-system by anverliedoit.
the class ScheduleResource method getScheduleListByTeacherId.
@GET
@Path("1")
public Response getScheduleListByTeacherId(@QueryParam("teacherId") long teacherId) {
try {
ScheduleResourceLinks resourceLinks = new ScheduleResourceLinks(uriInfo);
Set<Schedule> scheduleSet = scheduleService.getScheduleListByTeacherId(teacherId);
for (Schedule schedule : scheduleSet) schedule.addLink(resourceLinks.self(schedule.getId()));
GenericEntity<Set<Schedule>> entity = new GenericEntity<Set<Schedule>>(scheduleSet) {
};
return Response.status(Response.Status.OK).entity(entity).build();
} catch (ScheduleException e) {
e.printStackTrace();
Message message = new Message(404, "Not Found", e.getMessage());
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
}
}
Aggregations