2024-02-02 15:42:42 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
type Tag struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-07-07 03:34:37 +00:00
|
|
|
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum"`
|
2024-07-03 14:16:23 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Posts []Post `json:"posts" gorm:"many2many:post_tags"`
|
|
|
|
Articles []Article `json:"articles" gorm:"many2many:article_tags"`
|
2024-02-02 15:42:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Category struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-07-07 03:34:37 +00:00
|
|
|
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum"`
|
2024-07-03 14:16:23 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Posts []Post `json:"posts" gorm:"many2many:post_categories"`
|
|
|
|
Articles []Article `json:"articles" gorm:"many2many:article_categories"`
|
2024-02-02 15:42:42 +00:00
|
|
|
}
|