1package storage 2 3type PostgresGuild struct { 4 GuildID uint64 `db:"guild_id"` 5 GuildName string `db:"guild_name"` 6 Premium int16 `db:"premium"` 7 TxTimeUnix *int32 `db:"tx_time_unix"` 8} 9 10type PostgresGame struct { 11 GameID int64 `db:"game_id"` 12 GuildID uint64 `db:"guild_id"` 13 ConnectCode string `db:"connect_code"` 14 StartTime int32 `db:"start_time"` 15 WinType int16 `db:"win_type"` 16 EndTime int32 `db:"end_time"` 17} 18 19type PostgresUser struct { 20 UserID uint64 `db:"user_id"` 21 Opt bool `db:"opt"` 22} 23 24type PostgresUserGame struct { 25 UserID uint64 `db:"user_id"` 26 GuildID uint64 `db:"guild_id"` 27 GameID int64 `db:"game_id"` 28 PlayerName string `db:"player_name"` 29 PlayerColor int16 `db:"player_color"` 30 PlayerRole int16 `db:"player_role"` 31 PlayerWon bool `db:"player_won"` 32} 33 34type PostgresGameEvent struct { 35 EventID uint64 `db:"event_id"` 36 UserID *uint64 `db:"user_id"` 37 GameID int64 `db:"game_id"` 38 EventTime int32 `db:"event_time"` 39 EventType int16 `db:"event_type"` 40 Payload string `db:"payload"` 41} 42 43type PostgresOtherPlayerRanking struct { 44 UserID uint64 `db:"user_id"` 45 Count int64 `db:"count"` 46 Percent float64 `db:"percent"` 47} 48 49type PostgresPlayerRanking struct { 50 UserID uint64 `db:"user_id"` 51 WinCount int64 `db:"win"` 52 Count int64 `db:"total"` 53 WinRate float64 `db:"win_rate"` 54} 55 56type PostgresBestTeammatePlayerRanking struct { 57 UserID uint64 `db:"user_id"` 58 TeammateID uint64 `db:"teammate_id"` 59 WinCount int64 `db:"win"` 60 Count int64 `db:"total"` 61 WinRate float64 `db:"win_rate"` 62} 63 64type PostgresWorstTeammatePlayerRanking struct { 65 UserID uint64 `db:"user_id"` 66 TeammateID uint64 `db:"teammate_id"` 67 LooseCount int64 `db:"loose"` 68 Count int64 `db:"total"` 69 LooseRate float64 `db:"loose_rate"` 70} 71 72type PostgresUserActionRanking struct { 73 UserID uint64 `db:"user_id"` 74 TotalAction int64 `db:"total_action"` 75 Count int64 `db:"total"` 76 WinRate float64 `db:"win_rate"` 77} 78 79type PostgresUserMostFrequentFirstTargetRanking struct { 80 UserID uint64 `db:"user_id"` 81 TotalDeath int64 `db:"total_death"` 82 Count int64 `db:"total"` 83 DeathRate float64 `db:"death_rate"` 84} 85 86type PostgresUserMostFrequentKilledByanking struct { 87 UserID uint64 `db:"user_id"` 88 TeammateID uint64 `db:"teammate_id"` 89 TotalDeath int64 `db:"total_death"` 90 Encounter int64 `db:"encounter"` 91 DeathRate float64 `db:"death_rate"` 92} 93