Class ArtistServiceImpl

java.lang.Object
org.localify.artist.ArtistServiceImpl
All Implemented Interfaces:
ArtistService

@Service @Transactional public class ArtistServiceImpl extends Object implements ArtistService
Implementation of the ArtistService interface. This class provides the business logic for artist-related operations.
  • 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 repository
      eventRepository - the event repository
      artistCityRepository - the artist city repository
      genreRepository - the genre repository
      userFavoriteArtistRepository - the user favorite artist repository
      userRepository - the user repository
      cityRepository - the city repository
      userRecentArtistViewRepository - the user recent artist view repository
      userFavoriteEventRepository - the user favorite event repository
      bandsInTownDispatch - the bands in town dispatch
      spotifyDispatch - the spotify dispatch
      userSeedRepository - the user seed repository
      userCityRepository - the user city repository
      festivalArtistRepository - the festival artist repository
      botService - the bot service
      properties - the localify properties
  • Method Details

    • doGetById

      public CompletableFuture<Artist> doGetById(UUID artistId)
    • patchById

      public BasicArtistResponse patchById(UUID artistId, ArtistPatchRequest request, UUID actingUserId)
      Description copied from interface: ArtistService
      Patches an artist by ID.
      Specified by:
      patchById in interface ArtistService
      Parameters:
      artistId - the ID of the artist to patch
      request - the request body containing the fields to patch
      actingUserId - the ID of the user performing the action
      Returns:
      the patched artist's basic information
    • deleteById

      public void deleteById(UUID artistId, UUID actingUserId)
      Description copied from interface: ArtistService
      Deletes an artist by ID.
      Specified by:
      deleteById in interface ArtistService
      Parameters:
      artistId - the ID of the artist to delete
      actingUserId - 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: ArtistService
      Gets the top genres for an artist.
      Specified by:
      getTopGenres in interface ArtistService
      Parameters:
      artistId - the ID of the artist
      pageable - the pagination information
      Returns:
      a list of the artist's top genres
    • getCities

      public List<ArtistCityResponse> getCities(UUID artistId)
      Description copied from interface: ArtistService
      Gets the cities associated with an artist.
      Specified by:
      getCities in interface ArtistService
      Parameters:
      artistId - the ID of the artist
      Returns:
      a list of cities associated with the artist
    • getFestivals

      public List<FestivalBasicResponse> getFestivals(UUID artistId)
      Description copied from interface: ArtistService
      Gets the festivals associated with an artist.
      Specified by:
      getFestivals in interface ArtistService
      Parameters:
      artistId - the ID of the artist
      Returns:
      a list of festivals associated with the artist
    • getEvents

      public ArtistEventListResponse getEvents(UUID artistId, PageOptions options, UUID actingUserId)
      Description copied from interface: ArtistService
      Gets the events associated with an artist.
      Specified by:
      getEvents in interface ArtistService
      Parameters:
      artistId - the ID of the artist
      options - the pagination options
      actingUserId - the ID of the user performing the action
      Returns:
      a list of events associated with the artist
    • getPopularArtistsForGenres

      public List<BasicArtistResponse> getPopularArtistsForGenres(List<UUID> genres)
      Description copied from interface: ArtistService
      Gets the popular artists for a list of genres.
      Specified by:
      getPopularArtistsForGenres in interface ArtistService
      Parameters:
      genres - a list of genre IDs
      Returns:
      a list of popular artists for the specified genres
    • fetchExtendedArtistInfo

      public ExtendedArtistResponse fetchExtendedArtistInfo(@NonNull UUID artistId, UUID actingUserId)
      Description copied from interface: ArtistService
      Fetches extended information for an artist.
      Specified by:
      fetchExtendedArtistInfo in interface ArtistService
      Parameters:
      artistId - the ID of the artist to fetch
      actingUserId - the ID of the user performing the action
      Returns:
      the extended artist information
    • recordUserArtistView

      @Transactional public void recordUserArtistView(UUID artistId, UUID userId)
      Records a user's view of an artist.
      Parameters:
      artistId - the ID of the artist being viewed
      userId - the ID of the user viewing the artist
    • getPopularArtists

      public List<PopularArtist> getPopularArtists(int minPopularity, int maxPopularity, int amount)
      Gets a list of popular artists.
      Specified by:
      getPopularArtists in interface ArtistService
      Parameters:
      minPopularity - the minimum popularity score
      maxPopularity - the maximum popularity score
      amount - the number of artists to return
      Returns:
      a list of popular artists
    • suggestArtistCity

      public void suggestArtistCity(UUID artistId, UUID cityId, UUID actingUserId)
      Description copied from interface: ArtistService
      Suggests a city for an artist.
      Specified by:
      suggestArtistCity in interface ArtistService
      Parameters:
      artistId - the ID of the artist
      cityId - the ID of the city
      actingUserId - the ID of the user performing the action
    • approveArtistCityContribution

      public void approveArtistCityContribution(UUID artistId, UUID cityId, UUID actingUserId)
      Description copied from interface: ArtistService
      Approves a city contribution for an artist.
      Specified by:
      approveArtistCityContribution in interface ArtistService
      Parameters:
      artistId - the ID of the artist
      cityId - the ID of the city
      actingUserId - the ID of the user performing the action
    • denyArtistCityContribution

      public void denyArtistCityContribution(UUID artistId, UUID cityId, UUID actingUserId)
      Description copied from interface: ArtistService
      Denies a city contribution for an artist.
      Specified by:
      denyArtistCityContribution in interface ArtistService
      Parameters:
      artistId - the ID of the artist
      cityId - the ID of the city
      actingUserId - the ID of the user performing the action
    • getApproveableArtistCityContributions

      public List<ApproveableArtistCity> getApproveableArtistCityContributions(PageOptions pageOptions)
      Description copied from interface: ArtistService
      Gets the list of artist city contributions that can be approved.
      Specified by:
      getApproveableArtistCityContributions in interface ArtistService
      Parameters:
      pageOptions - the pagination options
      Returns:
      a list of approveable artist cities