这是我的案例类:
case class Admin(name: String, surname: String, login: String, password: String
这是我的json格式化程序:
implicit val adminWrite: Writes[Admin] = (
(JsPath \ "name").write[String] and
(JsPath \ "surname").write[String] and
(JsPath \ "login").write[String] and
(JsPath \ "password").write[String]
)(unlift(Admin.unapply))
我得到了什么:
{
name: "ddd",
surname: "ddd",
login: "djamik123",
password: "djamik123"
}
我需要什么:
{
id: 1,
name: "ddd",
surname: "ddd",
login: "djamik123",
password: "djamik123"
}
有没有办法解决这个问题?