Interactive/pkg/internal/models/categories.go

22 lines
593 B
Go
Raw Normal View History

2024-02-02 15:42:42 +00:00
package models
import "git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
2024-02-02 15:42:42 +00:00
type Tag struct {
cruda.BaseModel
2024-02-02 15:42:42 +00:00
2024-07-21 06:47:51 +00:00
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase"`
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 {
cruda.BaseModel
2024-02-02 15:42:42 +00:00
2024-07-21 06:47:51 +00:00
Alias string `json:"alias" gorm:"uniqueIndex" validate:"lowercase,alphanum"`
Name string `json:"name"`
Description string `json:"description"`
Posts []Post `json:"posts" gorm:"many2many:post_categories"`
2024-02-02 15:42:42 +00:00
}