mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
修改action和模版,使用log打印日志,修复job删除问题,已经所有删除问题
This commit is contained in:
@@ -22,7 +22,7 @@ type SysJob struct {
|
||||
|
||||
// RemoveJobForService 调用service实现
|
||||
func (e *SysJob) RemoveJobForService(c *gin.Context) {
|
||||
msgID := apis.GenerateMsgIDFromContext(c)
|
||||
msgID := tools.GenerateMsgIDFromContext(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("msgID[%s] error:%#v", msgID, err)
|
||||
@@ -49,7 +49,7 @@ func (e *SysJob) RemoveJobForService(c *gin.Context) {
|
||||
|
||||
// StartJobForService 启动job service实现
|
||||
func (e *SysJob) StartJobForService(c *gin.Context) {
|
||||
msgID := apis.GenerateMsgIDFromContext(c)
|
||||
msgID := tools.GenerateMsgIDFromContext(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("msgID[%s] error:%#v", msgID, err)
|
||||
|
||||
@@ -3,16 +3,16 @@ package middleware
|
||||
import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
"go-admin/common/config"
|
||||
"go-admin/common/global"
|
||||
"go-admin/tools"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/driver/postgres"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"go-admin/common/config"
|
||||
"go-admin/common/global"
|
||||
"go-admin/common/middleware"
|
||||
"go-admin/tools"
|
||||
)
|
||||
|
||||
var WithContextDb = middleware.WithContextDb
|
||||
|
||||
@@ -5,7 +5,8 @@ import (
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/common/dto"
|
||||
models2 "go-admin/common/models"
|
||||
"go-admin/common/log"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
type SysJobSearch struct {
|
||||
@@ -23,7 +24,11 @@ func (m *SysJobSearch) GetNeedSearch() interface{} {
|
||||
}
|
||||
|
||||
func (m *SysJobSearch) Bind(ctx *gin.Context) error {
|
||||
return ctx.Bind(m)
|
||||
err := ctx.Bind(m)
|
||||
if err != nil {
|
||||
log.Errorf("MsgID[%s] Bind error: %#v", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *SysJobSearch) Generate() dto.Index {
|
||||
@@ -31,14 +36,6 @@ func (m *SysJobSearch) Generate() dto.Index {
|
||||
return &o
|
||||
}
|
||||
|
||||
func (m *SysJobSearch) GetPageIndex() int {
|
||||
return m.PageIndex
|
||||
}
|
||||
|
||||
func (m *SysJobSearch) GetPageSize() int {
|
||||
return m.PageSize
|
||||
}
|
||||
|
||||
type SysJobControl struct {
|
||||
JobId int `json:"jobId"`
|
||||
JobName string `json:"jobName" validate:"required"` // 名称
|
||||
@@ -62,7 +59,7 @@ func (s *SysJobControl) Generate() dto.Control {
|
||||
return &cp
|
||||
}
|
||||
|
||||
func (s *SysJobControl) GenerateM() (models2.ActiveRecord, error) {
|
||||
func (s *SysJobControl) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.SysJob{
|
||||
JobId: s.JobId,
|
||||
JobName: s.JobName,
|
||||
@@ -91,6 +88,6 @@ func (s *SysJobById) Generate() dto.Control {
|
||||
return &cp
|
||||
}
|
||||
|
||||
func (s *SysJobById) GenerateM() (models2.ActiveRecord, error) {
|
||||
func (s *SysJobById) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.SysJob{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user