Package org.localify.artist
Class ArtistServiceImpl
java.lang.Object
org.localify.artist.ArtistServiceImpl
- All Implemented Interfaces:
ArtistService
Implementation of the
ArtistService interface.
This class provides the business logic for artist-related operations.-
Field Summary
Fields inherited from interface org.localify.artist.ArtistService
DEFAULT_TOP_GENRES_LIMIT -
Constructor Summary
ConstructorsConstructorDescriptionArtistServiceImpl(ArtistRepository artistRepository, EventRepository eventRepository, ArtistCityRepository artistCityRepository, GenreRepository genreRepository, UserFavoriteArtistRepository userFavoriteArtistRepository, UserRepository userRepository, CityRepository cityRepository, UserRecentArtistViewRepository userRecentArtistViewRepository, UserFavoriteEventRepository userFavoriteEventRepository, BandsInTownDispatch bandsInTownDispatch, SpotifyDispatch spotifyDispatch, UserSeedRepository userSeedRepository, UserCityRepository userCityRepository, FestivalArtistRepository festivalArtistRepository, BotService botService, LocalifyProperties properties) Constructs a new ArtistServiceImpl with the given repositories and services. -
Method Summary
Modifier and TypeMethodDescriptionvoidapproveArtistCityContribution(UUID artistId, UUID cityId, UUID actingUserId) Approves a city contribution for an artist.voiddeleteById(UUID artistId, UUID actingUserId) Deletes an artist by ID.voiddenyArtistCityContribution(UUID artistId, UUID cityId, UUID actingUserId) Denies a city contribution for an artist.fetchExtendedArtistInfo(UUID artistId, UUID actingUserId) Fetches extended information for an artist.getApproveableArtistCityContributions(PageOptions pageOptions) Gets the list of artist city contributions that can be approved.Gets the cities associated with an artist.getEvents(UUID artistId, PageOptions options, UUID actingUserId) Gets the events associated with an artist.getFestivals(UUID artistId) Gets the festivals associated with an artist.getPopularArtists(int minPopularity, int maxPopularity, int amount) Gets a list of popular artists.getPopularArtistsForGenres(List<UUID> genres) Gets the popular artists for a list of genres.getTopGenres(UUID artistId, org.springframework.data.domain.Pageable pageable) Gets the top genres for an artist.patchById(UUID artistId, ArtistPatchRequest request, UUID actingUserId) Patches an artist by ID.voidrecordUserArtistView(UUID artistId, UUID userId) Records a user's view of an artist.voidsuggestArtistCity(UUID artistId, UUID cityId, UUID actingUserId) Suggests a city for an artist.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.localify.artist.ArtistService
getTopGenres
-
Constructor Details
-
ArtistServiceImpl
public ArtistServiceImpl(ArtistRepository artistRepository, EventRepository eventRepository, ArtistCityRepository artistCityRepository, GenreRepository genreRepository, UserFavoriteArtistRepository userFavoriteArtistRepository, UserRepository userRepository, CityRepository cityRepository, UserRecentArtistViewRepository userRecentArtistViewRepository, UserFavoriteEventRepository userFavoriteEventRepository, BandsInTownDispatch bandsInTownDispatch, SpotifyDispatch spotifyDispatch, UserSeedRepository userSeedRepository, UserCityRepository userCityRepository, FestivalArtistRepository festivalArtistRepository, BotService botService, LocalifyProperties properties) Constructs a new ArtistServiceImpl with the given repositories and services.- Parameters:
artistRepository- the artist repositoryeventRepository- the event repositoryartistCityRepository- the artist city repositorygenreRepository- the genre repositoryuserFavoriteArtistRepository- the user favorite artist repositoryuserRepository- the user repositorycityRepository- the city repositoryuserRecentArtistViewRepository- the user recent artist view repositoryuserFavoriteEventRepository- the user favorite event repositorybandsInTownDispatch- the bands in town dispatchspotifyDispatch- the spotify dispatchuserSeedRepository- the user seed repositoryuserCityRepository- the user city repositoryfestivalArtistRepository- the festival artist repositorybotService- the bot serviceproperties- the localify properties
-
-
Method Details
-
doGetById
-
patchById
Description copied from interface:ArtistServicePatches an artist by ID.- Specified by:
patchByIdin interfaceArtistService- Parameters:
artistId- the ID of the artist to patchrequest- the request body containing the fields to patchactingUserId- the ID of the user performing the action- Returns:
- the patched artist's basic information
-
deleteById
Description copied from interface:ArtistServiceDeletes an artist by ID.- Specified by:
deleteByIdin interfaceArtistService- Parameters:
artistId- the ID of the artist to deleteactingUserId- the ID of the user performing the action
-
getTopGenres
public List<GenreResponse> getTopGenres(UUID artistId, org.springframework.data.domain.Pageable pageable) Description copied from interface:ArtistServiceGets the top genres for an artist.- Specified by:
getTopGenresin interfaceArtistService- Parameters:
artistId- the ID of the artistpageable- the pagination information- Returns:
- a list of the artist's top genres
-
getCities
Description copied from interface:ArtistServiceGets the cities associated with an artist.- Specified by:
getCitiesin interfaceArtistService- Parameters:
artistId- the ID of the artist- Returns:
- a list of cities associated with the artist
-
getFestivals
Description copied from interface:ArtistServiceGets the festivals associated with an artist.- Specified by:
getFestivalsin interfaceArtistService- Parameters:
artistId- the ID of the artist- Returns:
- a list of festivals associated with the artist
-
getEvents
Description copied from interface:ArtistServiceGets the events associated with an artist.- Specified by:
getEventsin interfaceArtistService- Parameters:
artistId- the ID of the artistoptions- the pagination optionsactingUserId- the ID of the user performing the action- Returns:
- a list of events associated with the artist
-
getPopularArtistsForGenres
Description copied from interface:ArtistServiceGets the popular artists for a list of genres.- Specified by:
getPopularArtistsForGenresin interfaceArtistService- Parameters:
genres- a list of genre IDs- Returns:
- a list of popular artists for the specified genres
-
fetchExtendedArtistInfo
Description copied from interface:ArtistServiceFetches extended information for an artist.- Specified by:
fetchExtendedArtistInfoin interfaceArtistService- Parameters:
artistId- the ID of the artist to fetchactingUserId- the ID of the user performing the action- Returns:
- the extended artist information
-
recordUserArtistView
Records a user's view of an artist.- Parameters:
artistId- the ID of the artist being vieweduserId- the ID of the user viewing the artist
-
getPopularArtists
Gets a list of popular artists.- Specified by:
getPopularArtistsin interfaceArtistService- Parameters:
minPopularity- the minimum popularity scoremaxPopularity- the maximum popularity scoreamount- the number of artists to return- Returns:
- a list of popular artists
-
suggestArtistCity
Description copied from interface:ArtistServiceSuggests a city for an artist.- Specified by:
suggestArtistCityin interfaceArtistService- Parameters:
artistId- the ID of the artistcityId- the ID of the cityactingUserId- the ID of the user performing the action
-
approveArtistCityContribution
Description copied from interface:ArtistServiceApproves a city contribution for an artist.- Specified by:
approveArtistCityContributionin interfaceArtistService- Parameters:
artistId- the ID of the artistcityId- the ID of the cityactingUserId- the ID of the user performing the action
-
denyArtistCityContribution
Description copied from interface:ArtistServiceDenies a city contribution for an artist.- Specified by:
denyArtistCityContributionin interfaceArtistService- Parameters:
artistId- the ID of the artistcityId- the ID of the cityactingUserId- the ID of the user performing the action
-
getApproveableArtistCityContributions
Description copied from interface:ArtistServiceGets the list of artist city contributions that can be approved.- Specified by:
getApproveableArtistCityContributionsin interfaceArtistService- Parameters:
pageOptions- the pagination options- Returns:
- a list of approveable artist cities
-