style(format): run ktlint format
This commit is contained in:
@@ -28,7 +28,6 @@ class FilmService(
|
||||
GetFilmByIdUseCase,
|
||||
GetAllFilmsUseCase,
|
||||
SearchFilmByTitleUseCase {
|
||||
|
||||
override fun create(command: CreateFilmCommand): Film {
|
||||
if (filmConfig.isBlocked(command.title)) {
|
||||
throw BlockedValueException(target = "Film", field = "title")
|
||||
@@ -37,15 +36,19 @@ class FilmService(
|
||||
throw BlockedValueException(target = "Film", field = "description")
|
||||
}
|
||||
|
||||
val film = Film(
|
||||
id = idGenerator.generateId(),
|
||||
title = command.title,
|
||||
description = command.description,
|
||||
)
|
||||
val film =
|
||||
Film(
|
||||
id = idGenerator.generateId(),
|
||||
title = command.title,
|
||||
description = command.description,
|
||||
)
|
||||
return filmRepository.save(film)
|
||||
}
|
||||
|
||||
override fun edit(id: UUID, command: EditFilmCommand): Film {
|
||||
override fun edit(
|
||||
id: UUID,
|
||||
command: EditFilmCommand,
|
||||
): Film {
|
||||
if (filmConfig.isBlocked(command.title)) {
|
||||
throw BlockedValueException(target = "Film", field = "title")
|
||||
}
|
||||
@@ -63,9 +66,8 @@ class FilmService(
|
||||
filmRepository.deleteById(id)
|
||||
}
|
||||
|
||||
override fun getById(id: UUID): Film {
|
||||
return filmRepository.findById(id) ?: throw EntityNotFoundException(entity = "Film", id = id.toString())
|
||||
}
|
||||
override fun getById(id: UUID): Film =
|
||||
filmRepository.findById(id) ?: throw EntityNotFoundException(entity = "Film", id = id.toString())
|
||||
|
||||
override fun getAll(): List<Film> = filmRepository.findAll()
|
||||
|
||||
|
||||
@@ -26,18 +26,18 @@ class UserService(
|
||||
DeleteUserUseCase,
|
||||
GetUserByIdUseCase,
|
||||
GetAllUsersUseCase {
|
||||
|
||||
override fun create(command: CreateUserCommand): User {
|
||||
if (userConfig.isBlocked(command.name)) {
|
||||
throw BlockedValueException(target = "User", field = "name")
|
||||
}
|
||||
|
||||
val user = User(
|
||||
id = idGenerator.generateId(),
|
||||
name = command.name,
|
||||
email = command.email,
|
||||
library = null,
|
||||
)
|
||||
val user =
|
||||
User(
|
||||
id = idGenerator.generateId(),
|
||||
name = command.name,
|
||||
email = command.email,
|
||||
library = null,
|
||||
)
|
||||
return userRepository.save(user)
|
||||
}
|
||||
|
||||
@@ -59,9 +59,8 @@ class UserService(
|
||||
userRepository.deleteById(id)
|
||||
}
|
||||
|
||||
override fun getById(id: UUID): User {
|
||||
return userRepository.findById(id) ?: throw EntityNotFoundException(entity = "User", id = id.toString())
|
||||
}
|
||||
override fun getById(id: UUID): User =
|
||||
userRepository.findById(id) ?: throw EntityNotFoundException(entity = "User", id = id.toString())
|
||||
|
||||
override fun getAll(): List<User> = userRepository.findAll()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user