增加获取表列表方法

This commit is contained in:
2025-09-13 15:14:08 +08:00
parent fcea68c7c7
commit d169f9b9d1
3 changed files with 15 additions and 10 deletions

View File

@@ -0,0 +1,13 @@
package models
// GetAllModels 返回一个包含所有数据库模型实例的切片。
// 这个函数用于在数据库初始化时自动迁移所有的表结构。
func GetAllModels() []interface{} {
return []interface{}{
&User{},
&Device{},
&Plan{},
&SubPlan{},
&Task{},
}
}