直接完成

This commit is contained in:
2022-11-23 20:56:28 +08:00
commit b924e94c63
21 changed files with 829 additions and 0 deletions

22
dao/dao.go Normal file
View File

@@ -0,0 +1,22 @@
package dao
import (
"fmt"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
var DB *gorm.DB
func Setup() {
db, err := gorm.Open(mysql.Open(fmt.Sprintf("%v:%v@tcp(%v:%v)/%v?charset=utf8mb4&parseTime=True&loc=Local",
"integrity",
"integrity",
"202.194.15.130",
3306,
"integrity")), &gorm.Config{})
if err != nil {
panic(err)
}
DB = db
}