mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 18:20:50 +00:00
Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
package dto
|
||||
|
||||
type Pagination struct {
|
||||
PageIndex int `form:"pageIndex"`
|
||||
PageSize int `form:"pageSize"`
|
||||
}
|
||||
@@ -5,11 +5,10 @@ import (
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/common/dto"
|
||||
models2 "go-admin/common/models"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type SysJobSearch struct {
|
||||
Pagination `search:"-"`
|
||||
dto.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"`
|
||||
@@ -83,21 +82,7 @@ func (s *SysJobControl) GetId() interface{} {
|
||||
}
|
||||
|
||||
type SysJobById struct {
|
||||
Id int `uri:"id" validate:"required"`
|
||||
Ids []int `json:"ids"`
|
||||
}
|
||||
|
||||
func (s *SysJobById) Bind(ctx *gin.Context) error {
|
||||
if ctx.Request.Method == http.MethodDelete {
|
||||
err := ctx.Bind(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(s.Ids) > 0 {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return ctx.BindUri(s)
|
||||
dto.ObjectById
|
||||
}
|
||||
|
||||
func (s *SysJobById) Generate() dto.Control {
|
||||
@@ -108,10 +93,3 @@ func (s *SysJobById) Generate() dto.Control {
|
||||
func (s *SysJobById) GenerateM() (models2.ActiveRecord, error) {
|
||||
return &models.SysJob{}, nil
|
||||
}
|
||||
|
||||
func (s *SysJobById) GetId() interface{} {
|
||||
if len(s.Ids) > 0 {
|
||||
return s.Ids
|
||||
}
|
||||
return s.Id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user