improve the functions related to commenting on images

This commit is contained in:
landaiqing
2024-09-23 00:53:43 +08:00
parent 8d5d918a7d
commit 7aae53e533
32 changed files with 1004 additions and 86 deletions

View File

@@ -2,6 +2,7 @@ package core
import (
"fmt"
"github.com/acmestack/gorm-plus/gplus"
"gorm.io/driver/mysql"
"gorm.io/gorm"
"gorm.io/gorm/logger"
@@ -61,5 +62,7 @@ func MySQlConnect() *gorm.DB {
sqlDB.SetMaxIdleConns(global.CONFIG.MySQL.MaxIdleConnes)
sqlDB.SetMaxOpenConns(global.CONFIG.MySQL.MaxOpenConnes)
sqlDB.SetConnMaxLifetime(time.Hour * 4) //连接最大复用时间
// 初始化gplus
gplus.Init(db)
return db
}