- Added automated onboarding dialog for new users to pick genres, eras, and content types. - Enhanced "Add Movie" functionality to support folder-per-movie structure with Year and IMDb ID. - Improved ui.js with custom dialogs for Onboarding, Rating, and Adding Movies. - Fixed API accessibility by using standard [Authorize] attributes. - Added "Mark Viewed" and "Sync" actions to the UI. Co-authored-by: devitq <118541411+devitq@users.noreply.github.com>
30 lines
1.3 KiB
Kotlin
30 lines
1.3 KiB
Kotlin
package com.project.movienight.application.services
|
|
|
|
import com.project.movienight.application.ports.input.GetUserPreferencesUseCase
|
|
import com.project.movienight.application.ports.input.UpsertUserPreferencesCommand
|
|
import com.project.movienight.application.ports.input.UpsertUserPreferencesUseCase
|
|
import com.project.movienight.application.ports.output.UserPreferencesRepositoryPort
|
|
import com.project.movienight.domain.model.UserPreferences
|
|
import org.springframework.stereotype.Service
|
|
|
|
@Service
|
|
class UserPreferencesService(
|
|
private val userPreferencesRepository: UserPreferencesRepositoryPort,
|
|
) : UpsertUserPreferencesUseCase,
|
|
GetUserPreferencesUseCase {
|
|
override fun upsert(command: UpsertUserPreferencesCommand): UserPreferences =
|
|
userPreferencesRepository.save(
|
|
UserPreferences(
|
|
userId = command.userId,
|
|
weightedGenres = command.weightedGenres,
|
|
plotTypes = command.plotTypes,
|
|
eras = command.eras,
|
|
castAndDirectors = command.castAndDirectors,
|
|
moods = command.moods,
|
|
contentTypes = command.contentTypes,
|
|
),
|
|
)
|
|
|
|
override fun get(userId: java.util.UUID): UserPreferences? = userPreferencesRepository.findByUserId(userId)
|
|
}
|