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

This commit is contained in:
2023-04-09 15:48:31 +07:00
parent ada1a97999
commit a35a5c8efc
9 changed files with 171 additions and 20 deletions
+22
View File
@@ -0,0 +1,22 @@
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),
}
}