From 345fa5d06a47837fca48137163f8a7bdae33cebf Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Sun, 18 Jun 2023 17:08:27 +0300 Subject: feat: improved map summary response (#43) --- backend/models/models.go | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'backend/models/models.go') diff --git a/backend/models/models.go b/backend/models/models.go index 49a4f82..5c9b8f8 100644 --- a/backend/models/models.go +++ b/backend/models/models.go @@ -23,7 +23,6 @@ type Map struct { GameName string `json:"game_name"` ChapterName string `json:"chapter_name"` MapName string `json:"map_name"` - Data any `json:"data"` } type MapShort struct { @@ -32,23 +31,9 @@ type MapShort struct { } type MapSummary struct { - Description string `json:"description"` - Showcase string `json:"showcase"` - CategoryScores MapCategoryScores `json:"category_scores"` - Rating float32 `json:"rating"` - Routers []string `json:"routers"` - History []MapHistory `json:"history"` -} - -type MapCategoryScores struct { - CM int `json:"cm"` - NoSLA int `json:"no_sla"` - InboundsSLA int `json:"inbounds_sla"` - Any int `json:"any"` -} - -type MapRecords struct { - Records any `json:"records"` + Rating float32 `json:"rating"` + History []MapHistory `json:"history"` + Routes []MapRoute `json:"routes"` } type MapHistory struct { @@ -57,6 +42,17 @@ type MapHistory struct { Date time.Time `json:"date"` } +type MapRoute struct { + Category Category `json:"category"` + ScoreCount int `json:"score_count"` + Description string `json:"description"` + Showcase string `json:"showcase"` +} + +type MapRecords struct { + Records any `json:"records"` +} + type UserRanking struct { UserID string `json:"user_id"` UserName string `json:"user_name"` @@ -73,6 +69,11 @@ type Chapter struct { Name string `json:"name"` } +type Category struct { + ID int `json:"id"` + Name string `json:"name"` +} + type RecordSP struct { RecordID int `json:"record_id"` Placement int `json:"placement"` -- cgit v1.2.3