Files
ppgo_job/model/entity/task.go
T
lmk 610b85e3a5 refactor: 从 Beego 迁移到 GoFrame v2
- 替换 Beego 框架为 GoFrame v2
- 重构项目结构: controller/service/dao/middleware 分层
- 替换自定义 crons 包为 gcron
- 模板从 views/ 迁移到 resource/template/
- 配置从 conf/app.conf 迁移到 config.yml
- 数据库从 MySQL 切换为 SQLite (modernc.org/sqlite)
- 移除 agent/ 远程执行器(待后续迁移)
- 移除 crons/ 自定义定时器包
- 静态资源整理到 resource/static/
2026-07-09 11:06:12 +08:00

58 lines
2.3 KiB
Go

package entity
// Task 定时任务
type Task struct {
Id int `orm:"id" json:"id"`
GroupId int `orm:"group_id" json:"groupId"`
ServerIds string `orm:"server_ids" json:"serverIds"`
ServerType int `orm:"server_type" json:"serverType"`
TaskName string `orm:"task_name" json:"taskName"`
Description string `orm:"description" json:"description"`
CronSpec string `orm:"cron_spec" json:"cronSpec"`
Concurrent int `orm:"concurrent" json:"concurrent"`
Command string `orm:"command" json:"command"`
Timeout int `orm:"timeout" json:"timeout"`
ExecuteTimes int `orm:"execute_times" json:"executeTimes"`
PrevTime int64 `orm:"prev_time" json:"prevTime"`
Status int `orm:"status" json:"status"`
IsNotify int `orm:"is_notify" json:"isNotify"`
NotifyType int `orm:"notify_type" json:"notifyType"`
NotifyTplId int `orm:"notify_tpl_id" json:"notifyTplId"`
NotifyUserIds string `orm:"notify_user_ids" json:"notifyUserIds"`
CreateId int `orm:"create_id" json:"createId"`
UpdateId int `orm:"update_id" json:"updateId"`
CreateTime int64 `orm:"create_time" json:"createTime"`
UpdateTime int64 `orm:"update_time" json:"updateTime"`
}
// TaskCols 字段常量
var TaskCols = struct {
Id, GroupId, ServerIds, ServerType, TaskName string
Description, CronSpec, Concurrent, Command string
Timeout, ExecuteTimes, PrevTime, Status string
IsNotify, NotifyType, NotifyTplId, NotifyUserIds string
CreateId, UpdateId, CreateTime, UpdateTime string
}{
Id: "id",
GroupId: "group_id",
ServerIds: "server_ids",
ServerType: "server_type",
TaskName: "task_name",
Description: "description",
CronSpec: "cron_spec",
Concurrent: "concurrent",
Command: "command",
Timeout: "timeout",
ExecuteTimes: "execute_times",
PrevTime: "prev_time",
Status: "status",
IsNotify: "is_notify",
NotifyType: "notify_type",
NotifyTplId: "notify_tpl_id",
NotifyUserIds: "notify_user_ids",
CreateId: "create_id",
UpdateId: "update_id",
CreateTime: "create_time",
UpdateTime: "update_time",
}