add struct
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-06 17:36:57 +07:00
parent b771745c47
commit 64345c9350
13 changed files with 7 additions and 34 deletions
+25
View File
@@ -0,0 +1,25 @@
package db
import "time"
type Workout struct {
ChatID int64 `bson:"chat_id"`
Name string `bson:"name"`
Count int `bson:"count"`
CreatedAt time.Time `bson:"created_at"`
Username string `bson:"username"`
}
func NewWorkout(
name string,
count int,
username string,
) *Workout {
loc, _ := time.LoadLocation("Asia/Novosibirsk")
return &Workout{
Name: name,
Count: count,
Username: username,
CreatedAt: time.Now().In(loc),
}
}