Archived
1

Database connections, refactoring, pokememe parsing in progress

This commit is contained in:
Vladimir Hodakov
2017-10-06 02:56:06 +04:00
parent 4fec8f0fe7
commit fe496d696f
29 changed files with 842 additions and 18 deletions

View File

@@ -0,0 +1,17 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmappings
import (
// stdlib
"time"
)
type Elements struct {
Id int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"name"`
League_id int `db:"league_id"`
Created_at *time.Time `db:"created_at"`
}

16
lib/dbmappings/leagues.go Normal file
View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmappings
import (
// stdlib
"time"
)
type Leagues struct {
Id int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"league_id"`
Created_at *time.Time `db:"created_at"`
}

View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmappings
import (
// stdlib
"time"
)
type Locations struct {
Id int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"league_id"`
Created_at *time.Time `db:"created_at"`
}

19
lib/dbmappings/players.go Normal file
View File

@@ -0,0 +1,19 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmappings
import (
// stdlib
"time"
)
type Players struct {
Id int `db:"id"`
Telegram_id int `db:"telegram_id"`
League_id int `db:"league_id"`
Squad_id int `db:"squad_id"`
Status string `db:"status"`
Created_at *time.Time `db:"created_at"`
Updated_at *time.Time `db:"updated_at"`
}

View File

@@ -0,0 +1,25 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmappings
import (
// stdlib
"time"
)
type Pokememes struct {
Id int `db:"id"`
Grade int `db:"grade"`
Name string `db:"league_id"`
Description string `db:"description"`
Attack int `db:"attack"`
HP int `db:"int"`
MP int `db:"mp"`
Defence int `db:"defence"`
Price int `db:"price"`
Purchaseable bool `db:"purchaseable"`
Image_url string `db:"image_url"`
Player_id int `db:"player_id"`
Created_at *time.Time `db:"created_at"`
}

View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmappings
import (
// stdlib
"time"
)
type PokememesElements struct {
Id int `db:"id"`
Pokememe_id int `db:"pokememe_id"`
Element_id int `db:"element_id"`
Created_at *time.Time `db:"created_at"`
}

View File

@@ -0,0 +1,16 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmappings
import (
// stdlib
"time"
)
type PokememesLocations struct {
Id int `db:"id"`
Pokememe_id int `db:"pokememe_id"`
Location_id int `db:"location_id"`
Created_at *time.Time `db:"created_at"`
}

View File

@@ -0,0 +1,23 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmappings
import (
// stdlib
"time"
)
type Profiles struct {
Id int `db:"id"`
Player_id int `db:"player_id"`
Nickname string `db:"nickname"`
TelegramNickname string `db:"telegram_nickname"`
Level_id int `db:"level_id"`
Exp int `db:"exp"`
Egg_exp int `db:"egg_exp"`
Power int `db:"power"`
Weapon_id int `db:"weapon_id"`
Crystalls int `db:"crystalls"`
Created_at *time.Time `db:"created_at"`
}