Interactive/pkg/models/categories.go

24 lines
888 B
Go
Raw Normal View History

2024-02-02 15:42:42 +00:00
package models
type Tag struct {
BaseModel
2024-03-02 17:23:11 +00:00
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum,min=4,max=24"`
Name string `json:"name"`
Description string `json:"description"`
Articles []Article `json:"articles" gorm:"many2many:article_tags"`
Moments []Moment `json:"moments" gorm:"many2many:moment_tags"`
Comments []Comment `json:"comments" gorm:"many2many:comment_tags"`
2024-02-02 15:42:42 +00:00
}
type Category struct {
BaseModel
2024-03-02 17:23:11 +00:00
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum,min=4,max=24"`
Name string `json:"name"`
Description string `json:"description"`
Articles []Article `json:"articles" gorm:"many2many:article_categories"`
Moments []Moment `json:"moments" gorm:"many2many:moment_categories"`
Comments []Comment `json:"comments" gorm:"many2many:comment_categories"`
2024-02-02 15:42:42 +00:00
}