-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
NEW
-
NEW
This code:
@Path("/rooms") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Transactional public class RoomResource { @GET public List<Room> getAllRooms() { return Room.listAll(Sort.by("name").and("id")); } @POST public Response add(Room room) { Room.persist(room); return Response.accepted(room).build(); } @DELETE @Path("{roomId}") public Response delete(@PathParam("roomId") Long roomId) { Room room = Room.findById(roomId); if (room == null) { return Response.status(Response.Status.NOT_FOUND).build(); } room.delete(); return Response.status(Response.Status.OK).build(); } }
can probably replaced by:
public interface RoomResource extends PanacheEntityResource<Room, Long> { }
See https://quarkus.io/guides/rest-data-panache
Same for Timeslot and Lesson. Probably not same for TimeTable.
Only applies to school timetabling I think (facility location doesn't use a database).