Okan Yıldırım
05/06/2022, 8:36 PMRichard Gomez
05/06/2022, 8:39 PMRichard Gomez
05/06/2022, 8:40 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 seperatelyOkan Yıldırım
05/06/2022, 8:42 PMRichard 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.
Richard Gomez
05/06/2022, 8:45 PMphldavies
05/06/2022, 8:46 PMfun Post.toDTO() = PostDTO(title, content)Okan Yıldırım
05/06/2022, 8:49 PMOkan Yıldırım
05/06/2022, 8:49 PMOkan Yıldırım
05/06/2022, 8:49 PMmodelmapper:modelmapper
on Kotlin?Okan Yıldırım
05/06/2022, 8:49 PM