Archived
1

Move rarely changed data to datamappings, fix profile updating

As result of profile format change, introduced in game update yesterday we need to change profile regexp.

As result of some refactoring, rarely changed data removed from database and added to sources of bot.
This commit is contained in:
2018-03-31 08:34:27 +04:00
parent 8d78ef37f1
commit c9855116da
27 changed files with 460 additions and 237 deletions

View File

@@ -1,17 +0,0 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
"time"
)
// Element is a struct, which represents `elements` table item in databse.
type Element struct {
ID int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"name"`
LeagueID int `db:"league_id"`
CreatedAt *time.Time `db:"created_at"`
}

View File

@@ -1,16 +0,0 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
"time"
)
// League is a struct, which represents `leagues` table item in databse.
type League struct {
ID int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"name"`
CreatedAt *time.Time `db:"created_at"`
}

View File

@@ -1,16 +0,0 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
"time"
)
// Location is a struct, which represents `locations` table item in databse.
type Location struct {
ID int `db:"id"`
Symbol string `db:"symbol"`
Name string `db:"name"`
CreatedAt time.Time `db:"created_at"`
}

View File

@@ -4,6 +4,7 @@
package dbmapping
import (
"source.wtfteam.pro/i2_bot/i2_bot/lib/datamapping"
"time"
)
@@ -21,6 +22,6 @@ type Player struct {
type PlayerProfile struct {
Player Player
Profile Profile
League League
League datamapping.League
HaveProfile bool
}

View File

@@ -4,6 +4,7 @@
package dbmapping
import (
"source.wtfteam.pro/i2_bot/i2_bot/lib/datamapping"
"time"
)
@@ -28,6 +29,6 @@ type Pokememe struct {
// PokememeFull is a struct for handling pokememe with all informations about locations and elements
type PokememeFull struct {
Pokememe Pokememe
Locations []Location
Elements []Element
Locations []datamapping.Location
Elements []datamapping.Element
}

View File

@@ -1,17 +0,0 @@
// i2_bot Instinct PokememBro Bot
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
package dbmapping
import (
"time"
)
// Weapon is a struct, which represents `weapons` table item in databse.
type Weapon struct {
ID int `db:"id"`
Name string `db:"name"`
Power int `db:"power"`
Price int `db:"price"`
CreatedAt time.Time `db:"created_at"`
}