Skip to content

Commit

Permalink
#588 add initial stubs fro reservation api v2 controller, remove unus…
Browse files Browse the repository at this point in the history
…ed injected services
  • Loading branch information
syjer committed Mar 25, 2019
1 parent 55c7f15 commit 6a5790b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/main/java/alfio/controller/ReservationController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/
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<Map<String, ?>> 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);
}

}

0 comments on commit 6a5790b

Please sign in to comment.