mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-10-03 05:58:27 +00:00
使用action代替api单个操作
改写job
This commit is contained in:
@@ -3,6 +3,7 @@ package models
|
||||
import (
|
||||
orm "go-admin/global"
|
||||
"go-admin/tools"
|
||||
"go-admin/tools/model"
|
||||
)
|
||||
|
||||
type SysJob struct {
|
||||
@@ -27,6 +28,20 @@ func (SysJob) TableName() string {
|
||||
return "sys_job"
|
||||
}
|
||||
|
||||
func (e *SysJob) Generate() model.ActiveRecord {
|
||||
o := *e
|
||||
return &o
|
||||
}
|
||||
|
||||
func (e *SysJob) GenerateList() interface{} {
|
||||
list := make([]SysJob, 0)
|
||||
return &list
|
||||
}
|
||||
|
||||
func (e *SysJob) GetId() interface{} {
|
||||
return e.JobId
|
||||
}
|
||||
|
||||
// 创建SysJob
|
||||
func (e *SysJob) Create() (err error) {
|
||||
return orm.Eloquent.Table(e.TableName()).Create(e).Error
|
||||
|
||||
Reference in New Issue
Block a user