Пример #1
0
 @RequestMapping(value = "/paymentProxies/{organizationId}", method = GET)
 @ResponseStatus(HttpStatus.OK)
 public List<PaymentManager.PaymentMethod> getPaymentProxies(
     @PathVariable("organizationId") int organizationId, Principal principal) {
   return userManager
       .findUserOrganizations(principal.getName())
       .stream()
       .filter(o -> o.getId() == organizationId)
       .findFirst()
       .map(o -> paymentManager.getPaymentMethods(o.getId()))
       .orElse(Collections.emptyList());
 }
Пример #2
0
 @RequestMapping("/events/{eventName}/additional-field")
 public List<TicketFieldConfigurationAndAllDescriptions> getAllAdditionalField(
     @PathVariable("eventName") String eventName) {
   final Map<Integer, List<TicketFieldDescription>> descById =
       ticketFieldRepository
           .findDescriptions(eventName)
           .stream()
           .collect(Collectors.groupingBy(TicketFieldDescription::getTicketFieldConfigurationId));
   return ticketFieldRepository
       .findAdditionalFieldsForEvent(eventName)
       .stream()
       .map(
           field ->
               new TicketFieldConfigurationAndAllDescriptions(
                   field, descById.getOrDefault(field.getId(), Collections.emptyList())))
       .collect(Collectors.toList());
 }