2021-12-06 11:46:11 +03:00
|
|
|
package db
|
|
|
|
|
2023-02-14 00:50:21 +03:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"git.nefrace.ru/nefrace/tongo"
|
|
|
|
)
|
|
|
|
|
2021-12-06 11:46:11 +03:00
|
|
|
type Chat struct {
|
2023-02-14 00:50:21 +03:00
|
|
|
tongo.Item `bson:",inline"`
|
|
|
|
ChatId int64
|
|
|
|
Title string
|
|
|
|
TopicId int64 `bson:"topic_id"`
|
2021-12-06 11:46:11 +03:00
|
|
|
}
|
|
|
|
|
2023-02-14 00:50:21 +03:00
|
|
|
func (Chat) Coll() string { return "chats" }
|
|
|
|
|
2021-12-06 11:46:11 +03:00
|
|
|
type User struct {
|
2023-02-14 00:50:21 +03:00
|
|
|
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"`
|
2021-12-07 10:30:23 +03:00
|
|
|
}
|
2023-02-14 00:50:21 +03:00
|
|
|
|
|
|
|
func (User) Coll() string { return "users" }
|