123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- package dto
- import (
- dto2 "gas-cylinder-api/common/dto"
- common "gas-cylinder-api/common/model"
- "github.com/gin-gonic/gin"
- "gas-cylinder-api/app/jobs/model"
- "gogs.baozhida.cn/zoie/OAuth-core/api"
- )
- type SysJobSearch struct {
- dto2.Pagination `search:"-"`
- JobId int `form:"jobId" search:"type:exact;column:job_id;table:sys_job"`
- JobName string `form:"jobName" search:"type:icontains;column:job_name;table:sys_job"`
- JobGroup string `form:"jobGroup" search:"type:exact;column:job_group;table:sys_job"`
- CronExpression string `form:"cronExpression" search:"type:exact;column:cron_expression;table:sys_job"`
- InvokeTarget string `form:"invokeTarget" search:"type:exact;column:invoke_target;table:sys_job"`
- Status int `form:"status" search:"type:exact;column:status;table:sys_job"`
- }
- func (m *SysJobSearch) GetNeedSearch() interface{} {
- return *m
- }
- func (m *SysJobSearch) Bind(ctx *gin.Context) error {
- log := api.GetRequestLogger(ctx)
- err := ctx.ShouldBind(m)
- if err != nil {
- log.Errorf("Bind error: %s", err)
- }
- return err
- }
- func (m *SysJobSearch) Generate() dto2.Index {
- o := *m
- return &o
- }
- type SysJobControl struct {
- JobId int `json:"jobId"`
- JobName string `json:"jobName" validate:"required"` // 名称
- JobGroup string `json:"jobGroup"` // 任务分组
- JobType int `json:"jobType"` // 任务类型
- CronExpression string `json:"cronExpression"` // cron表达式
- InvokeTarget string `json:"invokeTarget"` // 调用目标
- Args string `json:"args"` // 目标参数
- MisfirePolicy int `json:"misfirePolicy"` // 执行策略
- Concurrent int `json:"concurrent"` // 是否并发
- Status int `json:"status"` // 状态
- EntryId int `json:"entryId"` // job启动时返回的id
- }
- func (s *SysJobControl) Bind(ctx *gin.Context) error {
- return ctx.ShouldBind(s)
- }
- func (s *SysJobControl) Generate() dto2.Control {
- cp := *s
- return &cp
- }
- func (s *SysJobControl) GenerateM() (common.ActiveRecord, error) {
- return &model.SysJob{
- JobId: s.JobId,
- JobName: s.JobName,
- JobGroup: s.JobGroup,
- JobType: s.JobType,
- CronExpression: s.CronExpression,
- InvokeTarget: s.InvokeTarget,
- Args: s.Args,
- MisfirePolicy: s.MisfirePolicy,
- Concurrent: s.Concurrent,
- Status: s.Status,
- EntryId: s.EntryId,
- }, nil
- }
- func (s *SysJobControl) GetId() interface{} {
- return s.JobId
- }
- type SysJobById struct {
- dto2.ObjectById
- }
- func (s *SysJobById) Generate() dto2.Control {
- cp := *s
- return &cp
- }
- func (s *SysJobById) GenerateM() (common.ActiveRecord, error) {
- return &model.SysJob{}, nil
- }
- type SysJobItem struct {
- JobId int `json:"jobId"`
- JobName string `json:"jobName" validate:"required"` // 名称
- JobGroup string `json:"jobGroup"` // 任务分组
- JobType int `json:"jobType"` // 任务类型
- CronExpression string `json:"cronExpression"` // cron表达式
- InvokeTarget string `json:"invokeTarget"` // 调用目标
- Args string `json:"args"` // 目标参数
- MisfirePolicy int `json:"misfirePolicy"` // 执行策略
- Concurrent int `json:"concurrent"` // 是否并发
- Status int `json:"status"` // 状态
- EntryId int `json:"entryId"` // job启动时返回的id
- }
|