clear:clear no used file
This commit is contained in:
1 parent
99acf0086f
commit
606aa821d5
3 files changed
+3
-179
No files matched your search
@@ -1,89 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/common/dto"
|
||||
"go-admin/common/log"
|
||||
common "go-admin/common/models"
|
||||
"go-admin/tools"
|
||||
)
|
||||
|
||||
type ScolSearch struct {
|
||||
dto.Pagination `search:"-"`
|
||||
Name string `form:"name" search:"type:contains;column:name;table:scol" comment:"名称"`
|
||||
|
||||
|
||||
}
|
||||
|
||||
func (m *ScolSearch) GetNeedSearch() interface{} {
|
||||
return *m
|
||||
}
|
||||
|
||||
func (m *ScolSearch) Bind(ctx *gin.Context) error {
|
||||
msgID := tools.GenerateMsgIDFromContext(ctx)
|
||||
err := ctx.ShouldBind(m)
|
||||
if err != nil {
|
||||
log.Debugf("MsgID[%s] ShouldBind error: %s", msgID, err.Error())
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *ScolSearch) Generate() dto.Index {
|
||||
o := *m
|
||||
return &o
|
||||
}
|
||||
|
||||
type ScolControl struct {
|
||||
|
||||
ID uint `uri:"ID" comment:""` //
|
||||
|
||||
Name string `json:"name" comment:"名称"`
|
||||
|
||||
}
|
||||
|
||||
func (s *ScolControl) Bind(ctx *gin.Context) error {
|
||||
msgID := tools.GenerateMsgIDFromContext(ctx)
|
||||
err := ctx.ShouldBindUri(s)
|
||||
if err != nil {
|
||||
log.Debugf("MsgID[%s] ShouldBindUri error: %s", msgID, err.Error())
|
||||
return err
|
||||
}
|
||||
err = ctx.ShouldBind(s)
|
||||
if err != nil {
|
||||
log.Debugf("MsgID[%s] ShouldBind error: %#v", msgID, err.Error())
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *ScolControl) Generate() dto.Control {
|
||||
cp := *s
|
||||
return &cp
|
||||
}
|
||||
|
||||
func (s *ScolControl) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.Scol{
|
||||
|
||||
Model: gorm.Model{ID: s.ID},
|
||||
Name: s.Name,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *ScolControl) GetId() interface{} {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
type ScolById struct {
|
||||
dto.ObjectById
|
||||
}
|
||||
|
||||
func (s *ScolById) Generate() dto.Control {
|
||||
cp := *s
|
||||
return &cp
|
||||
}
|
||||
|
||||
func (s *ScolById) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.Scol{}, nil
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/common/dto"
|
||||
"go-admin/common/log"
|
||||
common "go-admin/common/models"
|
||||
)
|
||||
|
||||
type StudentSearch struct {
|
||||
dto.Pagination `search:"-"`
|
||||
Name string `form:"name" search:"type:exact;column:name;table:student" comment:"姓名"`
|
||||
}
|
||||
|
||||
func (m *StudentSearch) GetNeedSearch() interface{} {
|
||||
return *m
|
||||
}
|
||||
|
||||
func (m *StudentSearch) Bind(ctx *gin.Context) error {
|
||||
err := ctx.Bind(m)
|
||||
if err != nil {
|
||||
log.Errorf("MsgID[%s] Bind error: %#v", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (m *StudentSearch) Generate() dto.Index {
|
||||
o := *m
|
||||
return &o
|
||||
}
|
||||
|
||||
type StudentControl struct {
|
||||
ID uint `uri:"ID" comment:""` //
|
||||
Name string `json:"name" comment:"姓名"`
|
||||
}
|
||||
|
||||
func (s *StudentControl) Bind(ctx *gin.Context) error {
|
||||
err := ctx.BindUri(s)
|
||||
if err != nil {
|
||||
log.Errorf("MsgID[%s] Bind error: %#v", err)
|
||||
return err
|
||||
}
|
||||
err = ctx.Bind(s)
|
||||
if err != nil {
|
||||
log.Errorf("MsgID[%s] Bind error: %#v", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *StudentControl) Generate() dto.Control {
|
||||
cp := *s
|
||||
return &cp
|
||||
}
|
||||
|
||||
func (s *StudentControl) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.Student{
|
||||
|
||||
Model: gorm.Model{ID: s.ID},
|
||||
Name: s.Name,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *StudentControl) GetId() interface{} {
|
||||
return s.ID
|
||||
}
|
||||
|
||||
type StudentById struct {
|
||||
dto.ObjectById
|
||||
}
|
||||
|
||||
func (s *StudentById) Generate() dto.Control {
|
||||
cp := *s
|
||||
return &cp
|
||||
}
|
||||
|
||||
func (s *StudentById) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.Student{}, nil
|
||||
}
|
||||
|
||||
type StudentItem struct {
|
||||
gorm.Model
|
||||
common.ControlBy
|
||||
Name string `json:"name" gorm:"type:varchar(255);comment:姓名"` //
|
||||
}
|
||||
Reference in new issue
Block a user