增加获取表列表方法
This commit is contained in:
13
internal/infra/models/models.go
Normal file
13
internal/infra/models/models.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package models
|
||||
|
||||
// GetAllModels 返回一个包含所有数据库模型实例的切片。
|
||||
// 这个函数用于在数据库初始化时自动迁移所有的表结构。
|
||||
func GetAllModels() []interface{} {
|
||||
return []interface{}{
|
||||
&User{},
|
||||
&Device{},
|
||||
&Plan{},
|
||||
&SubPlan{},
|
||||
&Task{},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user