Lab#RE04-2: Spring Boot & ReactJS

React

fig 1

React call end point

fig 2

Check endpoint

fig 3

spring Boot

fig 4

Source code

Example Queries in spring data MongoDB

public interface ReservationRepository extends MongoRepository<Reservation,String>{
  @Query("{ 'idUser' : ?0 }")
  List<Reservation> findByIdUser(Integer idUser);
  @Query("{ 'accepted' : ?0 }")
  List<Reservation> findByAccepted(boolean accepted);
  @Query("{'dateStart' :{'$gte':?0, '$lt':?1}}")
  List<Reservation> getAllReservationsByDate(Date dateFrom,Date dateTo);

}