完成重构数据库操作代码

This commit is contained in:
dushixiang
2021-03-19 20:22:04 +08:00
parent 25b8381a4f
commit 2eb4dc3969
37 changed files with 294 additions and 329 deletions

View File

@ -2,7 +2,6 @@ package repository
import (
"gorm.io/gorm"
"next-terminal/server/global"
"next-terminal/server/model"
)
@ -21,6 +20,6 @@ func (r NumRepository) FindAll() (o []model.Num, err error) {
}
func (r NumRepository) Create(o *model.Num) (err error) {
err = global.DB.Create(o).Error
err = r.DB.Create(o).Error
return
}