diff options
Diffstat (limited to 'backend/handlers')
| -rw-r--r-- | backend/handlers/logs.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/backend/handlers/logs.go b/backend/handlers/logs.go index 0ebba47..5233738 100644 --- a/backend/handlers/logs.go +++ b/backend/handlers/logs.go | |||
| @@ -49,6 +49,15 @@ type ScoreLogsResponseDetails struct { | |||
| 49 | Date time.Time `json:"date"` | 49 | Date time.Time `json:"date"` |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | // GET Mod Logs | ||
| 53 | // | ||
| 54 | // @Description Get mod logs. | ||
| 55 | // @Tags rankings | ||
| 56 | // @Produce json | ||
| 57 | // @Param Authorization header string true "JWT Token" | ||
| 58 | // @Success 200 {object} models.Response{data=ScoreLogsResponse} | ||
| 59 | // @Failure 400 {object} models.Response | ||
| 60 | // @Router /logs/mod [get] | ||
| 52 | func ModLogs(c *gin.Context) { | 61 | func ModLogs(c *gin.Context) { |
| 53 | mod, exists := c.Get("mod") | 62 | mod, exists := c.Get("mod") |
| 54 | if !exists || !mod.(bool) { | 63 | if !exists || !mod.(bool) { |
| @@ -86,6 +95,14 @@ func ModLogs(c *gin.Context) { | |||
| 86 | }) | 95 | }) |
| 87 | } | 96 | } |
| 88 | 97 | ||
| 98 | // GET Score Logs | ||
| 99 | // | ||
| 100 | // @Description Get score logs of every player. | ||
| 101 | // @Tags rankings | ||
| 102 | // @Produce json | ||
| 103 | // @Success 200 {object} models.Response{data=ScoreLogsResponse} | ||
| 104 | // @Failure 400 {object} models.Response | ||
| 105 | // @Router /logs/score [get] | ||
| 89 | func ScoreLogs(c *gin.Context) { | 106 | func ScoreLogs(c *gin.Context) { |
| 90 | response := ScoreLogsResponse{Logs: []ScoreLogsResponseDetails{}} | 107 | response := ScoreLogsResponse{Logs: []ScoreLogsResponseDetails{}} |
| 91 | sql := `SELECT g.id, | 108 | sql := `SELECT g.id, |