mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-24 15:30:24 +08:00
实现基础的智能调度
This commit is contained in:
32
internal/db/models/node_action_model.go
Normal file
32
internal/db/models/node_action_model.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package models
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
// NodeAction 节点智能调度设置
|
||||
type NodeAction struct {
|
||||
Id uint64 `field:"id"` // ID
|
||||
NodeId uint64 `field:"nodeId"` // 节点ID
|
||||
Role string `field:"role"` // 角色
|
||||
IsOn bool `field:"isOn"` // 是否启用
|
||||
Conds dbs.JSON `field:"conds"` // 条件
|
||||
Action dbs.JSON `field:"action"` // 动作
|
||||
Duration dbs.JSON `field:"duration"` // 持续时间
|
||||
Order uint32 `field:"order"` // 排序
|
||||
State uint8 `field:"state"` // 状态
|
||||
}
|
||||
|
||||
type NodeActionOperator struct {
|
||||
Id any // ID
|
||||
NodeId any // 节点ID
|
||||
Role any // 角色
|
||||
IsOn any // 是否启用
|
||||
Conds any // 条件
|
||||
Action any // 动作
|
||||
Duration any // 持续时间
|
||||
Order any // 排序
|
||||
State any // 状态
|
||||
}
|
||||
|
||||
func NewNodeActionOperator() *NodeActionOperator {
|
||||
return &NodeActionOperator{}
|
||||
}
|
||||
Reference in New Issue
Block a user