feat: establish Orbit models, migrations and development baseline
This commit is contained in:
24
pulse/model/schedule.go
Normal file
24
pulse/model/schedule.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
core "git.yuntuo.hk/k2safe/orbit/model"
|
||||
)
|
||||
|
||||
// Schedule 表示调度计划的当前控制状态,规则内容由不可变版本保存。
|
||||
// 对应表 pulse_schedules;这是服务端持久化模型,不直接作为 API 响应。
|
||||
type Schedule struct {
|
||||
// Record 包含命名空间、记录标识、并发版本和 UTC 时间。
|
||||
core.Record
|
||||
// Name 可读名称,唯一性范围由对应数据表约束。
|
||||
Name string `db:"name"`
|
||||
// CurrentVersion 当前生效的计划版本号,发布时与版本记录原子更新。
|
||||
CurrentVersion uint64 `db:"current_version"`
|
||||
// Paused 暂停标记;停止新的受控工作,不表示在途请求已停止。
|
||||
Paused bool `db:"paused"`
|
||||
// NextFireAt 下一计划触发时间;没有后续触发时为空。
|
||||
NextFireAt *time.Time `db:"next_fire_at"`
|
||||
}
|
||||
|
||||
func (Schedule) TableName() string { return "pulse_schedules" }
|
||||
Reference in New Issue
Block a user