2024-02-02 15:42:42 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
type Tag struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-05-15 11:45:49 +00:00
|
|
|
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum,min=4,max=24"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Posts []Post `json:"posts" gorm:"many2many:post_tags"`
|
2024-02-02 15:42:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Category struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-05-15 11:45:49 +00:00
|
|
|
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum,min=4,max=24"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Posts []Post `json:"posts" gorm:"many2many:post_categories"`
|
2024-02-02 15:42:42 +00:00
|
|
|
}
|