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.
26 lines
797 B
26 lines
797 B
package com.example.services
|
|
|
|
import scala.concurrent.Future
|
|
import com.example.models._
|
|
|
|
// trait LibraryService {
|
|
// def findBookById(id: Long): DBIO[Option[BooksRow]]
|
|
|
|
// def findBooksWithAuthor: DBIO[Seq[(BooksRow, AuthorsRow)]]
|
|
|
|
// def insertAuthor(author: Author): DBIO[AuthorsRow]
|
|
|
|
// def authorToRow(author: Author): AuthorsRow
|
|
// def bookToRow(book: Book): BooksRow
|
|
// }
|
|
|
|
trait LibraryService {
|
|
// Simple function that returns a book
|
|
def findBookById(id: Long): Future[Option[Book]]
|
|
|
|
// Simple function that returns a list of books with it's author
|
|
def findBooksWithAuthor: Future[Seq[(Book, Author)]]
|
|
|
|
// Insert a book and an author composing two DBIOs in a transaction
|
|
def insertBookAndAuthor(book: NewBook, author: NewAuthor): Future[(Long, Long)]
|
|
}
|