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.
14 lines
456 B
14 lines
456 B
package com.example.models
|
|
|
|
import play.api.libs.json.Json
|
|
import java.time.Instant
|
|
|
|
final case class Book(id: Long, title: String, authorId: Long, createdAt: Instant)
|
|
final case class NewBook(title: String, authorId: Long)
|
|
final case class BookDTO(title: String, authorId: Long, createdAt: Instant)
|
|
final case class Author(id: Long, name: String)
|
|
final case class NewAuthor(name: String)
|
|
|
|
object Book {
|
|
implicit val bookJsonWrite = Json.format[Book]
|
|
}
|