23 lines
418 B
Go
23 lines
418 B
Go
|
package db
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
type Calories struct {
|
||
|
ChatID int64 `bson:"chat_id"`
|
||
|
Count int `bson:"count"`
|
||
|
CreatedAt time.Time `bson:"created_at"`
|
||
|
Username string `bson:"username"`
|
||
|
}
|
||
|
|
||
|
func NewCalories(
|
||
|
count int,
|
||
|
username string,
|
||
|
) *Calories {
|
||
|
loc, _ := time.LoadLocation("Asia/Novosibirsk")
|
||
|
return &Calories{
|
||
|
Count: count,
|
||
|
Username: username,
|
||
|
CreatedAt: time.Now().In(loc),
|
||
|
}
|
||
|
}
|