Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
add api接口
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoo committed Nov 28, 2021
1 parent 736402f commit 18f9b91
Show file tree
Hide file tree
Showing 7 changed files with 304 additions and 189 deletions.
2 changes: 1 addition & 1 deletion Config/dbConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func dbInit() {
var err error
conn := ""
if CoreConfig.DBConfig.DBType == "mysql" {
conn = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?parseTime=True&loc=Local", CoreConfig.DBConfig.DBUserName, CoreConfig.DBConfig.DBPassword, CoreConfig.DBConfig.DBIP, CoreConfig.DBConfig.DBPort, CoreConfig.DBConfig.DBName)
conn = fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=utf8mb4&parseTime=True&loc=Local", CoreConfig.DBConfig.DBUserName, CoreConfig.DBConfig.DBPassword, CoreConfig.DBConfig.DBIP, CoreConfig.DBConfig.DBPort, CoreConfig.DBConfig.DBName)
DB, err = gorm.Open(mysql.Open(conn), &gorm.Config{})
} else if CoreConfig.DBConfig.DBType == "sqlite3" {
conn = fmt.Sprintf("./%v.db", CoreConfig.DBConfig.DBName)
Expand Down
Loading

0 comments on commit 18f9b91

Please sign in to comment.