Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Statistics backend (first iteration) #37

Open
vladbat00 opened this issue May 12, 2020 · 0 comments
Open

Statistics backend (first iteration) #37

vladbat00 opened this issue May 12, 2020 · 0 comments
Assignees
Labels
web Web backend for statistics and lobby
Milestone

Comments

@vladbat00
Copy link
Member

vladbat00 commented May 12, 2020

Endpoints

GET /statistics

Parameters

  • player
    • type: string
    • required: false

Response

  • If player parameter is present, return top 10 of all players ordered by score, 4 players before the best player score
  • If player parameter is absent, return top 20 of all players ordered by score

Example:

[
  {
    "player": "Player 1",
    "score": 100,
  },
  // ... 13 other results
  {
    "player": "You",
    "score": 12,
  },
  // ... 4 other results
]

POST /statistics

Parameters

  • player
    • type: string
    • required: true
  • score
    • type: number
    • required: true

Response

  • If player isn't present in the DB, create a new record
  • If player is already present in the DB and the submitted score is higher, update the score
OK 200
@vladbat00 vladbat00 added the web Web backend for statistics and lobby label May 12, 2020
@vladbat00 vladbat00 changed the title Statistics backend Statistics backend (first iteration) May 12, 2020
@vladbat00 vladbat00 added this to the 0.3 release milestone May 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
web Web backend for statistics and lobby
Projects
None yet
Development

No branches or pull requests

2 participants