Initial commit

This commit is contained in:
2025-05-11 20:32:14 +08:00
commit d97247159f
80 changed files with 13013 additions and 0 deletions

21
server/model/tag.go Normal file
View File

@@ -0,0 +1,21 @@
package model
import "gorm.io/gorm"
type Tag struct {
gorm.Model
Name string `gorm:"unique"`
Resources []Resource `gorm:"many2many:resource_tags;"`
}
type TagView struct {
ID uint `json:"id"`
Name string `json:"name"`
}
func (t *Tag) ToView() *TagView {
return &TagView{
ID: t.ID,
Name: t.Name,
}
}