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
+7 -7
View File
@@ -7,19 +7,19 @@ import (
"gorm.io/gorm"
)
func NewObjectHash(db *gorm.DB) relation.ObjectHashModelInterface {
return &ObjectHashGorm{
DB: db,
}
type ObjectHashGorm struct {
*MetaDB
}
type ObjectHashGorm struct {
DB *gorm.DB
func NewObjectHash(db *gorm.DB) relation.ObjectHashModelInterface {
return &ObjectHashGorm{
NewMetaDB(db, &relation.ObjectHashModel{}),
}
}
func (o *ObjectHashGorm) NewTx(tx any) relation.ObjectHashModelInterface {
return &ObjectHashGorm{
DB: tx.(*gorm.DB),
NewMetaDB(tx.(*gorm.DB), &relation.ObjectHashModel{}),
}
}