chore(web): splitted each dto into separate file
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
package com.project.movienight.adapters.web.dto.request
|
||||
|
||||
data class CreateFilmLibraryRequest(
|
||||
val name: String = "My films",
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.project.movienight.adapters.web.dto.request
|
||||
|
||||
data class CreateFilmRequest(
|
||||
val title: String,
|
||||
val description: String,
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.project.movienight.adapters.web.dto.request
|
||||
|
||||
data class CreateUserRequest(
|
||||
val name: String,
|
||||
val email: String,
|
||||
)
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.project.movienight.adapters.web.dto.request
|
||||
|
||||
data class EditFilmRequest(
|
||||
val title: String,
|
||||
val description: String,
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.project.movienight.adapters.web.dto.request
|
||||
|
||||
data class EditUserRequest(
|
||||
val name: String,
|
||||
)
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.project.movienight.adapters.web.dto.response
|
||||
|
||||
import com.project.movienight.domain.model.FilmLibrary
|
||||
import java.util.UUID
|
||||
|
||||
data class FilmLibraryResponse(
|
||||
val id: UUID,
|
||||
val userId: UUID,
|
||||
val filmId: UUID,
|
||||
val comment: String?,
|
||||
val isViewed: Boolean,
|
||||
) {
|
||||
companion object {
|
||||
fun fromDomain(filmLibrary: FilmLibrary): FilmLibraryResponse =
|
||||
FilmLibraryResponse(
|
||||
id = filmLibrary.id,
|
||||
userId = filmLibrary.userId,
|
||||
filmId = filmLibrary.filmId,
|
||||
comment = filmLibrary.comment,
|
||||
isViewed = filmLibrary.isViewed,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.project.movienight.adapters.web.dto.response
|
||||
|
||||
import com.project.movienight.domain.model.Film
|
||||
import java.util.UUID
|
||||
|
||||
data class FilmResponse(
|
||||
val id: UUID,
|
||||
val title: String,
|
||||
val description: String,
|
||||
) {
|
||||
companion object {
|
||||
fun fromDomain(film: Film): FilmResponse =
|
||||
FilmResponse(
|
||||
id = film.id,
|
||||
title = film.title,
|
||||
description = film.description,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.project.movienight.adapters.web.dto.response
|
||||
|
||||
import com.project.movienight.domain.model.User
|
||||
import java.util.UUID
|
||||
|
||||
data class UserResponse(
|
||||
val id: UUID,
|
||||
val name: String,
|
||||
val email: String,
|
||||
) {
|
||||
companion object {
|
||||
fun fromDomain(user: User): UserResponse =
|
||||
UserResponse(
|
||||
id = user.id,
|
||||
name = user.name,
|
||||
email = user.email,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user