Commit b384dfb3 authored by hujiebin's avatar hujiebin

Update main.go

parent caca95de
......@@ -4,6 +4,7 @@ import (
"context"
"flag"
"fmt"
"gorm.io/gorm/schema"
"net"
"net/http"
"net/url"
......@@ -548,6 +549,9 @@ func main() {
dsn := appConfig.GetConfigMysql().MYSQL_USERNAME + ":" + appConfig.GetConfigMysql().MYSQL_PASSWORD + "@(" + appConfig.GetConfigMysql().MYSQL_HOST + ")/" + appConfig.GetConfigMysql().MYSQL_DB
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{
Logger: logger.Default.LogMode(logger.Info),
NamingStrategy: schema.NamingStrategy{
SingularTable: true,
},
})
if err != nil {
mylogrus.MyLog.Fatal("mysql connect error %v", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment