Interface CityService

All Known Implementing Classes:
CityServiceImpl

public interface CityService
Service interface for managing cities.
  • Field Details

    • MAX_NEAREST_RESULTS

      static final int MAX_NEAREST_RESULTS
      The maximum number of results to return for nearest city searches.
      See Also:
  • Method Details

    • getById

      CityResponse getById(UUID cityId)
      Gets a city by its ID.
      Parameters:
      cityId - The ID of the city.
      Returns:
      The city response.
    • getByIdExtended

      CityResponseExtended getByIdExtended(UUID cityId)
      Gets an extended city response by its ID.
      Parameters:
      cityId - The ID of the city.
      Returns:
      The extended city response.
    • getByIdWithArtists

      CityArtistsResponse getByIdWithArtists(UUID userId, UUID cityId)
      Gets a city with its artists by its ID.
      Parameters:
      userId - The ID of the user.
      cityId - The ID of the city.
      Returns:
      The city artists response.
    • patchById

      CityResponse patchById(UUID cityId, CityPatchRequest request)
      Patches a city by its ID.
      Parameters:
      cityId - The ID of the city.
      request - The patch request.
      Returns:
      The updated city response.
    • deleteById

      void deleteById(UUID cityId)
      Deletes a city by its ID.
      Parameters:
      cityId - The ID of the city.
    • getEvents

      org.springframework.data.domain.Page<EventResponseExtendedLocal> getEvents(UUID cityId, PageOptions pageOptions, UUID userId)
      Gets the events for a city.
      Parameters:
      cityId - The ID of the city.
      pageOptions - The page options.
      userId - The ID of the user.
      Returns:
      A page of events.
    • getArtists

      org.springframework.data.domain.Page<City.CityArtistApiResponse> getArtists(UUID cityId, PageOptions pageOptions, UUID userId)
      Gets the artists for a city.
      Parameters:
      cityId - The ID of the city.
      pageOptions - The page options.
      userId - The ID of the user.
      Returns:
      A page of artists.
    • getVenues

      org.springframework.data.domain.Page<VenueEventNumResponse> getVenues(UUID cityId, PageOptions pageOptions)
      Gets the venues for a city.
      Parameters:
      cityId - The ID of the city.
      pageOptions - The page options.
      Returns:
      A page of venues.
    • getRelevantCities

      List<CityResponse> getRelevantCities(@Nullable String query, double latitude, double longitude)
      Gets the relevant cities for a given query and location.
      Parameters:
      query - The search query.
      latitude - The latitude.
      longitude - The longitude.
      Returns:
      A list of relevant cities.
    • getNearestCities

      List<CityResponse> getNearestCities(double latitude, double longitude)
      Gets the nearest cities to a given location.
      Parameters:
      latitude - The latitude.
      longitude - The longitude.
      Returns:
      A list of nearest cities.
    • createPlaylist

      PlaylistDto createPlaylist(City city)
      Creates a playlist for a city.
      Parameters:
      city - The city.
      Returns:
      The created playlist.
    • getOrCreatePlaylist

      PlaylistDto getOrCreatePlaylist(UUID cityId)
      Gets or creates a playlist for a city.
      Parameters:
      cityId - The ID of the city.
      Returns:
      The playlist.
    • getCityArtistProportions

      List<CityArtistProportionResponse> getCityArtistProportions(PageOptions pageOptions)
      Gets the city-artist proportions.
      Parameters:
      pageOptions - The page options.
      Returns:
      A list of city-artist proportion responses.
    • getCityArtistProportionsByCreation

      List<CityArtistProportionResponse> getCityArtistProportionsByCreation(PageOptions pageOptions)
      Gets the city-artist proportions, ordered by creation date.
      Parameters:
      pageOptions - The page options.
      Returns:
      A list of city-artist proportion responses.
    • findOrCreateCity

      City findOrCreateCity(String locationText)
      Finds or creates a city from a location string.
      Parameters:
      locationText - The location string.
      Returns:
      The found or created city.
    • findCityTimezone

      void findCityTimezone(City city)
      Finds the timezone for a city.
      Parameters:
      city - The city.