first commit

This commit is contained in:
何昌清
2026-03-26 22:13:03 +08:00
parent bbe1faa363
commit a2685f7f1e
51 changed files with 11244 additions and 0 deletions

78
schemas/cron_schemas.go Normal file
View File

@@ -0,0 +1,78 @@
// Package schemas/cron_repository.go
package schemas
type CronListRequest struct {
PageIndex int `json:"page_index" form:"page_index" binding:"required"`
PageSize int `json:"page_size" form:"page_size" binding:"required"`
Name string `json:"name" form:"name"`
StartDate CustomTime `json:"start_date" form:"start_date"`
EndDate CustomTime `json:"end_date" form:"end_date"`
}
type CronListResponse struct {
Item []*CronJob `json:"items"`
Total int64 `json:"total"`
PageIndex int `json:"page_index"`
PageSize int `json:"page_size"`
}
type CronJob struct {
// 任务ID
ID int `json:"id" db:"id"`
// 任务名称
Name string `json:"name" db:"name"`
// 任务计划
Schedule string `json:"schedule" db:"schedule"`
// 任务处理程序
Handler string `json:"handler" db:"handler"`
// 任务是否启用
Enabled int `json:"enabled" db:"enabled"`
// 任务描述
Description string `json:"description" db:"description"`
// 创建时间
CreatedAt CustomTime `json:"create_time" db:"create_time"`
// 更新时间
UpdatedAt CustomTime `json:"update_time" db:"update_time"`
}
type CronJobLogListRequest struct {
PageIndex int `json:"page_index" form:"page_index" binding:"required"`
PageSize int `json:"page_size" form:"page_size" binding:"required"`
Id int `json:"id" form:"id" binding:"required"`
StartDate CustomTime `json:"start_date" form:"start_date"`
EndDate CustomTime `json:"end_date" form:"end_date"`
}
type CronJobLogListResponse struct {
Item []*CronJobLog `json:"items"`
Total int64 `json:"total"`
PageIndex int `json:"page_index"`
PageSize int `json:"page_size"`
}
type CronJobLog struct {
ID int `json:"id" db:"id"`
JobID int `json:"job_id" db:"job_id"`
Name string `json:"name" db:"name"`
Handler string `json:"handler" db:"handler"`
Schedule string `json:"schedule" db:"schedule"`
Message string `json:"message" db:"message"`
Status string `json:"status" db:"status"`
StartTime CustomTime `json:"start_time" db:"start_time"`
EndTime CustomTime `json:"end_time" db:"end_time"`
}
type CronJobUpdateRequest struct {
// 任务ID 传参代表修改 不传参代表新增
ID int `json:"id" db:"id"`
// 任务名称
Name string `json:"name" db:"name"`
// 任务计划
Schedule string `json:"schedule" db:"schedule"`
// 任务处理程序
Handler string `json:"handler" db:"handler"`
// 任务是否启用
//Enabled int `json:"enabled" db:"enabled"`
// 任务描述
Description string `json:"description" db:"description"`
}