拓展类型

This commit is contained in:
2024-09-25 17:45:38 +08:00
parent a0e898e46c
commit 3b69ba93ad
15 changed files with 214 additions and 40 deletions
+20
View File
@@ -0,0 +1,20 @@
package repo
import (
"gorm.io/gorm"
"work_cation/models"
)
type baseCardRepo struct{}
var BaseCard *baseCardRepo
func (*baseCardRepo) FindAll(db *gorm.DB) []models.BaseCard {
var cards []models.BaseCard
db.Find(&cards)
return cards
}
func (*baseCardRepo) Create(db *gorm.DB, baseCard *models.BaseCard) error {
return db.Create(baseCard).Error
}