新增 TODO 事件

新增 Node 数据表
This commit is contained in:
2025-06-05 15:30:30 +08:00
parent ff5e1533f0
commit e2bbbf79e7
5 changed files with 22 additions and 0 deletions

View File

@ -16,11 +16,14 @@ func main() {
return
}
// 初始化数据相关
if err := store.Init(); err != nil {
logrus.Panicf("failed to init data store: %v", err)
return
}
// TODO 创建节点检查任务 task/node_check.go
if err := router.Run(); err != nil {
logrus.Panicf("failed to run router: %v", err)
return

View File

@ -19,6 +19,8 @@ func Migrate(db *gorm.DB) error {
// site.go
&Site{},
&SiteRelease{},
// node.go
&Node{},
); err != nil {
return err
}

11
models/node.go Normal file
View File

@ -0,0 +1,11 @@
package models
import "gorm.io/gorm"
type Node struct {
gorm.Model
Token string `gorm:"unique;not null"` // 节点创建Token
Name string `gorm:"not null"` // 节点名称
Host string `gorm:"not null"`
Port int `gorm:"not null"`
}

3
task/node_check.go Normal file
View File

@ -0,0 +1,3 @@
package task
// TODO 添加节点健康检查任务

3
task/node_update.go Normal file
View File

@ -0,0 +1,3 @@
package task
// TODO 添加节点更新功能