Archived
1

Work on squads, alerts on new user with empty or spy profile

Closes #1
Closes #2
This commit is contained in:
2017-11-13 22:51:50 +04:00
parent 76b6245b8e
commit 5c08899d25
23 changed files with 338 additions and 19 deletions

View File

@@ -13,7 +13,6 @@ type Player struct {
ID int `db:"id"`
TelegramID int `db:"telegram_id"`
LeagueID int `db:"league_id"`
SquadID int `db:"squad_id"`
Status string `db:"status"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`

24
lib/dbmapping/squads.go Normal file
View File

@@ -0,0 +1,24 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
// Squad is a struct, which represents `squads` table item in databse.
type Squad struct {
ID int `db:"id"`
ChatID int `db:"chat_id"`
AuthorID int `db:"author_id"`
CreatedAt time.Time `db:"created_at"`
}
// SquadChat is a stuct, which combines information about chats and squads
type SquadChat struct {
Squad Squad
Chat Chat
IsSquad bool
}

View File

@@ -0,0 +1,18 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
// stdlib
"time"
)
// SquadPlayer is a struct, which represents `squads_players` table item in databse.
type SquadPlayer struct {
ID int `db:"id"`
SquadID int `db:"squad_id"`
PlayerID int `db:"player_id"`
AuthorID int `db:"author_id"`
CreatedAt time.Time `db:"created_at"`
}