- update model
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
c785b13dac
commit
255be172e7
@ -0,0 +1,15 @@
|
|||||||
|
package gojobs
|
||||||
|
|
||||||
|
import "github.com/beego/beego/v2/client/orm"
|
||||||
|
|
||||||
|
type JobsBeegoOrm struct {
|
||||||
|
Db *orm.Ormer
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewJobsBeegoOrm(db *orm.Ormer) *JobsBeegoOrm {
|
||||||
|
var (
|
||||||
|
jobsBeegoOrm = &JobsBeegoOrm{}
|
||||||
|
)
|
||||||
|
jobsBeegoOrm.Db = db
|
||||||
|
return jobsBeegoOrm
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package jobs_beego_orm_model
|
||||||
|
|
||||||
|
// Task 任务
|
||||||
|
type Task struct {
|
||||||
|
Id uint `orm:"auto" json:"id"` // 记录编号
|
||||||
|
Status string `json:"status"` // 状态码
|
||||||
|
Params string `json:"params"` // 参数
|
||||||
|
ParamsType string `json:"params_type"` // 参数类型
|
||||||
|
StatusDesc string `json:"status_desc"` // 状态描述
|
||||||
|
Frequency int64 `json:"frequency"` // 频率(秒单位)
|
||||||
|
Number int64 `json:"number"` // 当前次数
|
||||||
|
MaxNumber int64 `json:"max_number"` // 最大次数
|
||||||
|
RunId string `json:"run_id"` // 执行编号
|
||||||
|
CustomId string `json:"custom_id"` // 自定义编号
|
||||||
|
CustomSequence int64 `json:"custom_sequence"` // 自定义顺序
|
||||||
|
Type string `json:"type"` // 类型
|
||||||
|
CreatedIp string `json:"created_ip"` // 创建外网IP
|
||||||
|
SpecifyIp string `json:"specify_ip"` // 指定外网IP
|
||||||
|
UpdatedIp string `json:"updated_ip"` // 更新外网IP
|
||||||
|
Result string `json:"result"` // 结果
|
||||||
|
CreatedAt string `orm:"auto_now_add;type(text)" json:"created_at"` // 创建时间
|
||||||
|
UpdatedAt string `orm:"auto_now;type(text)" json:"updated_at"` // 更新时间
|
||||||
|
DeletedAt string `orm:"on_delete(set_null)" json:"deleted_at"` // 删除时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Task) TableName() string {
|
||||||
|
return "task"
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package jobs_beego_orm_model
|
||||||
|
|
||||||
|
// TaskIp 任务Ip
|
||||||
|
type TaskIp struct {
|
||||||
|
Id int64 `orm:"auto" json:"id"`
|
||||||
|
TaskType string `json:"task_type"` // 任务编号
|
||||||
|
Ips string `json:"ips"` // 任务IP
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskIp) TableName() string {
|
||||||
|
return "task_ip"
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package jobs_beego_orm_model
|
||||||
|
|
||||||
|
// TaskLog 任务日志模型
|
||||||
|
type TaskLog struct {
|
||||||
|
Id uint `orm:"auto" json:"id"` // 记录编号
|
||||||
|
TaskId uint `json:"task_id"` // 任务编号
|
||||||
|
StatusCode int `json:"status_code"` // 状态码
|
||||||
|
Desc string `json:"desc"` // 结果
|
||||||
|
Version int `json:"version"` // 版本
|
||||||
|
CreatedAt string `orm:"auto_now_add;type(text)" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskLog) TableName() string {
|
||||||
|
return "task_log"
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package jobs_beego_orm_model
|
||||||
|
|
||||||
|
// TaskLogRun 任务执行日志模型
|
||||||
|
type TaskLogRun struct {
|
||||||
|
Id uint `orm:"auto" json:"id"` // 记录编号
|
||||||
|
TaskId uint `json:"task_id"` // 任务编号
|
||||||
|
RunId string `json:"run_id"` // 执行编号
|
||||||
|
OutsideIp string `json:"outside_ip"` // 外网ip
|
||||||
|
InsideIp string `json:"inside_ip"` // 内网ip
|
||||||
|
Os string `json:"os"` // 系统类型
|
||||||
|
Arch string `json:"arch"` // 系统架构
|
||||||
|
Gomaxprocs int `json:"gomaxprocs"` // CPU核数
|
||||||
|
GoVersion string `json:"go_version"` // GO版本
|
||||||
|
MacAddrs string `json:"mac_addrs"` // Mac地址
|
||||||
|
CreatedAt string `orm:"auto_now_add;type(text)" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskLogRun) TableName() string {
|
||||||
|
return "task_log_run"
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package gojobs
|
||||||
|
|
||||||
|
const (
|
||||||
|
TASK_IN = "IN" // 任务运行
|
||||||
|
TASK_SUCCESS = "SUCCESS" // 任务完成
|
||||||
|
TASK_ERROR = "ERROR" // 任务异常
|
||||||
|
TASK_TIMEOUT = "TIMEOUT" // 任务超时
|
||||||
|
TASK_WAIT = "WAIT" // 任务等待
|
||||||
|
)
|
@ -0,0 +1,30 @@
|
|||||||
|
package jobs_gorm_model
|
||||||
|
|
||||||
|
import "gorm.io/gorm"
|
||||||
|
|
||||||
|
// Task 任务
|
||||||
|
type Task struct {
|
||||||
|
Id uint `gorm:"primaryKey" json:"id"` // 记录编号
|
||||||
|
Status string `json:"status"` // 状态码
|
||||||
|
Params string `json:"params"` // 参数
|
||||||
|
ParamsType string `json:"params_type"` // 参数类型
|
||||||
|
StatusDesc string `json:"status_desc"` // 状态描述
|
||||||
|
Frequency int64 `json:"frequency"` // 频率(秒单位)
|
||||||
|
Number int64 `json:"number"` // 当前次数
|
||||||
|
MaxNumber int64 `json:"max_number"` // 最大次数
|
||||||
|
RunId string `json:"run_id"` // 执行编号
|
||||||
|
CustomId string `json:"custom_id"` // 自定义编号
|
||||||
|
CustomSequence int64 `json:"custom_sequence"` // 自定义顺序
|
||||||
|
Type string `json:"type"` // 类型
|
||||||
|
CreatedIp string `json:"created_ip"` // 创建外网IP
|
||||||
|
SpecifyIp string `json:"specify_ip"` // 指定外网IP
|
||||||
|
UpdatedIp string `json:"updated_ip"` // 更新外网IP
|
||||||
|
Result string `json:"result"` // 结果
|
||||||
|
CreatedAt string `gorm:"type:text" json:"created_at"` // 创建时间
|
||||||
|
UpdatedAt string `gorm:"type:text" json:"updated_at"` // 更新时间
|
||||||
|
DeletedAt gorm.DeletedAt `gorm:"type:text;index" json:"deleted_at"` // 删除时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Task) TableName() string {
|
||||||
|
return "task"
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package jobs_gorm_model
|
||||||
|
|
||||||
|
// TaskIp 任务Ip
|
||||||
|
type TaskIp struct {
|
||||||
|
Id int64 `gorm:"primaryKey" json:"id"`
|
||||||
|
TaskType string `json:"task_type"` // 任务编号
|
||||||
|
Ips string `json:"ips"` // 任务IP
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskIp) TableName() string {
|
||||||
|
return "task_ip"
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package jobs_gorm_model
|
||||||
|
|
||||||
|
// TaskLog 任务日志模型
|
||||||
|
type TaskLog struct {
|
||||||
|
Id uint `gorm:"primaryKey" json:"id"` // 记录编号
|
||||||
|
TaskId uint `json:"task_id"` // 任务编号
|
||||||
|
StatusCode int `json:"status_code"` // 状态码
|
||||||
|
Desc string `json:"desc"` // 结果
|
||||||
|
Version int `json:"version"` // 版本
|
||||||
|
CreatedAt string `gorm:"type:text" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskLog) TableName() string {
|
||||||
|
return "task_log"
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package jobs_gorm_model
|
||||||
|
|
||||||
|
// TaskLogRun 任务执行日志模型
|
||||||
|
type TaskLogRun struct {
|
||||||
|
Id uint `gorm:"primaryKey" json:"id"` // 记录编号
|
||||||
|
TaskId uint `json:"task_id"` // 任务编号
|
||||||
|
RunId string `json:"run_id"` // 执行编号
|
||||||
|
OutsideIp string `json:"outside_ip"` // 外网ip
|
||||||
|
InsideIp string `json:"inside_ip"` // 内网ip
|
||||||
|
Os string `json:"os"` // 系统类型
|
||||||
|
Arch string `json:"arch"` // 系统架构
|
||||||
|
Gomaxprocs int `json:"gomaxprocs"` // CPU核数
|
||||||
|
GoVersion string `json:"go_version"` // GO版本
|
||||||
|
MacAddrs string `json:"mac_addrs"` // Mac地址
|
||||||
|
CreatedAt string `gorm:"type:text" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskLogRun) TableName() string {
|
||||||
|
return "task_log_run"
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package jobs_xorm_model
|
||||||
|
|
||||||
|
// Task 任务
|
||||||
|
type Task struct {
|
||||||
|
Id uint `xorm:"pk autoincr" json:"id"` // 记录编号
|
||||||
|
Status string `json:"status"` // 状态码
|
||||||
|
Params string `json:"params"` // 参数
|
||||||
|
ParamsType string `json:"params_type"` // 参数类型
|
||||||
|
StatusDesc string `json:"status_desc"` // 状态描述
|
||||||
|
Frequency int64 `json:"frequency"` // 频率(秒单位)
|
||||||
|
Number int64 `json:"number"` // 当前次数
|
||||||
|
MaxNumber int64 `json:"max_number"` // 最大次数
|
||||||
|
RunId string `json:"run_id"` // 执行编号
|
||||||
|
CustomId string `json:"custom_id"` // 自定义编号
|
||||||
|
CustomSequence int64 `json:"custom_sequence"` // 自定义顺序
|
||||||
|
Type string `json:"type"` // 类型
|
||||||
|
CreatedIp string `json:"created_ip"` // 创建外网IP
|
||||||
|
SpecifyIp string `json:"specify_ip"` // 指定外网IP
|
||||||
|
UpdatedIp string `json:"updated_ip"` // 更新外网IP
|
||||||
|
Result string `json:"result"` // 结果
|
||||||
|
CreatedAt string `xorm:"created" json:"created_at"` // 创建时间
|
||||||
|
UpdatedAt string `xorm:"created" json:"updated_at"` // 更新时间
|
||||||
|
DeletedAt string `xorm:"deleted" json:"deleted_at"` // 删除时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Task) TableName() string {
|
||||||
|
return "task"
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package jobs_xorm_model
|
||||||
|
|
||||||
|
// TaskIp 任务Ip
|
||||||
|
type TaskIp struct {
|
||||||
|
Id int64 `xorm:"pk autoincr" json:"id"`
|
||||||
|
TaskType string `json:"task_type"` // 任务编号
|
||||||
|
Ips string `json:"ips"` // 任务IP
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskIp) TableName() string {
|
||||||
|
return "task_ip"
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package jobs_xorm_model
|
||||||
|
|
||||||
|
// TaskLog 任务日志模型
|
||||||
|
type TaskLog struct {
|
||||||
|
Id uint `xorm:"pk autoincr" json:"id"` // 记录编号
|
||||||
|
TaskId uint `json:"task_id"` // 任务编号
|
||||||
|
StatusCode int `json:"status_code"` // 状态码
|
||||||
|
Desc string `json:"desc"` // 结果
|
||||||
|
Version int `json:"version"` // 版本
|
||||||
|
CreatedAt string `xorm:"created" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskLog) TableName() string {
|
||||||
|
return "task_log"
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package jobs_xorm_model
|
||||||
|
|
||||||
|
// TaskLogRun 任务执行日志模型
|
||||||
|
type TaskLogRun struct {
|
||||||
|
Id uint `xorm:"pk autoincr" json:"id"` // 记录编号
|
||||||
|
TaskId uint `json:"task_id"` // 任务编号
|
||||||
|
RunId string `json:"run_id"` // 执行编号
|
||||||
|
OutsideIp string `json:"outside_ip"` // 外网ip
|
||||||
|
InsideIp string `json:"inside_ip"` // 内网ip
|
||||||
|
Os string `json:"os"` // 系统类型
|
||||||
|
Arch string `json:"arch"` // 系统架构
|
||||||
|
Gomaxprocs int `json:"gomaxprocs"` // CPU核数
|
||||||
|
GoVersion string `json:"go_version"` // GO版本
|
||||||
|
MacAddrs string `json:"mac_addrs"` // Mac地址
|
||||||
|
CreatedAt string `xorm:"created" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskLogRun) TableName() string {
|
||||||
|
return "task_log_run"
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package jobs_zorm_model
|
||||||
|
|
||||||
|
// Task 任务
|
||||||
|
type Task struct {
|
||||||
|
Id uint `zorm:"primaryKey" json:"id"` // 记录编号
|
||||||
|
Status string `json:"status"` // 状态码
|
||||||
|
Params string `json:"params"` // 参数
|
||||||
|
ParamsType string `json:"params_type"` // 参数类型
|
||||||
|
StatusDesc string `json:"status_desc"` // 状态描述
|
||||||
|
Frequency int64 `json:"frequency"` // 频率(秒单位)
|
||||||
|
Number int64 `json:"number"` // 当前次数
|
||||||
|
MaxNumber int64 `json:"max_number"` // 最大次数
|
||||||
|
RunId string `json:"run_id"` // 执行编号
|
||||||
|
CustomId string `json:"custom_id"` // 自定义编号
|
||||||
|
CustomSequence int64 `json:"custom_sequence"` // 自定义顺序
|
||||||
|
Type string `json:"type"` // 类型
|
||||||
|
CreatedIp string `json:"created_ip"` // 创建外网IP
|
||||||
|
SpecifyIp string `json:"specify_ip"` // 指定外网IP
|
||||||
|
UpdatedIp string `json:"updated_ip"` // 更新外网IP
|
||||||
|
Result string `json:"result"` // 结果
|
||||||
|
CreatedAt string `zorm:"type:text" json:"created_at"` // 创建时间
|
||||||
|
UpdatedAt string `zorm:"type:text" json:"updated_at"` // 更新时间
|
||||||
|
DeletedAt string `zorm:"index;deleted" json:"deleted_at"` // 删除时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Task) TableName() string {
|
||||||
|
return "task"
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package jobs_zorm_model
|
||||||
|
|
||||||
|
// TaskIp 任务Ip
|
||||||
|
type TaskIp struct {
|
||||||
|
Id int64 `zorm:"primaryKey" json:"id"`
|
||||||
|
TaskType string `json:"task_type"` // 任务编号
|
||||||
|
Ips string `json:"ips"` // 任务IP
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskIp) TableName() string {
|
||||||
|
return "task_ip"
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package jobs_zorm_model
|
||||||
|
|
||||||
|
// TaskLog 任务日志模型
|
||||||
|
type TaskLog struct {
|
||||||
|
Id uint `zorm:"primaryKey" json:"id"` // 记录编号
|
||||||
|
TaskId uint `json:"task_id"` // 任务编号
|
||||||
|
StatusCode int `json:"status_code"` // 状态码
|
||||||
|
Desc string `json:"desc"` // 结果
|
||||||
|
Version int `json:"version"` // 版本
|
||||||
|
CreatedAt string `zorm:"type:text" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskLog) TableName() string {
|
||||||
|
return "task_log"
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package jobs_zorm_model
|
||||||
|
|
||||||
|
// TaskLogRun 任务执行日志模型
|
||||||
|
type TaskLogRun struct {
|
||||||
|
Id uint `zorm:"primaryKey" json:"id"` // 记录编号
|
||||||
|
TaskId uint `json:"task_id"` // 任务编号
|
||||||
|
RunId string `json:"run_id"` // 执行编号
|
||||||
|
OutsideIp string `json:"outside_ip"` // 外网ip
|
||||||
|
InsideIp string `json:"inside_ip"` // 内网ip
|
||||||
|
Os string `json:"os"` // 系统类型
|
||||||
|
Arch string `json:"arch"` // 系统架构
|
||||||
|
Gomaxprocs int `json:"gomaxprocs"` // CPU核数
|
||||||
|
GoVersion string `json:"go_version"` // GO版本
|
||||||
|
MacAddrs string `json:"mac_addrs"` // Mac地址
|
||||||
|
CreatedAt string `zorm:"type:text" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TaskLogRun) TableName() string {
|
||||||
|
return "task_log_run"
|
||||||
|
}
|
Loading…
Reference in new issue