完成基本的创建使用功能
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package repo
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"work_cation/models"
|
||||
)
|
||||
|
||||
type ErlangCard struct{}
|
||||
|
||||
var ErlangCardRepo *ErlangCard
|
||||
|
||||
func (*ErlangCard) FindAll(db *gorm.DB) []models.ErlangCards {
|
||||
var cards []models.ErlangCards
|
||||
db.Find(&cards)
|
||||
return cards
|
||||
}
|
||||
|
||||
func (*ErlangCard) Create(db *gorm.DB, erlangCard *models.ErlangCards) error {
|
||||
return db.Create(erlangCard).Error
|
||||
}
|
||||
Reference in New Issue
Block a user