Ejemplo n.º 1
0
 @RequestMapping(value = "/events/{eventName}/pending-payments")
 public List<SerializablePair<TicketReservation, OrderSummary>> getPendingPayments(
     @PathVariable("eventName") String eventName, Principal principal) {
   return ticketReservationManager
       .getPendingPayments(
           eventStatisticsManager.getSingleEventWithStatistics(eventName, principal.getName()))
       .stream()
       .map(SerializablePair::fromPair)
       .collect(Collectors.toList());
 }
Ejemplo n.º 2
0
 @RequestMapping(value = "/events/{name}", method = GET)
 public Map<String, Object> getSingleEvent(
     @PathVariable("name") String eventName, Principal principal) {
   Map<String, Object> out = new HashMap<>();
   final String username = principal.getName();
   final EventWithStatistics event =
       eventStatisticsManager.getSingleEventWithStatistics(eventName, username);
   out.put("event", event);
   out.put("organization", eventManager.loadOrganizer(event.getEvent(), username));
   return out;
 }