summaryrefslogtreecommitdiff
path: root/internal/models
diff options
context:
space:
mode:
authorGrailFinder <wohilas@gmail.com>2024-04-14 09:11:15 +0300
committerGrailFinder <wohilas@gmail.com>2024-04-14 09:11:15 +0300
commitf71a43e1a4cf2fba8a479842d0a61e24017cd87b (patch)
treebbf4fb67119e02f35c117be26f15a0d666b0401f /internal/models
parent9b160dcc0315aaf54a8b4588be9d2a0c98084cf0 (diff)
Feat: db methods and their usage
Diffstat (limited to 'internal/models')
-rw-r--r--internal/models/models.go25
1 files changed, 14 insertions, 11 deletions
diff --git a/internal/models/models.go b/internal/models/models.go
index a2b3628..bd38eaf 100644
--- a/internal/models/models.go
+++ b/internal/models/models.go
@@ -11,19 +11,22 @@ const (
type (
UserScore struct {
- Username string
- Actions []*Action
- BurnTime time.Time
- Score int8
+ ID uint32 `db:"id"`
+ Username string `db:"username"`
+ Actions []Action
+ BurnTime time.Time `db:"burn_time"`
+ Score int8 `db:"score"`
+ CreatedAt time.Time `db:"created_at"`
}
Action struct {
- ID uint32
- Name string
- Magnitude uint8
- Repeatable bool
- Type ActionType
- Done bool
- Username string
+ ID uint32 `db:"id"`
+ Name string `db:"name"`
+ Magnitude uint8 `db:"magnitude"`
+ Repeatable bool `db:"repeatable"`
+ Type ActionType `db:"type"`
+ Done bool `db:"done"`
+ Username string `db:"username"`
+ CreatedAt time.Time `db:"created_at"`
}
)