mirror of
https://github.com/LiteyukiStudio/spage.git
synced 2025-07-15 18:40:47 +00:00
新增 TODO 事件
新增 Node 数据表
This commit is contained in:
@ -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
|
||||
|
@ -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
11
models/node.go
Normal 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
3
task/node_check.go
Normal file
@ -0,0 +1,3 @@
|
||||
package task
|
||||
|
||||
// TODO 添加节点健康检查任务
|
3
task/node_update.go
Normal file
3
task/node_update.go
Normal file
@ -0,0 +1,3 @@
|
||||
package task
|
||||
|
||||
// TODO 添加节点更新功能
|
Reference in New Issue
Block a user