支持表单数形式

This commit is contained in:
suguo.yao 2022-05-11 20:00:20 +08:00
parent e856a26dd6
commit 8c955c89ea
1 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import (
"gorm.io/driver/mysql"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"gorm.io/gorm/schema"
"gorm.io/plugin/dbresolver"
)
@ -49,6 +50,9 @@ func New() (*gorm.DB, error) {
_db, err = gorm.Open(mysql.Open(_conf.ConnString), &gorm.Config{
SkipDefaultTransaction: true,
Logger: logger.Default.LogMode(logger.Silent),
NamingStrategy: schema.NamingStrategy{
SingularTable: true,
},
})
if err != nil {
return nil, err