拓展类型
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user