Package org.localify.city
Interface CityService
- All Known Implementing Classes:
CityServiceImpl
public interface CityService
Service interface for managing cities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum number of results to return for nearest city searches. -
Method Summary
Modifier and TypeMethodDescriptioncreatePlaylist(City city) Creates a playlist for a city.voiddeleteById(UUID cityId) Deletes a city by its ID.voidfindCityTimezone(City city) Finds the timezone for a city.findOrCreateCity(String locationText) Finds or creates a city from a location string.org.springframework.data.domain.Page<City.CityArtistApiResponse>getArtists(UUID cityId, PageOptions pageOptions, UUID userId) Gets the artists for a city.Gets a city by its ID.getByIdExtended(UUID cityId) Gets an extended city response by its ID.getByIdWithArtists(UUID userId, UUID cityId) Gets a city with its artists by its ID.getCityArtistProportions(PageOptions pageOptions) Gets the city-artist proportions.getCityArtistProportionsByCreation(PageOptions pageOptions) Gets the city-artist proportions, ordered by creation date.org.springframework.data.domain.Page<EventResponseExtendedLocal>getEvents(UUID cityId, PageOptions pageOptions, UUID userId) Gets the events for a city.getNearestCities(double latitude, double longitude) Gets the nearest cities to a given location.getOrCreatePlaylist(UUID cityId) Gets or creates a playlist for a city.getRelevantCities(String query, double latitude, double longitude) Gets the relevant cities for a given query and location.org.springframework.data.domain.Page<VenueEventNumResponse>getVenues(UUID cityId, PageOptions pageOptions) Gets the venues for a city.patchById(UUID cityId, CityPatchRequest request) Patches a city by its ID.
-
Field Details
-
MAX_NEAREST_RESULTS
static final int MAX_NEAREST_RESULTSThe maximum number of results to return for nearest city searches.- See Also:
-
-
Method Details
-
getById
Gets a city by its ID.- Parameters:
cityId- The ID of the city.- Returns:
- The city response.
-
getByIdExtended
Gets an extended city response by its ID.- Parameters:
cityId- The ID of the city.- Returns:
- The extended city response.
-
getByIdWithArtists
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
Patches a city by its ID.- Parameters:
cityId- The ID of the city.request- The patch request.- Returns:
- The updated city response.
-
deleteById
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
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
Gets the nearest cities to a given location.- Parameters:
latitude- The latitude.longitude- The longitude.- Returns:
- A list of nearest cities.
-
createPlaylist
Creates a playlist for a city.- Parameters:
city- The city.- Returns:
- The created playlist.
-
getOrCreatePlaylist
Gets or creates a playlist for a city.- Parameters:
cityId- The ID of the city.- Returns:
- The playlist.
-
getCityArtistProportions
Gets the city-artist proportions.- Parameters:
pageOptions- The page options.- Returns:
- A list of city-artist proportion responses.
-
getCityArtistProportionsByCreation
Gets the city-artist proportions, ordered by creation date.- Parameters:
pageOptions- The page options.- Returns:
- A list of city-artist proportion responses.
-
findOrCreateCity
Finds or creates a city from a location string.- Parameters:
locationText- The location string.- Returns:
- The found or created city.
-
findCityTimezone
Finds the timezone for a city.- Parameters:
city- The city.
-