Skip to content

Commit

Permalink
restore RequestParam value
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellone committed Apr 25, 2024
1 parent 3570095 commit c828c19
Show file tree
Hide file tree
Showing 29 changed files with 81 additions and 81 deletions.
Expand Up @@ -57,8 +57,8 @@ public class AdminConfigurationController {

@GetMapping("/admin/configuration/payment/{provider}/connect/{orgId}")
public String oAuthRedirectToAuthorizationURL(Principal principal,
@PathVariable Integer orgId,
@PathVariable String provider,
@PathVariable("orgId") Integer orgId,
@PathVariable("provider") String provider,
HttpSession session) {
if(CONNECT_PROVIDERS.contains(provider) && userManager.isOwnerOfOrganization(userManager.findUserByUsername(principal.getName()), orgId)) {
var connectURL = getConnector(provider).getConnectURL(orgId);
Expand All @@ -72,8 +72,8 @@ public String oAuthRedirectToAuthorizationURL(Principal principal,

@GetMapping({ STRIPE_CONNECT_REDIRECT_PATH, MOLLIE_CONNECT_REDIRECT_PATH })
public String authorize(Principal principal,
@RequestParam String state,
@RequestParam(required = false) String code,
@RequestParam("state") String state,
@RequestParam(value = "code", required = false) String code,
@RequestParam(value = "error", required = false) String errorCode,
@RequestParam(value = "error_description", required = false) String errorDescription,
HttpServletRequest request,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/alfio/controller/AuthenticationController.java
Expand Up @@ -77,8 +77,8 @@ public ResponseEntity<UserStatus> authenticationStatus(Principal principal,
}

@GetMapping("/authentication")
public void getLoginPage(@RequestParam(required = false) String failed,
@RequestParam(required = false) String recaptchaFailed,
public void getLoginPage(@RequestParam(value="failed", required = false) String failed,
@RequestParam(value = "recaptchaFailed", required = false) String recaptchaFailed,
Model model,
Principal principal,
HttpServletRequest request,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/alfio/controller/IndexController.java
Expand Up @@ -208,7 +208,7 @@ public ResponseEntity<String> replyToK8s() {
public void replyToIndex(@PathVariable(value = EVENT_SHORT_NAME, required = false) String eventShortName,
@PathVariable(required = false) String subscriptionId,
@RequestHeader(value = "User-Agent", required = false) String userAgent,
@RequestParam(required = false) String lang,
@RequestParam(value = "lang", required = false) String lang,
ServletWebRequest request,
HttpServletResponse response,
HttpSession session) throws IOException {
Expand Down
Expand Up @@ -141,7 +141,7 @@ public void swapAdditionalFieldPosition(@PathVariable PurchaseContext.PurchaseCo
public void setAdditionalFieldPosition(@PathVariable PurchaseContext.PurchaseContextType purchaseContextType,
@PathVariable String publicIdentifier,
@PathVariable long id,
@RequestParam int newPosition,
@RequestParam("newPosition") int newPosition,
Principal principal) {
//
accessService.checkPurchaseContextOwnershipAndTicketAdditionalFieldIds(principal, purchaseContextType, publicIdentifier, Set.of(id));
Expand Down
Expand Up @@ -78,8 +78,8 @@ public AdminPaymentsApiController(PurchaseContextSearchManager purchaseContextSe
@GetMapping("/{purchaseContextType}/{publicIdentifier}/list")
PageAndContent<List<ReservationPaymentDetail>> getPaymentsForPurchaseContext(@PathVariable PurchaseContext.PurchaseContextType purchaseContextType,
@PathVariable String publicIdentifier,
@RequestParam(required = false) Integer page,
@RequestParam(required = false) String search,
@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "search", required = false) String search,
Principal principal) {
return purchaseContextManager.findBy(purchaseContextType, publicIdentifier)
.map(purchaseContext -> {
Expand Down Expand Up @@ -112,7 +112,7 @@ ResponseEntity<String> updateTransactionData(@PathVariable PurchaseContext.Purch
@GetMapping("/{purchaseContextType}/{publicIdentifier}/download")
void exportPayments(@PathVariable PurchaseContext.PurchaseContextType purchaseContextType,
@PathVariable String publicIdentifier,
@RequestParam(required = false) String search,
@RequestParam(value = "search", required = false) String search,
Principal principal,
HttpServletResponse response) throws IOException {
var purchaseContextOptional = purchaseContextManager.findBy(purchaseContextType, publicIdentifier);
Expand Down
Expand Up @@ -78,9 +78,9 @@ public TicketReservation.TicketReservationStatus[] getAllStatus(@PathVariable Pu
@GetMapping("/{purchaseContextType}/{publicIdentifier}/reservations/list")
public PageAndContent<List<TicketReservation>> findAll(@PathVariable PurchaseContextType purchaseContextType,
@PathVariable String publicIdentifier,
@RequestParam(required = false) Integer page,
@RequestParam(required = false) String search,
@RequestParam(required = false) List<TicketReservation.TicketReservationStatus> status,
@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "search", required = false) String search,
@RequestParam(value = "status", required = false) List<TicketReservation.TicketReservationStatus> status,
Principal principal) {

return purchaseContextManager.findBy(purchaseContextType, publicIdentifier)
Expand Down Expand Up @@ -254,17 +254,17 @@ public Result<TransactionAndPaymentInfo> getPaymentInfo(@PathVariable PurchaseCo
@PostMapping("/{purchaseContextType}/{publicIdentifier}/{reservationId}/cancel")
public Result<Boolean> removeReservation(@PathVariable PurchaseContextType purchaseContextType, @PathVariable String publicIdentifier,
@PathVariable String reservationId,
@RequestParam boolean refund,
@RequestParam(defaultValue = "false") boolean notify,
@RequestParam(defaultValue = "false") boolean issueCreditNote,
@RequestParam("refund") boolean refund,
@RequestParam(value = "notify", defaultValue = "false") boolean notify,
@RequestParam(value = "issueCreditNote", defaultValue = "false") boolean issueCreditNote,
Principal principal) {
accessService.checkReservationMembership(principal, purchaseContextType, publicIdentifier, reservationId);
return adminReservationManager.removeReservation(purchaseContextType, publicIdentifier, reservationId, refund, notify, issueCreditNote, principal.getName());
}

@PostMapping("/{purchaseContextType}/{publicIdentifier}/{reservationId}/credit")
public Result<Boolean> creditReservation(@PathVariable PurchaseContextType purchaseContextType, @PathVariable String publicIdentifier, @PathVariable String reservationId, @RequestParam boolean refund,
@RequestParam(defaultValue = "false") boolean notify,
public Result<Boolean> creditReservation(@PathVariable PurchaseContextType purchaseContextType, @PathVariable String publicIdentifier, @PathVariable String reservationId, @RequestParam("refund") boolean refund,
@RequestParam(value = "notify", defaultValue = "false") boolean notify,
Principal principal) {
accessService.checkReservationOwnership(principal, purchaseContextType, publicIdentifier, reservationId);
adminReservationManager.creditReservation(purchaseContextType, publicIdentifier, reservationId, refund, notify, principal.getName());
Expand Down
Expand Up @@ -117,7 +117,7 @@ public List<WaitingQueueSubscription> loadAllSubscriptions(@PathVariable String

@GetMapping("/download")
public void downloadAllSubscriptions(@PathVariable String eventName,
@RequestParam(defaultValue = "excel") String format,
@RequestParam(name = "format", defaultValue = "excel") String format,
Principal principal, HttpServletResponse response) throws IOException {
accessService.checkEventOwnership(principal, eventName);
var event = eventManager.getSingleEvent(eventName, principal.getName());
Expand Down
Expand Up @@ -37,7 +37,7 @@ public class AttendeeBulkImportApiController {
@PostMapping("")
public Result<String> createReservations(@PathVariable String eventName,
@RequestBody AdminReservationModification body,
@RequestParam(defaultValue = "false", required = false) boolean oneReservationPerAttendee,
@RequestParam(name="oneReservationPerAttendee", defaultValue = "false", required = false) boolean oneReservationPerAttendee,
Principal principal) {
accessService.checkEventOwnership(principal, eventName);
return requestManager.scheduleReservations(eventName, body, !oneReservationPerAttendee, principal.getName());
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/alfio/controller/api/admin/CheckInApiController.java
Expand Up @@ -74,13 +74,13 @@ public static class TicketIdentifierCode {
}

@GetMapping("/check-in/{eventId}/ticket/{ticketIdentifier}")
public TicketAndCheckInResult findTicketWithUUID(@PathVariable int eventId, @PathVariable String ticketIdentifier, @RequestParam String qrCode, Principal principal) {
public TicketAndCheckInResult findTicketWithUUID(@PathVariable int eventId, @PathVariable String ticketIdentifier, @RequestParam("qrCode") String qrCode, Principal principal) {
accessService.checkEventTicketIdentifierMembership(principal, eventId, ticketIdentifier, AccessService.CHECKIN_ROLES);
return checkInManager.evaluateTicketStatus(eventId, ticketIdentifier, Optional.ofNullable(qrCode));
}

@GetMapping("/check-in/event/{eventName}/ticket/{ticketIdentifier}")
public TicketAndCheckInResult findTicketWithUUID(@PathVariable String eventName, @PathVariable String ticketIdentifier, @RequestParam String qrCode, Principal principal) {
public TicketAndCheckInResult findTicketWithUUID(@PathVariable String eventName, @PathVariable String ticketIdentifier, @RequestParam("qrCode") String qrCode, Principal principal) {
accessService.checkEventTicketIdentifierMembership(principal, eventName, ticketIdentifier, AccessService.CHECKIN_ROLES);
return checkInManager.evaluateTicketStatus(eventName, ticketIdentifier, Optional.ofNullable(qrCode));
}
Expand All @@ -104,7 +104,7 @@ public TicketAndCheckInResult checkIn(@PathVariable int eventId,
public TicketAndCheckInResult checkIn(@PathVariable String eventName,
@PathVariable String ticketIdentifier,
@RequestBody TicketCode ticketCode,
@RequestParam(required = false) String offlineUser,
@RequestParam(value = "offlineUser", required = false) String offlineUser,
Principal principal) {
accessService.checkEventTicketIdentifierMembership(principal, eventName, ticketIdentifier, AccessService.CHECKIN_ROLES);
String username = principal.getName();
Expand All @@ -115,8 +115,8 @@ public TicketAndCheckInResult checkIn(@PathVariable String eventName,
@PostMapping("/check-in/event/{eventName}/bulk")
public Map<String, TicketAndCheckInResult> bulkCheckIn(@PathVariable String eventName,
@RequestBody List<TicketIdentifierCode> ticketIdentifierCodes,
@RequestParam(required = false) String offlineUser,
@RequestParam(required = false, defaultValue = "false") boolean forceCheckInPaymentOnSite,
@RequestParam(value = "offlineUser", required = false) String offlineUser,
@RequestParam(value = "forceCheckInPaymentOnSite", required = false, defaultValue = "false") boolean forceCheckInPaymentOnSite,
Principal principal) {
accessService.checkEventMembership(principal, eventName, AccessService.CHECKIN_ROLES);
String username = principal.getName();
Expand Down Expand Up @@ -171,7 +171,7 @@ public ResponseEntity<Boolean> revertCheckIn(@PathVariable String eventName,
public TicketAndCheckInResult confirmOnSitePayment(@PathVariable String eventName,
@PathVariable String ticketIdentifier,
@RequestBody TicketCode ticketCode,
@RequestParam(required = false) String offlineUser,
@RequestParam(value = "offlineUser", required = false) String offlineUser,
Principal principal) {
accessService.checkEventTicketIdentifierMembership(principal, eventName, ticketIdentifier, AccessService.CHECKIN_ROLES);
String username = principal.getName();
Expand All @@ -195,7 +195,7 @@ public OnSitePaymentConfirmation confirmOnSitePayment(@PathVariable int eventId,

@GetMapping("/check-in/{eventId}/ticket-identifiers")
public List<Integer> findAllIdentifiersForAdminCheckIn(@PathVariable int eventId,
@RequestParam(required = false) Long changedSince,
@RequestParam(value = "changedSince", required = false) Long changedSince,
HttpServletResponse response,
Principal principal) {
accessService.checkEventMembership(principal, eventId, AccessService.CHECKIN_ROLES);
Expand All @@ -205,8 +205,8 @@ public List<Integer> findAllIdentifiersForAdminCheckIn(@PathVariable int eventId

@GetMapping("/check-in/event/{publicIdentifier}/attendees")
public ResponseEntity<AttendeeSearchResults> searchAttendees(@PathVariable String publicIdentifier,
@RequestParam(required = false) String query,
@RequestParam(required = false, defaultValue = "0") int page,
@RequestParam(value = "query", required = false) String query,
@RequestParam(value = "page", required = false, defaultValue = "0") int page,
Principal principal) {
accessService.checkEventMembership(principal, publicIdentifier, AccessService.CHECKIN_ROLES);
if (StringUtils.isBlank(query) || StringUtils.isBlank(publicIdentifier)) {
Expand Down Expand Up @@ -239,7 +239,7 @@ public ResponseEntity<LabelLayout> getLabelLayoutForEvent(@PathVariable String e

@GetMapping("/check-in/{eventName}/offline-identifiers")
public List<Integer> getOfflineIdentifiers(@PathVariable String eventName,
@RequestParam(required = false) Long changedSince,
@RequestParam(value = "changedSince", required = false) Long changedSince,
HttpServletResponse resp,
Principal principal) {
var event = accessService.checkEventMembership(principal, eventName, AccessService.CHECKIN_ROLES);
Expand Down
Expand Up @@ -275,8 +275,8 @@ public ResponseEntity<Boolean> regenerateInvoices(@PathVariable Integer eventId,
}

@PutMapping("/generate-tickets-for-subscriptions")
public ResponseEntity<Boolean> generateTicketsForSubscriptions(@RequestParam(required = false) Integer eventId,
@RequestParam(required = false) Integer organizationId,
public ResponseEntity<Boolean> generateTicketsForSubscriptions(@RequestParam(value = "eventId", required = false) Integer eventId,
@RequestParam(value = "organizationId", required = false) Integer organizationId,
Principal principal) {
boolean admin = RequestUtils.isAdmin(principal);
Map<String, Object> jobMetadata = null;
Expand Down
Expand Up @@ -54,15 +54,15 @@ public String handleException(IllegalStateException ex) {

@PostMapping("/preview")
public Map<String, Object> preview(@PathVariable String eventName,
@RequestParam(required = false) Integer categoryId,
@RequestParam(required = false, value = "categoryId") Integer categoryId,
@RequestBody List<MessageModification> messageModifications, Principal principal) {
accessService.checkEventOwnership(principal, eventName);
return customMessageManager.generatePreview(eventName, Optional.ofNullable(categoryId), messageModifications, principal.getName());
}

@PostMapping("/send")
public void send(@PathVariable String eventName,
@RequestParam(required = false) Integer categoryId,
@RequestParam(required = false, value = "categoryId") Integer categoryId,
@RequestBody List<MessageModification> messageModifications,
Principal principal) {
accessService.checkEventOwnership(principal, eventName);
Expand Down

0 comments on commit c828c19

Please sign in to comment.