重新初始化项目

This commit is contained in:
2023-04-27 15:56:12 +08:00
parent 10546eb629
commit d6e256ef9e
50 changed files with 1255 additions and 308 deletions

View File

@@ -6,5 +6,4 @@ import "Lee-WineList/client"
func initClient() {
client.InitMySQLClient()
client.InitRedisClient()
//client.InitPostgreSQLClient()
}

View File

@@ -9,9 +9,9 @@ import (
// 初始化数据库表
func databaseTable() {
dbs := []any{
entity.User{},
entity.AdminUser{},
entity.OAuth2Client{},
new(entity.User), // 普通用户
new(entity.OAuth2Client), // OAuth2客户端
}
if err := client.MySQL.AutoMigrate(dbs...); err != nil {

View File

@@ -2,7 +2,7 @@ package initialize
// InitSystem 初始化系统
func InitSystem() {
initLocaConfig() // 初始化本地配置
initLocaConfig() // 初始化配置
initClient() // 初始化连接池等信息
databaseTable() // 初始化数据库表信息
}