Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct {
TGID int64 `gorm:"primary_key" json:"chat_id"`
CreatedAt time.Time `json:"-"`
DeletedAt *time.Time `json:"-"`
Title string `json:"title"`
Users []User `json:"-"`
Images []Image `gorm:"ForeignKey:ChatID;AssociationForeignKey:TGID" json:"images,omitempty"`
Tags []Tag `gorm:"many2many:chats_tags;AssociationForeignKey:ID;ForeignKey:TGID" json:"tags,omitempty"`
}
type Image ¶
type Image struct {
gorm.Model
Src string `json:"src"`
Tags []Tag `gorm:"many2many:images_tags" json:"tags,omitempty"`
Date time.Time `gorm:"not null" json:"date"`
ChatID int64 `gorm:"not null" json:"chat_id"`
Chat Chat `gorm:"ForeignKey:ChatID;AssociationForeignKey:TGID" json:"-"`
}
func (*Image) CreateImageWithTags ¶
type Tag ¶
type Token ¶
type User ¶
type User struct {
TGID int `gorm:"primary_key" json:"-"`
DeletedAt *time.Time `json:"-"`
CreatedAt time.Time `json:"-"`
Username string `gorm:"size:64" json:"username"`
Chats []Chat `gorm:"many2many:users_chats;AssociationForeignKey:TGID;ForeignKey:TGID"`
Token []Token `gorm:"ForeignKey:ID;AssociationForeignKey:TGID"`
}
Click to show internal directories.
Click to hide internal directories.