添加功能表创建及功能路由

This commit is contained in:
junleea 2025-03-24 13:48:58 +08:00
parent c8c55b4cf4
commit d1a2ab79c9
2 changed files with 14 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import (
"gorm.io/driver/mysql"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"log"
)
var DB *gorm.DB
@ -59,6 +60,11 @@ func Init() error {
fmt.Println("model table:", err)
return err
}
err = db.AutoMigrate(&FunctionModel{})
if err != nil {
log.Println("function model table:", err)
return err
}
err = db.AutoMigrate(&Session{})
if err != nil {

View File

@ -37,6 +37,7 @@ func main() {
handler.SetUpFileGroup(r) // File
handler.SetUpSessionGroup(r) // Session
handler.SetUpModelGroup(r) // Model
handler.SetUpFuncModelGroup(r) // FuncModel
handler.SetUpIMGroup(r) // IM
defer dao.Close()
defer worker.CloseRedis()