Skip to content

Instantly share code, notes, and snippets.

@tldeti
Created December 31, 2014 05:30
Show Gist options
  • Save tldeti/2b5aa0c7fdf5d1359254 to your computer and use it in GitHub Desktop.
Save tldeti/2b5aa0c7fdf5d1359254 to your computer and use it in GitHub Desktop.
package com.gtan.turing.model.rel
import play.api.libs.json._
import play.api.libs.functional.syntax._
/**
* 用户
* Created by Yang Jing ([email protected]) on 2014-12-16.
*/
case class User(id: String,
ownerType: String,
ownerId: String,
externalId: String,
name: String,
notionalId: String,
email: String,
address: String,
phone: String,
status: String,
socialSites: List[SocialSite])
object User {
implicit val formats = Json.format[User]
}
case class SocialSite(name: String, status: String, id: String)
object SocialSite {
implicit val formats:Format[SocialSite] = (
(JsPath \ "name").format[String] and
(JsPath \ "status").format[String] and
(JsPath \ "id").format[String]
)(SocialSite.apply, unlift(SocialSite.unapply))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment