Created
December 31, 2014 05:30
-
-
Save tldeti/2b5aa0c7fdf5d1359254 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 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