Okan Yıldırım
05/06/2022, 8:36 PMRichard Gomez
05/06/2022, 8:39 PMCreatePostDto
or CreatePostRequest
(pick your poison) only has title and content, and ReadPostDto
has all attributes, etc.Okan Yıldırım
05/06/2022, 8:41 PMEntity
and the Dto
seperatelyRichard Gomez
05/06/2022, 8:45 PMA little bit repeating but probably won't harm anythingWhile it may seem a bit awkward, I'd argue that it's a good approach. That way your DTO models aren't tied to your entity models.
phldavies
05/06/2022, 8:46 PMfun Post.toDTO() = PostDTO(title, content)
Okan Yıldırım
05/06/2022, 8:49 PMmodelmapper:modelmapper
on Kotlin?