代码拉取完成,页面将自动刷新
package schema
import (
"gitee.com/linqwen/momo/base"
)
type ScheduleDTO struct {
Name string `gorm:"column:name" json:"Name" form:"Name" comment:"任务名"`
Url string `gorm:"column:url" json:"Url" form:"Url" comment:"url" validate:"required"`
Method string `gorm:"column:method" json:"Method" form:"Method" comment:"method" validate:"required"`
Params string `gorm:"column:params" json:"Params" form:"Params" comment:"Params"`
Headers string `gorm:"column:headers" json:"Headers" form:"Headers" comment:"Headers"`
Timeout int `gorm:"column:timeout" json:"Timeout" form:"Timeout" comment:"Timeout"`
Cron string `gorm:"column:cron" json:"Cron" form:"Cron" comment:"cron" validate:"omitempty,min=6,max=20"`
ExecutorStrategy int `gorm:"column:executor_strategy" json:"ExecutorStrategy" form:"ExecutorStrategy" comment:"执行策略"`
Status int `gorm:"column:status;default:0" json:"Status" form:"Status" comment:"状态"`
CronId int `gorm:"column:cron_id" json:"CronId" form:"CronId" comment:"CronId"`
LastRun string `gorm:"column:last_run" json:"LastRun" form:"LastRun" comment:"LastRun"`
NextRun string `gorm:"column:next_run" json:"NextRun" form:"NextRun" comment:"NextRun"`
}
type ScheduleVO struct {
Id int64 `gorm:"primaryKey;autoIncrement:false" json:"Id,string"`
Name string `gorm:"column:name" json:"Name" form:"Name" comment:"任务名"`
Url string `gorm:"column:url" json:"Url" form:"Url" comment:"url"`
Method string `gorm:"column:method" json:"Method" form:"Method" comment:"method"`
Params string `gorm:"column:params" json:"Params" form:"Params" comment:"Params"`
Headers string `gorm:"column:headers" json:"Headers" form:"Headers" comment:"Headers"`
Timeout int `gorm:"column:timeout" json:"Timeout" form:"Timeout" comment:"Timeout"`
Cron string `gorm:"column:cron" json:"Cron" form:"Cron" comment:"cron"`
ExecutorStrategy int `gorm:"column:executor_strategy" json:"ExecutorStrategy" form:"ExecutorStrategy" comment:"执行策略"`
Status int `gorm:"column:status;default:0" json:"Status" form:"Status" comment:"状态"`
CronId int `gorm:"column:cron_id" json:"CronId" form:"CronId" comment:"CronId"`
LastRun string `gorm:"column:last_run" json:"LastRun" form:"LastRun" comment:"LastRun"`
NextRun string `gorm:"column:next_run" json:"NextRun" form:"NextRun" comment:"NextRun"`
CreatedAt base.ISO8601Time
UpdatedAt base.ISO8601Time
}
func (c ScheduleVO) GetDetailVO() interface{} {
// createTime := c.CreatedAt.WithFormat("2006-01-02 15:04:05")
// c.CreatedAt = createTime
return c
}
func (c ScheduleVO) GetListVO() interface{} {
// createTime := c.CreatedAt.WithFormat("2006-01-02 15:04:05")
// c.CreatedAt = createTime
// fmt.Printf("c is %+v\n", c)
return c
}
type ScheduleLogDTO struct {
ScheduleId int64 `gorm:"column:schedule_id" json:"ScheduleId,string" form:"ScheduleId" comment:"ScheduleId"`
EndAt base.ISO8601Time `gorm:"column:end_at" json:"EndAt" form:"EndAt" comment:"EndAt"`
StatusCode int `gorm:"column:status_code;default:0" json:"StatusCode" form:"StatusCode" comment:"StatusCode"`
Message string `gorm:"column:message" json:"Message" form:"Message" comment:"Message"`
RunStatus string `gorm:"column:run_status" json:"RunStatus" form:"RunStatus" comment:"RunStatus"`
CronId int `gorm:"column:cron_id" json:"CronId" form:"CronId" comment:"CronId"`
LastRun string `gorm:"column:last_run" json:"LastRun" form:"LastRun" comment:"LastRun"`
NextRun string `gorm:"column:next_run" json:"NextRun" form:"NextRun" comment:"NextRun"`
CreatedAt base.ISO8601Time
}
type ScheduleLogVO struct {
Id int64 `gorm:"primaryKey;autoIncrement:false" json:"Id,string"`
ScheduleId int64 `gorm:"column:schedule_id" json:"ScheduleId,string" form:"ScheduleId" comment:"ScheduleId"`
EndAt base.ISO8601Time `gorm:"column:end_at" json:"EndAt" form:"EndAt" comment:"EndAt"`
StatusCode int `gorm:"column:status_code;default:0" json:"StatusCode" form:"StatusCode" comment:"StatusCode"`
Message string `gorm:"column:message" json:"Message" form:"Message" comment:"Message"`
RunStatus string `gorm:"column:run_status" json:"RunStatus" form:"RunStatus" comment:"RunStatus"`
CronId int `gorm:"column:cron_id" json:"CronId" form:"CronId" comment:"CronId"`
LastRun string `gorm:"column:last_run" json:"LastRun" form:"LastRun" comment:"LastRun"`
NextRun string `gorm:"column:next_run" json:"NextRun" form:"NextRun" comment:"NextRun"`
CreatedAt base.ISO8601Time
UpdatedAt base.ISO8601Time
}
func (c ScheduleLogVO) GetDetailVO() interface{} { return c }
func (c ScheduleLogVO) GetListVO() interface{} { return c }
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。