2016-07-11 12 views

Antwort

2

Es gibt zwei Dinge, die Sie hier tun können:

  1. in Ihrem Fall Klasse umbenennen Felder:

    case class Employee(account_id: Int, location_type: String) 
    
  2. Schreiben Sie benutzerdefinierte Format:

    import play.api.libs.functional.syntax._ 
    import play.api.libs.json._ 
    
    implicit val employeeFormat: Format[Employee] = (
        (__ \ "account_id").format[Int] and 
        (__ \ "location_type").format[String] 
    )(Employee.apply, unlift(Employee.unapply))