models

package
v0.0.0-...-ed4fdcb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	Id         int64          `orm:"pk" json:"task_id"` //任务ID
	Name       string         `json:"name"`             //任务描述
	Enable     bt.EnableType  `json:"enable"`           //是否开启任务, 1 开启,2 停用
	Module     int            `json:"module"`           //该任务隶属模块
	Type       bt.NodeType    `json:"type"`             //任务类型
	StartTime  string         `json:"start_time"`       //任务开始时间,可以是绝对时间和通配时间,绝对时间格式: 时间戳; 通配时间格式:秒,分,时,日,月,星期
	Url        string         `json:"url"`              //回调的url
	Method     string         `json:"method"`           //请求url的方法
	RespRegexp string         `json:"resp_regexp"`      //url回包正则,调用时用于判断是否为预期回包
	Body       string         `json:"body"`             //body字符串
	BodyType   bt.ContentType `json:"body_type"`        //Content-Type: 1 Json, 2 Form
	RedoParam  string         `json:"redo_param"`       //重试间隔, 用空格分割,单位为秒,比如:2 4 8
	Status     bt.StatusType  `json:"status"`           //执行状态, 1 开始执行,2 执行成成功,3 执行失败
	BeginTime  time.Time      `json:"begin_time"`       //开始时间
}

任务配置

func (*Task) DeleteByTaskId

func (p *Task) DeleteByTaskId(o orm.Ormer, task_id int64) error

func (*Task) FindEnableTask

func (p *Task) FindEnableTask(o orm.Ormer) ([]Task, error)

func (*Task) FindTaskByName

func (p *Task) FindTaskByName(o orm.Ormer, name string) error

func (*Task) FindTaskByTaskId

func (p *Task) FindTaskByTaskId(o orm.Ormer, task_id int64) error

func (*Task) Insert

func (p *Task) Insert(o orm.Ormer) (int64, error)

func (*Task) TableName

func (p *Task) TableName() string

func (*Task) UpdateByName

func (p *Task) UpdateByName(o orm.Ormer, name string, fields orm.Params) error

func (*Task) UpdateByTaskId

func (p *Task) UpdateByTaskId(o orm.Ormer, task_id int64, fields orm.Params) error

type TaskLog

type TaskLog struct {
	Id          int64         `orm:"pk"`
	TaskId      int64         `json:"task_id"` //任务ID 自动生成
	Name        string        `json:"name"`    //任务描述
	Module      int           //该任务隶属模块
	RunningType bt.RunType    `json:"run_type"`   //任务执行方式 1 正常启动,2 重试
	Status      bt.StatusType `json:"status"`     //执行状态, 1 开始执行,2 执行成成功,3 执行失败
	BeginTime   time.Time     `json:"begin_time"` //开始时间
	EndTime     time.Time     `json:"end_time"`   //结束时间
	Url         string        `json:"url"`        //回调的url
	Method      string        `json:"method"`     //请求url的方法
	Body        string        `json:"body"`       //body字符串
	Resp        string        `json:"resp"`       //url 的回包内容

}

任务日志

func (*TaskLog) FindByTaskIdOrName

func (p *TaskLog) FindByTaskIdOrName(o orm.Ormer, id_list []int64, name_list []string) ([]TaskLog, error)

func (*TaskLog) FindLogByTaskId

func (p *TaskLog) FindLogByTaskId(o orm.Ormer, task_id int64) ([]TaskLog, error)

func (*TaskLog) Insert

func (p *TaskLog) Insert(o orm.Ormer) error

func (*TaskLog) TableName

func (p *TaskLog) TableName() string

func (*TaskLog) Update

func (p *TaskLog) Update(o orm.Ormer, fields orm.Params) error

这个更新可以避免获取最新的id

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL