chore(web): splitted each dto into separate file

This commit is contained in:
ITQ
2026-04-18 13:14:48 +03:00
parent c605e20d60
commit f72e9080dc
8 changed files with 89 additions and 0 deletions
@@ -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,
)
@@ -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,
)
}
}