26 lines
482 B
Go
26 lines
482 B
Go
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),
|
|
}
|
|
}
|