aboutsummaryrefslogtreecommitdiff
path: root/backend/models
diff options
context:
space:
mode:
Diffstat (limited to 'backend/models')
-rw-r--r--backend/models/models.go49
1 files changed, 40 insertions, 9 deletions
diff --git a/backend/models/models.go b/backend/models/models.go
index 2d14a06..be6265f 100644
--- a/backend/models/models.go
+++ b/backend/models/models.go
@@ -16,7 +16,7 @@ type LoginResponse struct {
16 16
17type User struct { 17type User struct {
18 SteamID string `json:"steam_id"` 18 SteamID string `json:"steam_id"`
19 Username string `json:"username"` 19 UserName string `json:"user_name"`
20 AvatarLink string `json:"avatar_link"` 20 AvatarLink string `json:"avatar_link"`
21 CountryCode string `json:"country_code"` 21 CountryCode string `json:"country_code"`
22 CreatedAt time.Time `json:"created_at"` 22 CreatedAt time.Time `json:"created_at"`
@@ -24,18 +24,45 @@ type User struct {
24} 24}
25 25
26type Map struct { 26type Map struct {
27 ID int `json:"id"` 27 ID int `json:"id"`
28 Name string `json:"name"` 28 GameName string `json:"game_name"`
29 ScoreWR int `json:"wr_score"` 29 ChapterName string `json:"chapter_name"`
30 TimeWR int `json:"wr_time"` 30 MapName string `json:"map_name"`
31 IsCoop bool `json:"is_coop"` 31 Data any `json:"data"`
32 Records any `json:"records"` 32}
33
34type MapSummary struct {
35 Description string `json:"description"`
36 Showcase string `json:"showcase"`
37 CategoryScores MapCategoryScores `json:"category_scores"`
38 Rating float32 `json:"rating"`
39 Routers []string `json:"routers"`
40 History []MapHistory `json:"history"`
41}
42
43type 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
50type MapRecords struct {
51 Records any `json:"records"`
52}
53
54type MapHistory struct {
55 RunnerName string `json:"runner_name"`
56 ScoreCount int `json:"score_count"`
57 Date time.Time `json:"date"`
33} 58}
34 59
35type RecordSP struct { 60type RecordSP struct {
36 RecordID int `json:"record_id"` 61 RecordID int `json:"record_id"`
37 Placement int `json:"placement"` 62 Placement int `json:"placement"`
38 UserID string `json:"user_id"` 63 UserID string `json:"user_id"`
64 UserName string `json:"user_name"`
65 UserAvatar string `json:"user_avatar"`
39 ScoreCount int `json:"score_count"` 66 ScoreCount int `json:"score_count"`
40 ScoreTime int `json:"score_time"` 67 ScoreTime int `json:"score_time"`
41 DemoID string `json:"demo_id"` 68 DemoID string `json:"demo_id"`
@@ -46,7 +73,11 @@ type RecordMP struct {
46 RecordID int `json:"record_id"` 73 RecordID int `json:"record_id"`
47 Placement int `json:"placement"` 74 Placement int `json:"placement"`
48 HostID string `json:"host_id"` 75 HostID string `json:"host_id"`
76 HostName string `json:"host_name"`
77 HostAvatar string `json:"host_avatar"`
49 PartnerID string `json:"partner_id"` 78 PartnerID string `json:"partner_id"`
79 PartnerName string `json:"partner_name"`
80 PartnerAvatar string `json:"partner_avatar"`
50 ScoreCount int `json:"score_count"` 81 ScoreCount int `json:"score_count"`
51 ScoreTime int `json:"score_time"` 82 ScoreTime int `json:"score_time"`
52 HostDemoID string `json:"host_demo_id"` 83 HostDemoID string `json:"host_demo_id"`
@@ -63,7 +94,7 @@ type RecordRequest struct {
63 94
64type UserRanking struct { 95type UserRanking struct {
65 UserID string `json:"user_id"` 96 UserID string `json:"user_id"`
66 Username string `json:"username"` 97 UserName string `json:"user_name"`
67 TotalScore int `json:"total_score"` 98 TotalScore int `json:"total_score"`
68} 99}
69 100
@@ -75,7 +106,7 @@ type RankingsResponse struct {
75type ProfileResponse struct { 106type ProfileResponse struct {
76 Profile bool `json:"profile"` 107 Profile bool `json:"profile"`
77 SteamID string `json:"steam_id"` 108 SteamID string `json:"steam_id"`
78 Username string `json:"username"` 109 UserName string `json:"user_name"`
79 AvatarLink string `json:"avatar_link"` 110 AvatarLink string `json:"avatar_link"`
80 CountryCode string `json:"country_code"` 111 CountryCode string `json:"country_code"`
81 ScoresSP []ScoreResponse `json:"scores_sp"` 112 ScoresSP []ScoreResponse `json:"scores_sp"`