使用action代替api单个操作
改写job
This commit is contained in:
1 parent
78417c2d33
commit
562e61cf4f
15 files changed
+332
-6
No files matched your search
@@ -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