Skip to content

Instantly share code, notes, and snippets.

@wende
Created November 20, 2014 01:03
Show Gist options
  • Save wende/293b6cd5d987b1bb1514 to your computer and use it in GitHub Desktop.
Save wende/293b6cd5d987b1bb1514 to your computer and use it in GitHub Desktop.
package services
import reactivemongo.bson.BSONObjectID
// Not unused at all. Do not delete
import play.modules.reactivemongo.json.BSONFormats._
object JsonFormats {
import play.api.libs.json.Json
// Generates Writes and Reads for Feed and User thanks to Json Macros
implicit val feedFormat = Json.format[Feed]
implicit val userFormat = Json.format[User]
}
case class User(
_id : BSONObjectID,
age: Int,
firstName: String,
lastName: String,
feeds: List[Feed])
case class Feed(
name: String,
url: String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment