Created
November 20, 2014 01:03
-
-
Save wende/293b6cd5d987b1bb1514 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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