diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-06-18 17:08:27 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-06-18 17:08:27 +0300 |
| commit | 345fa5d06a47837fca48137163f8a7bdae33cebf (patch) | |
| tree | 4fc34ecee284610b4c36c30fa11b19095f508c20 /backend/models/models.go | |
| parent | feat: map routes table (#1) (diff) | |
| download | lphub-345fa5d06a47837fca48137163f8a7bdae33cebf.tar.gz lphub-345fa5d06a47837fca48137163f8a7bdae33cebf.tar.bz2 lphub-345fa5d06a47837fca48137163f8a7bdae33cebf.zip | |
feat: improved map summary response (#43)
Diffstat (limited to 'backend/models/models.go')
| -rw-r--r-- | backend/models/models.go | 37 |
1 files changed, 19 insertions, 18 deletions
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 { | |||
| 23 | GameName string `json:"game_name"` | 23 | GameName string `json:"game_name"` |
| 24 | ChapterName string `json:"chapter_name"` | 24 | ChapterName string `json:"chapter_name"` |
| 25 | MapName string `json:"map_name"` | 25 | MapName string `json:"map_name"` |
| 26 | Data any `json:"data"` | ||
| 27 | } | 26 | } |
| 28 | 27 | ||
| 29 | type MapShort struct { | 28 | type MapShort struct { |
| @@ -32,23 +31,9 @@ type MapShort struct { | |||
| 32 | } | 31 | } |
| 33 | 32 | ||
| 34 | type MapSummary struct { | 33 | type MapSummary struct { |
| 35 | Description string `json:"description"` | 34 | Rating float32 `json:"rating"` |
| 36 | Showcase string `json:"showcase"` | 35 | History []MapHistory `json:"history"` |
| 37 | CategoryScores MapCategoryScores `json:"category_scores"` | 36 | Routes []MapRoute `json:"routes"` |
| 38 | Rating float32 `json:"rating"` | ||
| 39 | Routers []string `json:"routers"` | ||
| 40 | History []MapHistory `json:"history"` | ||
| 41 | } | ||
| 42 | |||
| 43 | type MapCategoryScores struct { | ||
| 44 | CM int `json:"cm"` | ||
| 45 | NoSLA int `json:"no_sla"` | ||
| 46 | InboundsSLA int `json:"inbounds_sla"` | ||
| 47 | Any int `json:"any"` | ||
| 48 | } | ||
| 49 | |||
| 50 | type MapRecords struct { | ||
| 51 | Records any `json:"records"` | ||
| 52 | } | 37 | } |
| 53 | 38 | ||
| 54 | type MapHistory struct { | 39 | type MapHistory struct { |
| @@ -57,6 +42,17 @@ type MapHistory struct { | |||
| 57 | Date time.Time `json:"date"` | 42 | Date time.Time `json:"date"` |
| 58 | } | 43 | } |
| 59 | 44 | ||
| 45 | type MapRoute struct { | ||
| 46 | Category Category `json:"category"` | ||
| 47 | ScoreCount int `json:"score_count"` | ||
| 48 | Description string `json:"description"` | ||
| 49 | Showcase string `json:"showcase"` | ||
| 50 | } | ||
| 51 | |||
| 52 | type MapRecords struct { | ||
| 53 | Records any `json:"records"` | ||
| 54 | } | ||
| 55 | |||
| 60 | type UserRanking struct { | 56 | type UserRanking struct { |
| 61 | UserID string `json:"user_id"` | 57 | UserID string `json:"user_id"` |
| 62 | UserName string `json:"user_name"` | 58 | UserName string `json:"user_name"` |
| @@ -73,6 +69,11 @@ type Chapter struct { | |||
| 73 | Name string `json:"name"` | 69 | Name string `json:"name"` |
| 74 | } | 70 | } |
| 75 | 71 | ||
| 72 | type Category struct { | ||
| 73 | ID int `json:"id"` | ||
| 74 | Name string `json:"name"` | ||
| 75 | } | ||
| 76 | |||
| 76 | type RecordSP struct { | 77 | type RecordSP struct { |
| 77 | RecordID int `json:"record_id"` | 78 | RecordID int `json:"record_id"` |
| 78 | Placement int `json:"placement"` | 79 | Placement int `json:"placement"` |