Skip to content

Instantly share code, notes, and snippets.

@duanebester
Last active November 22, 2019 23:41
Show Gist options
  • Save duanebester/e3d0784a1851ad0efcf8ffc548744374 to your computer and use it in GitHub Desktop.
Save duanebester/e3d0784a1851ad0efcf8ffc548744374 to your computer and use it in GitHub Desktop.
Coffee Shop case class
package models.responses
import spray.json.DefaultJsonProtocol
import models.common._
// CoffeeShop.scala
case class CoffeeShop(id: Int, name: String, location: Location) extends GeoSearchable
object CoffeeShop extends DefaultJsonProtocol {
implicit val format = jsonFormat3(CoffeeShop.apply)
}
case class CoffeeShopsResponse(hits: Seq[CoffeeShop], total: Long) extends SearchResponse[CoffeeShop]
object CoffeeShopsResponse extends DefaultJsonProtocol {
implicit def format = jsonFormat2(CoffeeShopsResponse.apply)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment