leaderboards API on /player
This commit is contained in:
parent
80182b0a61
commit
f160010184
|
@ -136,7 +136,8 @@ object User extends LilaController {
|
|||
}
|
||||
tourneyWinners ← Env.tournament.winners scheduled nb
|
||||
online ← env.cached topOnline 40
|
||||
} yield html.user.list(
|
||||
res <- negotiate(
|
||||
html = fuccess(Ok(html.user.list(
|
||||
tourneyWinners = tourneyWinners,
|
||||
online = online,
|
||||
bullet = bullet,
|
||||
|
@ -150,7 +151,23 @@ object User extends LilaController {
|
|||
atomic = atomic,
|
||||
horde = horde,
|
||||
nbWeek = nbWeek,
|
||||
nbAllTime = nbAllTime)
|
||||
nbAllTime = nbAllTime))),
|
||||
api = _ => fuccess {
|
||||
implicit val userWrites = play.api.libs.json.Writes[UserModel] { env.jsonView(_, true) }
|
||||
Ok(Json.obj(
|
||||
"online" -> online,
|
||||
"bullet" -> bullet,
|
||||
"blitz" -> blitz,
|
||||
"classical" -> classical,
|
||||
"correspondence" -> correspondence,
|
||||
"chess960" -> chess960,
|
||||
"kingOfTheHill" -> kingOfTheHill,
|
||||
"threeCheck" -> threeCheck,
|
||||
"antichess" -> antichess,
|
||||
"atomic" -> atomic,
|
||||
"horde" -> horde))
|
||||
})
|
||||
} yield res
|
||||
}
|
||||
|
||||
def mod(username: String) = Secure(_.UserSpy) { implicit ctx =>
|
||||
|
|
Loading…
Reference in a new issue