diff --git a/src/main/java/alfio/controller/ReservationController.java b/src/main/java/alfio/controller/ReservationController.java index e6b84f612c..179e1e616b 100644 --- a/src/main/java/alfio/controller/ReservationController.java +++ b/src/main/java/alfio/controller/ReservationController.java @@ -42,7 +42,6 @@ import alfio.repository.TicketReservationRepository; import alfio.repository.user.OrganizationRepository; import alfio.util.ErrorsCode; -import alfio.util.TemplateManager; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.StringUtils; @@ -85,10 +84,8 @@ public class ReservationController { private final TicketReservationManager ticketReservationManager; private final OrganizationRepository organizationRepository; - private final TemplateManager templateManager; private final MessageSource messageSource; private final ConfigurationManager configurationManager; - private final NotificationManager notificationManager; private final TicketHelper ticketHelper; private final TicketFieldRepository ticketFieldRepository; private final PaymentManager paymentManager; diff --git a/src/main/java/alfio/controller/api/v2/user/ReservationApiV2Controller.java b/src/main/java/alfio/controller/api/v2/user/ReservationApiV2Controller.java new file mode 100644 index 0000000000..0812947f2e --- /dev/null +++ b/src/main/java/alfio/controller/api/v2/user/ReservationApiV2Controller.java @@ -0,0 +1,50 @@ +/** + * This file is part of alf.io. + * + * alf.io is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * alf.io is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with alf.io. If not, see . + */ +package alfio.controller.api.v2.user; + +import alfio.controller.ReservationController; +import lombok.AllArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Locale; +import java.util.Map; + +@RestController +@AllArgsConstructor +public class ReservationApiV2Controller { + + private final ReservationController reservationController; + + + + @GetMapping("/event/{eventName}/reservation/{reservationId}/book") + public ResponseEntity> getBookingInfo(@PathVariable("eventName") String eventName, + @PathVariable("reservationId") String reservationId, + Model model, + Locale locale) { + String res = reservationController.showBookingPage(eventName, reservationId, model, locale); + //FIXME temporary + model.addAttribute("viewState", res); + return new ResponseEntity<>(model.asMap(), HttpStatus.OK); + } + +}