You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
456 B

4 years ago
  1. package com.example.models
  2. import play.api.libs.json.Json
  3. import java.time.Instant
  4. final case class Book(id: Long, title: String, authorId: Long, createdAt: Instant)
  5. final case class NewBook(title: String, authorId: Long)
  6. final case class BookDTO(title: String, authorId: Long, createdAt: Instant)
  7. final case class Author(id: Long, name: String)
  8. final case class NewAuthor(name: String)
  9. object Book {
  10. implicit val bookJsonWrite = Json.format[Book]
  11. }