mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
Merge branch 'dev' of https://github.com/go-admin-team/go-admin into go-admin-team-dev
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/common/dto"
|
||||
"go-admin/common/log"
|
||||
common "go-admin/common/models"
|
||||
"go-admin/tools"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type SysFileDirSearch struct {
|
||||
dto.Pagination `search:"-"`
|
||||
|
||||
ID int `form:"ID" search:"type:exact;column:id;table:sys_file_dir" comment:"标识"`
|
||||
ID int `form:"ID" search:"type:exact;column:id;table:sys_file_dir" comment:"标识"`
|
||||
Label string `form:"label" search:"type:exact;column:label;table:sys_file_dir" comment:"目录名称"`
|
||||
PId string `form:"pId" search:"type:exact;column:p_id;table:sys_file_dir" comment:"上级目录"`
|
||||
Sort string `form:"sort" search:"type:exact;column:sort;table:sys_file_dir" comment:"排序"`
|
||||
Path string `form:"path" search:"type:exact;column:path;table:sys_file_dir" comment:"路径"`
|
||||
//Sort string `form:"sort" search:"type:exact;column:sort;table:sys_file_dir" comment:"排序"`
|
||||
Path string `form:"path" search:"type:exact;column:path;table:sys_file_dir" comment:"路径"`
|
||||
}
|
||||
|
||||
func (m *SysFileDirSearch) GetNeedSearch() interface{} {
|
||||
@@ -38,13 +39,13 @@ func (m *SysFileDirSearch) Generate() dto.Index {
|
||||
}
|
||||
|
||||
type SysFileDirControl struct {
|
||||
ID int `uri:"ID" comment:"标识"` // 标识
|
||||
Label string `json:"label" comment:"目录名称"`
|
||||
PId int `json:"pId" comment:"上级目录"`
|
||||
Sort string `json:"sort" comment:"排序"`
|
||||
Path string `json:"path" comment:"路径"`
|
||||
CreateBy int `json:"-"`
|
||||
UpdateBy int `json:"-"`
|
||||
ID int `uri:"ID" comment:"标识"` // 标识
|
||||
Label string `json:"label" comment:"目录名称"`
|
||||
PId int `json:"pId" comment:"上级目录"`
|
||||
Sort string `json:"sort" comment:"排序"`
|
||||
Path string `json:"path" comment:"路径"`
|
||||
CreateBy int `json:"-"`
|
||||
UpdateBy int `json:"-"`
|
||||
}
|
||||
|
||||
func (s *SysFileDirControl) Bind(ctx *gin.Context) error {
|
||||
@@ -71,8 +72,8 @@ func (s *SysFileDirControl) GenerateM() (common.ActiveRecord, error) {
|
||||
Model: common.Model{ID: s.ID},
|
||||
Label: s.Label,
|
||||
PId: s.PId,
|
||||
Sort: s.Sort,
|
||||
Path: s.Path,
|
||||
//Sort: s.Sort,
|
||||
Path: s.Path,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ func (e *SysFileDir) InsertSysFileDir(model *dto.SysFileDirControl) error {
|
||||
}
|
||||
//var mp = map[string]string{}
|
||||
//mp["path"] = path
|
||||
if err := e.Orm.Model(&data).Where("id = ?", data.ID).Update("path",path).Error; err != nil {
|
||||
if err := e.Orm.Model(&data).Where("id = ?", data.ID).Update("path", path).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -157,13 +157,18 @@ func SysFileDirCall(list *[]models.SysFileDirL, m models.SysFileDirL) models.Sys
|
||||
mi.ID = listGroup[j].ID
|
||||
mi.PId = listGroup[j].PId
|
||||
mi.Label = listGroup[j].Label
|
||||
mi.Sort = listGroup[j].Sort
|
||||
//mi.Sort = listGroup[j].Sort
|
||||
mi.CreatedAt = listGroup[j].CreatedAt
|
||||
mi.UpdatedAt = listGroup[j].UpdatedAt
|
||||
mi.Children = []models.SysFileDirL{}
|
||||
ms := SysFileDirCall(list, mi)
|
||||
min = append(min, ms)
|
||||
}
|
||||
m.Children = min
|
||||
if len(min) > 0 {
|
||||
m.Children = min
|
||||
} else {
|
||||
m.Children = nil
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user