Moved to Tongo wrapper

This commit is contained in:
2023-02-14 00:50:21 +03:00
parent 7e8b026c5e
commit 15a27af994
7 changed files with 133 additions and 80 deletions

View File

@ -1,20 +1,33 @@
package db
import (
"time"
"git.nefrace.ru/nefrace/tongo"
)
type Chat struct {
Id int64
Title string
TopicId int64 `bson:"topic_id"`
tongo.Item `bson:",inline"`
ChatId int64
Title string
TopicId int64 `bson:"topic_id"`
}
func (Chat) Coll() string { return "chats" }
type User struct {
Id int64
ChatId int64 `bson:"chat_id"`
Username string `bson:"username"`
FirstName string `bson:"first_name"`
LastName string `bson:"last_name"`
CorrectAnswer int8 `bson:"correct_answer"`
CaptchaMessage int `bson:"captcha_message"`
IsBanned bool `bson:"is_banned"`
DateJoined int64 `bson:"date_joined"`
JoinedMessage int `bson:"joined_message"`
tongo.Item `bson:",inline"`
UserId int64 `bson:"user_id"`
ChatId int64 `bson:"chat_id"`
Username string `bson:"username"`
FirstName string `bson:"first_name"`
LastName string `bson:"last_name"`
CorrectAnswer int8 `bson:"correct_answer"`
CaptchaMessage int `bson:"captcha_message"`
IsBanned bool `bson:"is_banned"`
DateJoined time.Time `bson:"date_joined"`
JoinedMessage int `bson:"joined_message"`
LastNotification time.Time `bson:"last_notification"`
}
func (User) Coll() string { return "users" }