This commit is contained in:
wangchuxiao
2023-03-15 18:35:06 +08:00
parent 2a60974ebd
commit 74d1d760aa
15 changed files with 97 additions and 83 deletions
+3 -3
View File
@@ -8,15 +8,15 @@ import (
)
type FriendGorm struct {
DB *gorm.DB
*MetaDB
}
func NewFriendGorm(db *gorm.DB) relation.FriendModelInterface {
return &FriendGorm{DB: db}
return &FriendGorm{NewMetaDB(db, &relation.FriendModel{})}
}
func (f *FriendGorm) NewTx(tx any) relation.FriendModelInterface {
return &FriendGorm{DB: tx.(*gorm.DB)}
return &FriendGorm{NewMetaDB(tx.(*gorm.DB), &relation.FriendModel{})}
}
// 插入多条记录