mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 18:20:50 +00:00
clear:clear no used file
This commit is contained in:
@@ -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:姓名"` //
|
|
||||||
}
|
|
||||||
@@ -273,7 +273,7 @@ func _1599190683670Test(db *gorm.DB, version string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
list6 := []models.SysRole{
|
list6 := []models.SysRole{
|
||||||
{1, "系统管理员", "0", "admin", 1, "", "1", "", "", true, "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, nil, nil, nil},
|
{1, "系统管理员", "0", "admin", 1, "", "1", "", "", true, "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, "", []int{}, []int{}},
|
||||||
}
|
}
|
||||||
|
|
||||||
list7 := []models.DictType{
|
list7 := []models.DictType{
|
||||||
@@ -332,8 +332,8 @@ func _1599190683670Test(db *gorm.DB, version string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
list11 := []models.SysJob{
|
list11 := []models.SysJob{
|
||||||
{1, "接口测试", "DEFAULT", 1, "0/5 * * * * ", "http://localhost:8000", "", 1, 1, 2, 0, "", "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ""},
|
{1, "接口测试", "DEFAULT", 1, "0/5 * * * * ", "http://localhost:8000", "", 1, 1, 1, 0, "", "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ""},
|
||||||
{2, "函数测试", "DEFAULT", 2, "0/5 * * * * ", "ExamplesOne", "参数", 1, 1, 2, 0, "", "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ""},
|
{2, "函数测试", "DEFAULT", 2, "0/5 * * * * ", "ExamplesOne", "参数", 1, 1, 1, 0, "", "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, ""},
|
||||||
}
|
}
|
||||||
|
|
||||||
err := tx.Create(list1).Error
|
err := tx.Create(list1).Error
|
||||||
|
|||||||
Reference in New Issue
Block a user