使用action代替api单个操作

改写job
This commit is contained in:
linwenxiang
2020-08-29 22:22:52 +08:00
parent 78417c2d33
commit 562e61cf4f
15 changed files with 332 additions and 6 deletions
+15
View File
@@ -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