Class FestivalController

java.lang.Object
org.localify.festival.FestivalController

@RestController @RequestMapping("/v1/festivals") @ConditionalOnWebApplication public class FestivalController extends Object
Controller for handling festival-related requests.
  • Constructor Details

    • FestivalController

      @Autowired public FestivalController(FestivalService festivalService, UserService userService, SearchService searchService)
      Constructs a new FestivalController.
      Parameters:
      festivalService - The festival service.
      userService - The user service.
      searchService - The search service.
  • Method Details

    • createOrUpdateFestival

      @PutMapping(value="/create", produces="application/json") @ResponseBody public FestivalCreationResponse createOrUpdateFestival(@RequestBody @Valid @Valid FestivalRequest festivalRequest)
      Creates or updates a festival.
      Parameters:
      festivalRequest - The festival request object.
      Returns:
      The festival creation response.
    • getFestivalById

      @GetMapping(value="/{festivalId}", produces="application/json") @ResponseBody public FestivalResponse getFestivalById(@AuthenticationPrincipal UserDetailsImpl user, @PathVariable @NotNull @NotNull UUID festivalId)
      Gets a festival by its ID.
      Parameters:
      user - The authenticated user.
      festivalId - The ID of the festival.
      Returns:
      The festival response.
    • getFestivalPerformancesById

      @GetMapping(value="/{festivalId}/performances", produces="application/json") @ResponseBody public List<FestivalPerformanceResponse> getFestivalPerformancesById(@PathVariable @NotNull @NotNull UUID festivalId)
      Gets the performances for a festival by its ID.
      Parameters:
      festivalId - The ID of the festival.
      Returns:
      A list of festival performance responses.
    • getFestivalStagesById

      @GetMapping(value="/{festivalId}/stages", produces="application/json") @ResponseBody public List<FestivalStageResponse> getFestivalStagesById(@PathVariable @NotNull @NotNull UUID festivalId)
      Gets the stages for a festival by its ID.
      Parameters:
      festivalId - The ID of the festival.
      Returns:
      A list of festival stage responses.
    • getFestivalArtistsById

      @GetMapping(value="/{festivalId}/artists", produces="application/json") @ResponseBody public List<FestivalArtistResponse> getFestivalArtistsById(@AuthenticationPrincipal UserDetailsImpl user, @PathVariable @NotNull @NotNull UUID festivalId)
      Gets the artists for a festival by its ID.
      Parameters:
      user - The authenticated user.
      festivalId - The ID of the festival.
      Returns:
      A list of festival artist responses.
    • search

      @GetMapping(value="/search", produces="application/json") @ResponseBody public List<FestivalResponse> search(@AuthenticationPrincipal UserDetailsImpl user, @Valid @Valid SearchQuery query)
      Searches for festivals.
      Parameters:
      user - The authenticated user.
      query - The search query.
      Returns:
      A list of festival responses.