Class MatchesController
java.lang.Object
net.andresbustamante.yafoot.commons.web.controllers.AbstractController
net.andresbustamante.yafoot.core.web.controllers.MatchesController
- All Implemented Interfaces:
MatchesApi
@RestController
public class MatchesController
extends net.andresbustamante.yafoot.commons.web.controllers.AbstractController
implements MatchesApi
REST service for managing and searching matches.
- Author:
- andresbustamante
-
Field Summary
Fields inherited from class net.andresbustamante.yafoot.commons.web.controllers.AbstractController
DATABASE_BASIC_ERROR, UNAUTHORISED_USER_ERROR
Fields inherited from interface net.andresbustamante.yafoot.core.web.controllers.MatchesApi
log
-
Constructor Summary
ConstructorsConstructorDescriptionMatchesController
(net.andresbustamante.yafoot.core.services.MatchSearchService matchSearchService, net.andresbustamante.yafoot.core.services.PlayerSearchService playerSearchService, net.andresbustamante.yafoot.core.services.CarpoolingService carpoolingService, net.andresbustamante.yafoot.core.services.MatchManagementService matchManagementService, MatchMapper matchMapper, RegistrationMapper registrationMapper, CarMapper carMapper) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void>
cancelMatch
(String code) org.springframework.http.ResponseEntity<Void>
createMatch
(MatchForm match) findCarsForMatch
(String code) findMatches
(LocalDate startDate, LocalDate endDate, SportCode sport, MatchStatus status) org.springframework.http.ResponseEntity<Match>
loadMatchByCode
(String code) org.springframework.http.ResponseEntity<List<Registration>>
loadMatchRegistrations
(String code) org.springframework.http.ResponseEntity<Void>
registerPlayerToMatch
(String code, RegistrationForm registration) org.springframework.http.ResponseEntity<Void>
unregisterPlayerFromMatch
(String code, Integer pid) org.springframework.http.ResponseEntity<Void>
updateCarForRegistration
(String code, Integer pid, CarConfirmation carConfirmation) Methods inherited from class net.andresbustamante.yafoot.commons.web.controllers.AbstractController
getLocationURI, getObjectMapper, getRequest, getUserContext, handleConstraintViolationException, translate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.andresbustamante.yafoot.core.web.controllers.MatchesApi
getObjectMapper, getRequest
-
Constructor Details
-
MatchesController
public MatchesController(net.andresbustamante.yafoot.core.services.MatchSearchService matchSearchService, net.andresbustamante.yafoot.core.services.PlayerSearchService playerSearchService, net.andresbustamante.yafoot.core.services.CarpoolingService carpoolingService, net.andresbustamante.yafoot.core.services.MatchManagementService matchManagementService, MatchMapper matchMapper, RegistrationMapper registrationMapper, CarMapper carMapper)
-
-
Method Details
-
loadMatchByCode
- Specified by:
loadMatchByCode
in interfaceMatchesApi
-
loadMatchRegistrations
public org.springframework.http.ResponseEntity<List<Registration>> loadMatchRegistrations(String code) - Specified by:
loadMatchRegistrations
in interfaceMatchesApi
-
findMatches
public org.springframework.http.ResponseEntity<List<Match>> findMatches(@DateTimeFormat(iso=DATE) LocalDate startDate, @DateTimeFormat(iso=DATE) LocalDate endDate, SportCode sport, MatchStatus status) - Specified by:
findMatches
in interfaceMatchesApi
-
cancelMatch
- Specified by:
cancelMatch
in interfaceMatchesApi
-
createMatch
@CrossOrigin(exposedHeaders="Location") public org.springframework.http.ResponseEntity<Void> createMatch(MatchForm match) - Specified by:
createMatch
in interfaceMatchesApi
-
findCarsForMatch
- Specified by:
findCarsForMatch
in interfaceMatchesApi
-
registerPlayerToMatch
@CrossOrigin(exposedHeaders="Location") public org.springframework.http.ResponseEntity<Void> registerPlayerToMatch(String code, RegistrationForm registration) - Specified by:
registerPlayerToMatch
in interfaceMatchesApi
-
updateCarForRegistration
public org.springframework.http.ResponseEntity<Void> updateCarForRegistration(String code, Integer pid, CarConfirmation carConfirmation) - Specified by:
updateCarForRegistration
in interfaceMatchesApi
-
unregisterPlayerFromMatch
public org.springframework.http.ResponseEntity<Void> unregisterPlayerFromMatch(String code, Integer pid) - Specified by:
unregisterPlayerFromMatch
in interfaceMatchesApi
-