添加功能表创建及功能路由
This commit is contained in:
parent
c8c55b4cf4
commit
d1a2ab79c9
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"gorm.io/driver/mysql"
|
"gorm.io/driver/mysql"
|
||||||
"gorm.io/driver/postgres"
|
"gorm.io/driver/postgres"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
"log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var DB *gorm.DB
|
var DB *gorm.DB
|
||||||
|
|
@ -59,6 +60,11 @@ func Init() error {
|
||||||
fmt.Println("model table:", err)
|
fmt.Println("model table:", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
err = db.AutoMigrate(&FunctionModel{})
|
||||||
|
if err != nil {
|
||||||
|
log.Println("function model table:", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
err = db.AutoMigrate(&Session{})
|
err = db.AutoMigrate(&Session{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
1
main.go
1
main.go
|
|
@ -37,6 +37,7 @@ func main() {
|
||||||
handler.SetUpFileGroup(r) // File
|
handler.SetUpFileGroup(r) // File
|
||||||
handler.SetUpSessionGroup(r) // Session
|
handler.SetUpSessionGroup(r) // Session
|
||||||
handler.SetUpModelGroup(r) // Model
|
handler.SetUpModelGroup(r) // Model
|
||||||
|
handler.SetUpFuncModelGroup(r) // FuncModel
|
||||||
handler.SetUpIMGroup(r) // IM
|
handler.SetUpIMGroup(r) // IM
|
||||||
defer dao.Close()
|
defer dao.Close()
|
||||||
defer worker.CloseRedis()
|
defer worker.CloseRedis()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue