valera/internal/db/weight.go

23 lines
417 B
Go
Raw Permalink Normal View History

2023-04-09 08:48:31 +00:00
package db
import "time"
type Weight struct {
ChatID int64 `bson:"chat_id"`
Weight float64 `bson:"weight"`
CreatedAt time.Time `bson:"created_at"`
Username string `bson:"username"`
}
func NewWeight(
weight float64,
username string,
) *Weight {
loc, _ := time.LoadLocation("Asia/Novosibirsk")
return &Weight{
Weight: weight,
Username: username,
CreatedAt: time.Now().In(loc),
}
}