diff --git a/backend/resources/book.json b/backend/resources/book.json deleted file mode 100644 index 62a6e6f..0000000 --- a/backend/resources/book.json +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "id" : "978-0641723445", - "cat" : ["book","hardcover"], - "name" : "The Lightning Thief", - "author" : "Rick Riordan", - "series_t" : "Percy Jackson and the Olympians", - "sequence_i" : 1, - "genre_s" : "fantasy", - "inStock" : true, - "price" : 12.50, - "pages_i" : 384 - } - , - { - "id" : "978-1423103349", - "cat" : ["book","paperback"], - "name" : "The Sea of Monsters", - "author" : "Rick Riordan", - "series_t" : "Percy Jackson and the Olympians", - "sequence_i" : 2, - "genre_s" : "fantasy", - "inStock" : true, - "price" : 6.49, - "pages_i" : 304 - } - , - { - "id" : "978-1857995879", - "cat" : ["book","paperback"], - "name" : "Sophie's World : The Greek Philosophers", - "author" : "Jostein Gaarder", - "sequence_i" : 1, - "genre_s" : "fantasy", - "inStock" : true, - "price" : 3.07, - "pages_i" : 64 - } - , - { - "id" : "978-1933988177", - "cat" : ["book","paperback"], - "name" : "Lucene in Action, Second Edition", - "author" : "Michael McCandless", - "sequence_i" : 1, - "genre_s" : "IT", - "inStock" : true, - "price" : 30.50, - "pages_i" : 475 - } -] - \ No newline at end of file diff --git a/backend/src/main/scala/snorri/Book.scala b/backend/src/main/scala/snorri/Book.scala index d51bc1b..3167f02 100644 --- a/backend/src/main/scala/snorri/Book.scala +++ b/backend/src/main/scala/snorri/Book.scala @@ -1,7 +1,7 @@ package snorri import io.circe.{Encoder, Decoder} -import io.circe.generic.semiauto._ +import io.circe.generic.semiauto.* // NOTE: Not yet reading series_t,sequence_i and cat case class Book( diff --git a/backend/src/main/scala/snorri/Snorri.scala b/backend/src/main/scala/snorri/Snorri.scala index 55e22bb..2f809f2 100644 --- a/backend/src/main/scala/snorri/Snorri.scala +++ b/backend/src/main/scala/snorri/Snorri.scala @@ -38,9 +38,7 @@ object Snorri { } private def retrieveBooks(): String = - use(booksResource()) { src => - src.mkString - } + use(booksResource())(_.mkString) private def booksResource(): BufferedSource = { val stream = getClass.getResourceAsStream("/book.json") diff --git a/build.sbt b/build.sbt index 0aab136..92a186a 100644 --- a/build.sbt +++ b/build.sbt @@ -7,8 +7,7 @@ ThisBuild / tlCiHeaderCheck := false val commonSettings = Seq( libraryDependencies ++= "org.creativescala" %% "krop-core" % "0.6.0" :: - Modules.circe ::: - Nil + Modules.circe ) lazy val snorriRoot =