aboutsummaryrefslogtreecommitdiff
path: root/backend/controllers/recordController.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--backend/controllers/recordController.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/backend/controllers/recordController.go b/backend/controllers/recordController.go
index 1cfaa56..27f39fc 100644
--- a/backend/controllers/recordController.go
+++ b/backend/controllers/recordController.go
@@ -18,6 +18,20 @@ import (
18 "google.golang.org/api/drive/v3" 18 "google.golang.org/api/drive/v3"
19) 19)
20 20
21// POST Record
22//
23// @Summary Post record with demo of a specific map.
24// @Accept mpfd
25// @Produce json
26// @Param demos formData []file true "Demos"
27// @Param score_count formData int true "Score Count"
28// @Param score_time formData int true "Score Time"
29// @Param is_partner_orange formData boolean true "Is Partner Orange"
30// @Param partner_id formData string true "Partner ID"
31// @Success 200 {object} models.Response{data=models.RecordRequest}
32// @Failure 400 {object} models.Response
33// @Failure 401 {object} models.Response
34// @Router /maps/{id}/record [post]
21func CreateRecordWithDemo(c *gin.Context) { 35func CreateRecordWithDemo(c *gin.Context) {
22 mapId := c.Param("id") 36 mapId := c.Param("id")
23 // Check if user exists 37 // Check if user exists
@@ -176,6 +190,15 @@ func CreateRecordWithDemo(c *gin.Context) {
176 return 190 return
177} 191}
178 192
193// GET Demo
194//
195// @Summary Get demo with specified demo uuid.
196// @Accept json
197// @Produce octet-stream
198// @Param uuid path int true "Demo UUID"
199// @Success 200 {file} binary "Demo File"
200// @Failure 400 {object} models.Response
201// @Router /demo [get]
179func DownloadDemoWithID(c *gin.Context) { 202func DownloadDemoWithID(c *gin.Context) {
180 uuid := c.Query("uuid") 203 uuid := c.Query("uuid")
181 var locationID string 204 var locationID string