提交 v1.3.0 beta
This commit is contained in:
@ -2,8 +2,8 @@ package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
"next-terminal/server/common/nt"
|
||||
|
||||
"next-terminal/server/constant"
|
||||
"next-terminal/server/env"
|
||||
|
||||
"gorm.io/gorm"
|
||||
@ -13,7 +13,7 @@ type baseRepository struct {
|
||||
}
|
||||
|
||||
func (b *baseRepository) GetDB(c context.Context) *gorm.DB {
|
||||
db, ok := c.Value(constant.DB).(*gorm.DB)
|
||||
db, ok := c.Value(nt.DB).(*gorm.DB)
|
||||
if !ok {
|
||||
return env.GetDB()
|
||||
}
|
||||
|
Reference in New Issue
Block a user