Package org.localify.venue
Class VenueController
java.lang.Object
org.localify.venue.VenueController
@RestController
@ConditionalOnWebApplication
@RequestMapping("/v1/venues")
public class VenueController
extends Object
Controller for handling requests related to venues.
-
Constructor Summary
ConstructorsConstructorDescriptionVenueController(VenueService venueService, SearchService searchService, UserService userService) Constructs a new VenueController. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteById(UUID venueId, UserDetailsImpl user) Deletes a venue by its ID.getById(UUID venueId, UserDetailsImpl user) Gets a venue by its ID.getPastEvents(UUID venueId, @Valid PageOptions pageOptions, UserDetailsImpl user) Gets the past events for a venue.getPlaylist(UUID venueId) Gets or creates a playlist for a venue.getUpcomingEvents(UUID venueId, @Valid PageOptions pageOptions, UserDetailsImpl user) Gets the upcoming events for a venue.patchById(UUID venueId, @Valid VenuePatchRequest request, UserDetailsImpl user) Patches a venue by its ID.venueSearch(UserDetailsImpl user, @Valid SearchQuery query) Searches for venues.
-
Constructor Details
-
VenueController
public VenueController(VenueService venueService, SearchService searchService, UserService userService) Constructs a new VenueController.- Parameters:
venueService- The venue service.searchService- The search service.userService- The user service.
-
-
Method Details
-
getById
@GetMapping(value="/{venueId}", produces="application/json") @ResponseBody public VenueResponseExtended getById(@PathVariable UUID venueId, @AuthenticationPrincipal UserDetailsImpl user) Gets a venue by its ID.- Parameters:
venueId- The ID of the venue.user- The authenticated user.- Returns:
- The venue response.
-
deleteById
@DeleteMapping("/{venueId}") @ResponseStatus(NO_CONTENT) public void deleteById(@PathVariable UUID venueId, @AuthenticationPrincipal UserDetailsImpl user) Deletes a venue by its ID.- Parameters:
venueId- The ID of the venue.user- The authenticated user.
-
patchById
@PatchMapping("/{venueId}") public VenueResponse patchById(@PathVariable UUID venueId, @RequestBody @Valid @Valid VenuePatchRequest request, @AuthenticationPrincipal UserDetailsImpl user) Patches a venue by its ID.- Parameters:
venueId- The ID of the venue.request- The patch request.user- The authenticated user.- Returns:
- The updated venue response.
-
venueSearch
@GetMapping(value="/search", produces="application/json") @ResponseBody public List<VenueResponse> venueSearch(@AuthenticationPrincipal UserDetailsImpl user, @Valid @Valid SearchQuery query) Searches for venues.- Parameters:
user- The authenticated user.query- The search query.- Returns:
- A list of venue responses.
-
getPlaylist
@PostMapping(value="/{venueId}/playlist", produces="application/json") @ResponseBody public PlaylistDto getPlaylist(@PathVariable UUID venueId) Gets or creates a playlist for a venue.- Parameters:
venueId- The ID of the venue.- Returns:
- The playlist DTO.
-
getUpcomingEvents
@GetMapping(value="/{venueId}/upcoming-events", produces="application/json") @ResponseBody public List<EventResponseExtendedLocal> getUpcomingEvents(@PathVariable UUID venueId, @Valid @Valid PageOptions pageOptions, @AuthenticationPrincipal UserDetailsImpl user) Gets the upcoming events for a venue.- Parameters:
venueId- The ID of the venue.pageOptions- The pagination options.user- The authenticated user.- Returns:
- A list of event responses.
-
getPastEvents
@GetMapping(value="/{venueId}/past-events", produces="application/json") @ResponseBody public List<EventResponseExtendedLocal> getPastEvents(@PathVariable UUID venueId, @Valid @Valid PageOptions pageOptions, @AuthenticationPrincipal UserDetailsImpl user) Gets the past events for a venue.- Parameters:
venueId- The ID of the venue.pageOptions- The pagination options.user- The authenticated user.- Returns:
- A list of event responses.
-