diff --git a/app/admin/apis/sysfile/dir.go b/app/admin/apis/sysfile/dir.go deleted file mode 100644 index 54d10b3..0000000 --- a/app/admin/apis/sysfile/dir.go +++ /dev/null @@ -1,71 +0,0 @@ -package sysfile - -import ( - "github.com/gin-gonic/gin" - "github.com/gin-gonic/gin/binding" - - "go-admin/app/admin/models" - "go-admin/tools" - "go-admin/tools/app" - "go-admin/tools/app/msg" -) - -func GetSysFileDirList(c *gin.Context) { - var SysFileDir models.SysFileDirOld - SysFileDir.Label = c.Request.FormValue("label") - SysFileDir.PId, _ = tools.StringToInt(c.Request.FormValue("pid")) - SysFileDir.Id, _ = tools.StringToInt(c.Request.FormValue("id")) - SysFileDir.DataScope = tools.GetUserIdStr(c) - result, err := SysFileDir.SetSysFileDirOld() - tools.HasError(err, "抱歉未找到相关信息", -1) - app.OK(c, result, "") -} - -func GetSysFileDir(c *gin.Context) { - var data models.SysFileDirOld - data.Id, _ = tools.StringToInt(c.Param("id")) - result, err := data.Get() - tools.HasError(err, "抱歉未找到相关信息", -1) - - app.OK(c, result, "") -} - -// @Summary 添加SysFileDir -// @Description 获取JSON -// @Tags SysFileDir -// @Accept application/json -// @Product application/json -// @Param data body models.SysFileDir true "data" -// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" -// @Success 200 {string} string "{"code": -1, "message": "添加失败"}" -// @Router /api/v1/sysfiledir [post] -func InsertSysFileDir(c *gin.Context) { - var data models.SysFileDirOld - err := c.ShouldBindJSON(&data) - data.CreateBy = tools.GetUserIdStr(c) - tools.HasError(err, "", 500) - result, err := data.Create() - tools.HasError(err, "", -1) - app.OK(c, result, "") -} - -func UpdateSysFileDir(c *gin.Context) { - var data models.SysFileDirOld - err := c.BindWith(&data, binding.JSON) - tools.HasError(err, "数据解析失败", -1) - data.UpdateBy = tools.GetUserIdStr(c) - result, err := data.Update(data.Id) - tools.HasError(err, "", -1) - - app.OK(c, result, "") -} - -func DeleteSysFileDir(c *gin.Context) { - var data models.SysFileDirOld - data.UpdateBy = tools.GetUserIdStr(c) - - IDS := tools.IdsStrToIdsIntGroup("id", c) - _, err := data.BatchDelete(IDS) - tools.HasError(err, msg.DeletedFail, 500) - app.OK(c, nil, msg.DeletedSuccess) -} diff --git a/app/admin/apis/sysfile/sysfileinfo.go b/app/admin/apis/sysfile/sysfileinfo.go deleted file mode 100644 index 8870873..0000000 --- a/app/admin/apis/sysfile/sysfileinfo.go +++ /dev/null @@ -1,77 +0,0 @@ -package sysfile - -import ( - "github.com/gin-gonic/gin" - "github.com/gin-gonic/gin/binding" - - "go-admin/app/admin/models" - "go-admin/tools" - "go-admin/tools/app" - "go-admin/tools/app/msg" -) - -func GetSysFileInfoOldList(c *gin.Context) { - var data models.SysFileInfoOld - var err error - var pageSize = 10 - var pageIndex = 1 - - if size := c.Request.FormValue("pageSize"); size != "" { - pageSize, err = tools.StringToInt(size) - } - tools.HasError(err, "", -1) - if index := c.Request.FormValue("pageIndex"); index != "" { - pageIndex, err = tools.StringToInt(index) - } - tools.HasError(err, "", -1) - if pid := c.Request.FormValue("pId"); pid != "" { - data.PId, err = tools.StringToInt(pid) - } - tools.HasError(err, "", -1) - - data.DataScope = tools.GetUserIdStr(c) - result, count, err := data.GetPage(pageSize, pageIndex) - tools.HasError(err, "", -1) - - app.PageOK(c, result, count, pageIndex, pageSize, "") -} - -func GetSysFileInfoOld(c *gin.Context) { - var data models.SysFileInfoOld - data.Id, _ = tools.StringToInt(c.Param("id")) - result, err := data.Get() - tools.HasError(err, "抱歉未找到相关信息", -1) - - app.OK(c, result, "") -} - -func InsertSysFileInfoOld(c *gin.Context) { - var data models.SysFileInfoOld - err := c.ShouldBindJSON(&data) - data.CreateBy = tools.GetUserIdStr(c) - tools.HasError(err, "", 500) - result, err := data.Create() - tools.HasError(err, "", -1) - app.OK(c, result, "") -} - -func UpdateSysFileInfoOld(c *gin.Context) { - var data models.SysFileInfoOld - err := c.BindWith(&data, binding.JSON) - tools.HasError(err, "数据解析失败", -1) - data.UpdateBy = tools.GetUserIdStr(c) - result, err := data.Update(data.Id) - tools.HasError(err, "", -1) - - app.OK(c, result, "") -} - -func DeleteSysFileInfoOld(c *gin.Context) { - var data models.SysFileInfoOld - data.UpdateBy = tools.GetUserIdStr(c) - - IDS := tools.IdsStrToIdsIntGroup("id", c) - _, err := data.BatchDelete(IDS) - tools.HasError(err, msg.DeletedFail, 500) - app.OK(c, nil, msg.DeletedSuccess) -} diff --git a/app/admin/apis/system/dict/dicttype.go b/app/admin/apis/system/dict/dicttype.go index bf9fe50..2a09b0e 100644 --- a/app/admin/apis/system/dict/dicttype.go +++ b/app/admin/apis/system/dict/dicttype.go @@ -19,7 +19,7 @@ import ( // @Param dictType query string false "dictType" // @Param pageSize query int false "页条数" // @Param pageIndex query int false "页码" -// @Success 200 {object} app.PageResponse "{"code": 200, "data": [...]}" +// @Success 200 {object} app.Response "{"code": 200, "data": [...]}" // @Router /api/v1/dict/type/list [get] // @Security Bearer func GetDictTypeList(c *gin.Context) { diff --git a/app/admin/models/dept.go b/app/admin/models/dept.go index 7820ed5..cb75698 100644 --- a/app/admin/models/dept.go +++ b/app/admin/models/dept.go @@ -167,6 +167,7 @@ func Digui(deptlist *[]SysDept, menu SysDept) SysDept { mi.Phone = list[j].Phone mi.Email = list[j].Email mi.Status = list[j].Status + mi.CreatedAt = list[j].CreatedAt mi.Children = []SysDept{} ms := Digui(deptlist, mi) min = append(min, ms) diff --git a/app/admin/models/dictdata.go b/app/admin/models/dictdata.go index 29a0f03..60d6f4f 100644 --- a/app/admin/models/dictdata.go +++ b/app/admin/models/dictdata.go @@ -88,6 +88,8 @@ func (e *DictData) Get() ([]DictData, error) { table = table.Where("dict_type = ?", e.DictType) } + table = table.Where("status = ?", 2) + if err := table.Order("dict_sort").Find(&doc).Error; err != nil { return doc, err } diff --git a/app/admin/models/filedir.go b/app/admin/models/filedir.go deleted file mode 100644 index eb70934..0000000 --- a/app/admin/models/filedir.go +++ /dev/null @@ -1,163 +0,0 @@ -package models - -import ( - orm "go-admin/common/global" - "go-admin/tools" -) - -type SysFileDirOld struct { - Id int `json:"id"` - Label string `json:"label" gorm:"type:varchar(255);"` // 名称 - PId int `json:"pId" gorm:"type:int(11);"` // 父id - Sort int `json:"sort" gorm:""` //排序 - Path string `json:"path" gorm:"size:255;"` // - CreateBy string `json:"createBy" gorm:"type:varchar(128);"` // 创建人 - UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"` // 编辑人 - Children []SysFileDirOld `json:"children" gorm:"-"` - DataScope string `json:"dataScope" gorm:"-"` - Params string `json:"params" gorm:"-"` - BaseModel -} - -func (SysFileDirOld) TableName() string { - return "sys_file_dir" -} - -// 创建SysFileDirOld -func (e *SysFileDirOld) Create() (SysFileDirOld, error) { - var doc SysFileDirOld - result := orm.Eloquent.Table(e.TableName()).Create(&e) - if result.Error != nil { - err := result.Error - return doc, err - } - - path := "/" + tools.IntToString(e.Id) - if int(e.PId) != 0 { - var deptP SysFileDirOld - orm.Eloquent.Table(e.TableName()).Where("id = ?", e.PId).First(&deptP) - path = deptP.Path + path - } else { - path = "/0" + path - } - var mp = map[string]string{} - mp["path"] = path - if err := orm.Eloquent.Table(e.TableName()).Where("id = ?", e.Id).Updates(mp).Error; err != nil { - err := result.Error - return doc, err - } - doc = *e - doc.Path = path - - return doc, nil -} - -// 获取SysFileDirOld -func (e *SysFileDirOld) Get() (SysFileDirOld, error) { - var doc SysFileDirOld - table := orm.Eloquent.Table(e.TableName()) - - if e.Id != 0 { - table = table.Where("id = ?", e.Id) - } - - if err := table.First(&doc).Error; err != nil { - return doc, err - } - return doc, nil -} - -// 获取SysFileDirOld带分页 -func (e *SysFileDirOld) GetPage() ([]SysFileDirOld, int, error) { - var doc []SysFileDirOld - - table := orm.Eloquent.Table(e.TableName()) - var count int64 - - if err := table.Find(&doc).Error; err != nil { - return nil, 0, err - } - table.Where("`deleted_at` IS NULL").Count(&count) - return doc, int(count), nil -} - -// 更新SysFileDirOld -func (e *SysFileDirOld) Update(id int) (update SysFileDirOld, err error) { - if err = orm.Eloquent.Table(e.TableName()).Where("id = ?", id).First(&update).Error; err != nil { - return - } - - path := "/" + tools.IntToString(e.Id) - if int(e.Id) != 0 { - var deptP SysFileDirOld - orm.Eloquent.Table(e.TableName()).Where("id = ?", e.Id).First(&deptP) - path = deptP.Path + path - } else { - path = "/0" + path - } - e.Path = path - - if err = orm.Eloquent.Table(e.TableName()).Model(&update).Updates(&e).Error; err != nil { - return - } - return -} - -// 删除SysFileDirOld -func (e *SysFileDirOld) Delete(id int) (success bool, err error) { - if err = orm.Eloquent.Table(e.TableName()).Where("id = ?", id).Delete(&SysFileDirOld{}).Error; err != nil { - success = false - return - } - success = true - return -} - -//批量删除 -func (e *SysFileDirOld) BatchDelete(id []int) (Result bool, err error) { - if err = orm.Eloquent.Table(e.TableName()).Where("id in (?)", id).Delete(&SysFileDirOld{}).Error; err != nil { - return - } - Result = true - return -} - -func (e *SysFileDirOld) SetSysFileDirOld() ([]SysFileDirOld, error) { - list, _, err := e.GetPage() - - m := make([]SysFileDirOld, 0) - for i := 0; i < len(list); i++ { - if list[i].PId != 0 { - continue - } - info := SysFileDirOldDigui(&list, list[i]) - - m = append(m, info) - } - return m, err -} - -func SysFileDirOldDigui(deptlist *[]SysFileDirOld, menu SysFileDirOld) SysFileDirOld { - list := *deptlist - - min := make([]SysFileDirOld, 0) - for j := 0; j < len(list); j++ { - - if menu.Id != list[j].PId { - continue - } - mi := SysFileDirOld{} - mi.Id = list[j].Id - mi.PId = list[j].PId - mi.Label = list[j].Label - mi.Sort = list[j].Sort - mi.CreatedAt = list[j].CreatedAt - mi.UpdatedAt = list[j].UpdatedAt - mi.Children = []SysFileDirOld{} - ms := SysFileDirOldDigui(deptlist, mi) - min = append(min, ms) - - } - menu.Children = min - return menu -} diff --git a/app/admin/models/login.go b/app/admin/models/login.go index 26a4c4b..a045976 100644 --- a/app/admin/models/login.go +++ b/app/admin/models/login.go @@ -14,7 +14,7 @@ type Login struct { func (u *Login) GetUser() (user SysUser, role SysRole, e error) { - e = orm.Eloquent.Table("sys_user").Where("username = ? ", u.Username).Find(&user).Error + e = orm.Eloquent.Table("sys_user").Where("username = ? and status = 2", u.Username).Find(&user).Error if e != nil { return } diff --git a/app/admin/models/sys_file_dir.go b/app/admin/models/sys_file_dir.go index 1254d43..4b167d1 100644 --- a/app/admin/models/sys_file_dir.go +++ b/app/admin/models/sys_file_dir.go @@ -13,18 +13,18 @@ type SysFileDir struct { Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称 PId uint `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录 //Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序 - Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径 + Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径 } type SysFileDirL struct { gorm.Model models.ControlBy - Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称 - PId uint `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录 + Label string `json:"label" gorm:"type:varchar(255);comment:目录名称"` // 目录名称 + PId uint `json:"pId" gorm:"type:int(11);comment:上级目录"` // 上级目录 //Sort string `json:"sort" gorm:"type:bigint(20);comment:排序"` // 排序 - Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径 - Children []SysFileDirL `json:"children" gorm:"-"` // 下级信息 + Path string `json:"path" gorm:"type:varchar(255);comment:路径"` // 路径 + Children []SysFileDirL `json:"children" gorm:"-"` // 下级信息 } func (SysFileDir) TableName() string { /**/ diff --git a/app/admin/models/sysfileinfo.go b/app/admin/models/sysfileinfo.go deleted file mode 100644 index 6b7bfa8..0000000 --- a/app/admin/models/sysfileinfo.go +++ /dev/null @@ -1,111 +0,0 @@ -package models - -import ( - orm "go-admin/common/global" -) - -type SysFileInfoOld struct { - Id int `json:"id"` // id - Type string `json:"type" gorm:"type:varchar(255);"` // 文件类型 - Name string `json:"name" gorm:"type:varchar(255);"` // 文件名称 - Size string `json:"size" gorm:"type:int(11);"` // 文件大小 - PId int `json:"pId" gorm:"type:int(11);"` // 目录id - Source string `json:"source" gorm:"type:varchar(255);"` // 文件源 - Url string `json:"url" gorm:"type:varchar(255);"` // 文件路径 - FullUrl string `json:"fullUrl" gorm:"type:varchar(255);"` // 文件全路径 - CreateBy string `json:"createBy" gorm:"type:varchar(128);"` // 创建人 - UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"` // 编辑人 - DataScope string `json:"dataScope" gorm:"-"` - Params string `json:"params" gorm:"-"` - BaseModel -} - -func (SysFileInfoOld) TableName() string { - return "sys_file_info" -} - -// 创建SysFileInfoOld -func (e *SysFileInfoOld) Create() (SysFileInfoOld, error) { - var doc SysFileInfoOld - result := orm.Eloquent.Table(e.TableName()).Create(&e) - if result.Error != nil { - err := result.Error - return doc, err - } - doc = *e - return doc, nil -} - -// 获取SysFileInfoOld -func (e *SysFileInfoOld) Get() (SysFileInfoOld, error) { - var doc SysFileInfoOld - table := orm.Eloquent.Table(e.TableName()) - - if e.Id != 0 { - table = table.Where("id = ?", e.Id) - } - - if err := table.First(&doc).Error; err != nil { - return doc, err - } - return doc, nil -} - -// 获取SysFileInfoOld带分页 -func (e *SysFileInfoOld) GetPage(pageSize int, pageIndex int) ([]SysFileInfoOld, int, error) { - var doc []SysFileInfoOld - - table := orm.Eloquent.Table(e.TableName()) - - if e.PId != 0 { - table = table.Where("p_id = ?", e.PId) - } - - // 数据权限控制(如果不需要数据权限请将此处去掉) - //dataPermission := new(DataPermission) - //dataPermission.UserId, _ = tools.StringToInt(e.DataScope) - //table, err := dataPermission.GetDataScope(e.TableName(), table) - //if err != nil { - // return nil, 0, err - //} - var count int64 - - if err := table.Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Offset(-1).Limit(-1).Count(&count).Error; err != nil { - return nil, 0, err - } - //table.Where("`deleted_at` IS NULL").Count(&count) - return doc, int(count), nil -} - -// 更新SysFileInfoOld -func (e *SysFileInfoOld) Update(id int) (update SysFileInfoOld, err error) { - if err = orm.Eloquent.Table(e.TableName()).Where("id = ?", id).First(&update).Error; err != nil { - return - } - - //参数1:是要修改的数据 - //参数2:是修改的数据 - if err = orm.Eloquent.Table(e.TableName()).Model(&update).Updates(&e).Error; err != nil { - return - } - return -} - -// 删除SysFileInfoOld -func (e *SysFileInfoOld) Delete(id int) (success bool, err error) { - if err = orm.Eloquent.Table(e.TableName()).Where("id = ?", id).Delete(&SysFileInfoOld{}).Error; err != nil { - success = false - return - } - success = true - return -} - -//批量删除 -func (e *SysFileInfoOld) BatchDelete(id []int) (Result bool, err error) { - if err = orm.Eloquent.Table(e.TableName()).Where("id in (?)", id).Delete(&SysFileInfoOld{}).Error; err != nil { - return - } - Result = true - return -} diff --git a/cmd/migrate/migration/version/1599190683670_migrate.go b/cmd/migrate/migration/version/1599190683670_migrate.go index 8271179..07f0d8b 100644 --- a/cmd/migrate/migration/version/1599190683670_migrate.go +++ b/cmd/migrate/migration/version/1599190683670_migrate.go @@ -21,10 +21,10 @@ func _1599190683670Test(db *gorm.DB, version string) error { return db.Transaction(func(tx *gorm.DB) error { list3 := []models.SysDept{ - {DeptId: 1, ParentId: 0, DeptPath: "/0/1", DeptName: "爱拓科技", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "0", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DeptId: 7, ParentId: 1, DeptPath: "/0/1/7", DeptName: "研发部", Sort: 1, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "0", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DeptId: 8, ParentId: 1, DeptPath: "/0/1/8", DeptName: "运维部", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "0", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DeptId: 9, ParentId: 1, DeptPath: "/0/1/9", DeptName: "客服部", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "0", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DeptId: 1, ParentId: 0, DeptPath: "/0/1", DeptName: "爱拓科技", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DeptId: 7, ParentId: 1, DeptPath: "/0/1/7", DeptName: "研发部", Sort: 1, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DeptId: 8, ParentId: 1, DeptPath: "/0/1/8", DeptName: "运维部", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DeptId: 9, ParentId: 1, DeptPath: "/0/1/9", DeptName: "客服部", Sort: 0, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "2", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, {DeptId: 10, ParentId: 1, DeptPath: "/0/1/10", DeptName: "人力资源", Sort: 3, Leader: "aituo", Phone: "13782218188", Email: "atuo@aituo.com", Status: "1", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, } @@ -35,26 +35,26 @@ func _1599190683670Test(db *gorm.DB, version string) error { } list5 := []models.Post{ - {PostId: 1, PostName: "首席执行官", PostCode: "CEO", Sort: 0, Status: "0", Remark: "首席执行官", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {PostId: 2, PostName: "首席技术执行官", PostCode: "CTO", Sort: 2, Status: "0", Remark: "首席技术执行官", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {PostId: 3, PostName: "首席运营官", PostCode: "COO", Sort: 3, Status: "0", Remark: "测试工程师", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {PostId: 1, PostName: "首席执行官", PostCode: "CEO", Sort: 0, Status: "2", Remark: "首席执行官", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {PostId: 2, PostName: "首席技术执行官", PostCode: "CTO", Sort: 2, Status: "2", Remark: "首席技术执行官", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {PostId: 3, PostName: "首席运营官", PostCode: "COO", Sort: 3, Status: "2", Remark: "测试工程师", CreateBy: "1", UpdateBy: "1", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, } list6 := []models.SysRole{ - {1, "系统管理员", "0", "admin", 1, "", "1", "", "", true, "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, "", []int{}, []int{}}, + {1, "系统管理员", "2", "admin", 1, "", "1", "", "", true, "", models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}, "", []int{}, []int{}}, } list7 := []models.DictType{ - {DictId: 1, DictName: "系统开关", DictType: "sys_normal_disable", Status: "0", CreateBy: "1", UpdateBy: "1", Remark: "系统开关列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 2, DictName: "用户性别", DictType: "sys_user_sex", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "用户性别列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 3, DictName: "菜单状态", DictType: "sys_show_hide", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "菜单状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 4, DictName: "系统是否", DictType: "sys_yes_no", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "系统是否列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 5, DictName: "任务状态", DictType: "sys_job_status", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "任务状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 6, DictName: "任务分组", DictType: "sys_job_group", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "任务分组列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 7, DictName: "通知类型", DictType: "sys_notice_type", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "通知类型列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 8, DictName: "系统状态", DictType: "sys_common_status", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "登录状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 9, DictName: "操作类型", DictType: "sys_oper_type", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "操作类型列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictId: 10, DictName: "通知状态", DictType: "sys_notice_status", Status: "0", CreateBy: "1", UpdateBy: "", Remark: "通知状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 1, DictName: "系统开关", DictType: "sys_normal_disable", Status: "2", CreateBy: "1", UpdateBy: "1", Remark: "系统开关列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 2, DictName: "用户性别", DictType: "sys_user_sex", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "用户性别列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 3, DictName: "菜单状态", DictType: "sys_show_hide", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "菜单状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 4, DictName: "系统是否", DictType: "sys_yes_no", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "系统是否列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 5, DictName: "任务状态", DictType: "sys_job_status", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "任务状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 6, DictName: "任务分组", DictType: "sys_job_group", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "任务分组列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 7, DictName: "通知类型", DictType: "sys_notice_type", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "通知类型列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 8, DictName: "系统状态", DictType: "sys_common_status", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "登录状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 9, DictName: "操作类型", DictType: "sys_oper_type", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "操作类型列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictId: 10, DictName: "通知状态", DictType: "sys_notice_status", Status: "2", CreateBy: "1", UpdateBy: "", Remark: "通知状态列表", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, } list8 := []models.SysUser{ @@ -62,37 +62,37 @@ func _1599190683670Test(db *gorm.DB, version string) error { } list9 := []models.DictData{ - {DictCode: 1, DictSort: 0, DictLabel: "正常", DictValue: "0", DictType: "sys_normal_disable", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统正常", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 2, DictSort: 0, DictLabel: "停用", DictValue: "1", DictType: "sys_normal_disable", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统停用", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 3, DictSort: 0, DictLabel: "男", DictValue: "0", DictType: "sys_user_sex", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "性别男", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 4, DictSort: 0, DictLabel: "女", DictValue: "1", DictType: "sys_user_sex", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "性别女", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 5, DictSort: 0, DictLabel: "未知", DictValue: "2", DictType: "sys_user_sex", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "性别未知", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 6, DictSort: 0, DictLabel: "显示", DictValue: "0", DictType: "sys_show_hide", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "显示菜单", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 7, DictSort: 0, DictLabel: "隐藏", DictValue: "1", DictType: "sys_show_hide", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "隐藏菜单", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 8, DictSort: 0, DictLabel: "是", DictValue: "Y", DictType: "sys_yes_no", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统默认是", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 9, DictSort: 0, DictLabel: "否", DictValue: "N", DictType: "sys_yes_no", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统默认否", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 10, DictSort: 0, DictLabel: "正常", DictValue: "2", DictType: "sys_job_status", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "正常状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 11, DictSort: 0, DictLabel: "停用", DictValue: "1", DictType: "sys_job_status", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "停用状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 12, DictSort: 0, DictLabel: "默认", DictValue: "DEFAULT", DictType: "sys_job_group", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "默认分组", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 13, DictSort: 0, DictLabel: "系统", DictValue: "SYSTEM", DictType: "sys_job_group", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统分组", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 14, DictSort: 0, DictLabel: "通知", DictValue: "1", DictType: "sys_notice_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "通知", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 15, DictSort: 0, DictLabel: "公告", DictValue: "2", DictType: "sys_notice_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "公告", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 16, DictSort: 0, DictLabel: "正常", DictValue: "0", DictType: "sys_common_status", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "正常状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 17, DictSort: 0, DictLabel: "关闭", DictValue: "1", DictType: "sys_common_status", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "关闭状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 18, DictSort: 0, DictLabel: "新增", DictValue: "1", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "新增操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 19, DictSort: 0, DictLabel: "修改", DictValue: "2", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "修改操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 20, DictSort: 0, DictLabel: "删除", DictValue: "3", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "删除操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 21, DictSort: 0, DictLabel: "授权", DictValue: "4", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "授权操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 22, DictSort: 0, DictLabel: "导出", DictValue: "5", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "导出操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 23, DictSort: 0, DictLabel: "导入", DictValue: "6", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "导入操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 24, DictSort: 0, DictLabel: "强退", DictValue: "7", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "强退操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 25, DictSort: 0, DictLabel: "生成代码", DictValue: "8", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "生成操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 26, DictSort: 0, DictLabel: "清空数据", DictValue: "9", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "清空操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 27, DictSort: 0, DictLabel: "成功", DictValue: "0", DictType: "sys_notice_status", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "成功状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 28, DictSort: 0, DictLabel: "失败", DictValue: "1", DictType: "sys_notice_status", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "", Remark: "失败状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 29, DictSort: 0, DictLabel: "登录", DictValue: "10", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "1", Remark: "登录操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 30, DictSort: 0, DictLabel: "退出", DictValue: "11", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "1", Remark: "", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, - {DictCode: 31, DictSort: 0, DictLabel: "获取验证码", DictValue: "12", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "0", Default: "", CreateBy: "1", UpdateBy: "1", Remark: "获取验证码", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 1, DictSort: 0, DictLabel: "正常", DictValue: "2", DictType: "sys_normal_disable", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统正常", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 2, DictSort: 0, DictLabel: "停用", DictValue: "1", DictType: "sys_normal_disable", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统停用", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 3, DictSort: 0, DictLabel: "男", DictValue: "0", DictType: "sys_user_sex", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "性别男", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 4, DictSort: 0, DictLabel: "女", DictValue: "1", DictType: "sys_user_sex", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "性别女", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 5, DictSort: 0, DictLabel: "未知", DictValue: "2", DictType: "sys_user_sex", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "性别未知", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 6, DictSort: 0, DictLabel: "显示", DictValue: "0", DictType: "sys_show_hide", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "显示菜单", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 7, DictSort: 0, DictLabel: "隐藏", DictValue: "1", DictType: "sys_show_hide", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "隐藏菜单", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 8, DictSort: 0, DictLabel: "是", DictValue: "Y", DictType: "sys_yes_no", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统默认是", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 9, DictSort: 0, DictLabel: "否", DictValue: "N", DictType: "sys_yes_no", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统默认否", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 10, DictSort: 0, DictLabel: "正常", DictValue: "2", DictType: "sys_job_status", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "正常状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 11, DictSort: 0, DictLabel: "停用", DictValue: "1", DictType: "sys_job_status", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "停用状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 12, DictSort: 0, DictLabel: "默认", DictValue: "DEFAULT", DictType: "sys_job_group", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "默认分组", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 13, DictSort: 0, DictLabel: "系统", DictValue: "SYSTEM", DictType: "sys_job_group", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "系统分组", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 14, DictSort: 0, DictLabel: "通知", DictValue: "1", DictType: "sys_notice_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "通知", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 15, DictSort: 0, DictLabel: "公告", DictValue: "2", DictType: "sys_notice_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "公告", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 16, DictSort: 0, DictLabel: "正常", DictValue: "0", DictType: "sys_common_status", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "正常状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 17, DictSort: 0, DictLabel: "关闭", DictValue: "1", DictType: "sys_common_status", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "关闭状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 18, DictSort: 0, DictLabel: "新增", DictValue: "1", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "新增操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 19, DictSort: 0, DictLabel: "修改", DictValue: "2", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "修改操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 20, DictSort: 0, DictLabel: "删除", DictValue: "3", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "删除操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 21, DictSort: 0, DictLabel: "授权", DictValue: "4", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "授权操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 22, DictSort: 0, DictLabel: "导出", DictValue: "5", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "导出操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 23, DictSort: 0, DictLabel: "导入", DictValue: "6", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "导入操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 24, DictSort: 0, DictLabel: "强退", DictValue: "7", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "强退操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 25, DictSort: 0, DictLabel: "生成代码", DictValue: "8", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "生成操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 26, DictSort: 0, DictLabel: "清空数据", DictValue: "9", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "清空操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 27, DictSort: 0, DictLabel: "成功", DictValue: "0", DictType: "sys_notice_status", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "成功状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 28, DictSort: 0, DictLabel: "失败", DictValue: "1", DictType: "sys_notice_status", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "", Remark: "失败状态", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 29, DictSort: 0, DictLabel: "登录", DictValue: "10", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "1", Remark: "登录操作", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 30, DictSort: 0, DictLabel: "退出", DictValue: "11", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "1", Remark: "", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {DictCode: 31, DictSort: 0, DictLabel: "获取验证码", DictValue: "12", DictType: "sys_oper_type", CssClass: "", ListClass: "", IsDefault: "", Status: "2", Default: "", CreateBy: "1", UpdateBy: "1", Remark: "获取验证码", BaseModel: models.BaseModel{CreatedAt: time.Now(), UpdatedAt: time.Now()}}, } list10 := []models.SysSetting{ diff --git a/cmd/migrate/migration/version/1606579402398_migrate.go b/cmd/migrate/migration/version/1606579402398_migrate.go new file mode 100644 index 0000000..845c1f9 --- /dev/null +++ b/cmd/migrate/migration/version/1606579402398_migrate.go @@ -0,0 +1,43 @@ +package version + +import ( + "go-admin/app/admin/models" + //"go-admin/app/admin/models" + "gorm.io/gorm" + "runtime" + + "go-admin/cmd/migrate/migration" + common "go-admin/common/models" +) + +func init() { + _, fileName, _, _ := runtime.Caller(0) + migration.Migrate.SetVersion(migration.GetFilename(fileName), _1606579402398Test) +} + +func _1606579402398Test(db *gorm.DB, version string) error { + return db.Transaction(func(tx *gorm.DB) error { + + dicData := models.DictData{} + err := tx.Model(&dicData).Where("dict_code = ?", 1).Update("dict_value", 2).Error + if err != nil { + return err + } + + dicType := models.DictType{} + err = tx.Model(&dicType).Where("status = ?", 0).Update("status", 2).Error + if err != nil { + return err + } + + user := models.SysUser{} + err = tx.Model(&user).Where("user_id = ?", 1).Update("status", 2).Error + if err != nil { + return err + } + + return tx.Create(&common.Migration{ + Version: version, + }).Error + }) +} diff --git a/cmd/migrate/migration/version/1606582844753_migrate.go b/cmd/migrate/migration/version/1606582844753_migrate.go new file mode 100644 index 0000000..e99d360 --- /dev/null +++ b/cmd/migrate/migration/version/1606582844753_migrate.go @@ -0,0 +1,38 @@ +package version + +import ( + "go-admin/app/admin/models" + //"go-admin/app/admin/models" + "gorm.io/gorm" + "runtime" + + "go-admin/cmd/migrate/migration" + common "go-admin/common/models" +) + +func init() { + _, fileName, _, _ := runtime.Caller(0) + migration.Migrate.SetVersion(migration.GetFilename(fileName), _1606582844753Test) +} + +func _1606582844753Test(db *gorm.DB, version string) error { + return db.Transaction(func(tx *gorm.DB) error { + + + dept := models.SysDept{} + err := tx.Model(&dept).Where("status = ?", 0).Update("status", 2).Error + if err != nil { + return err + } + + dictData := models.DictData{} + err = tx.Model(&dictData).Where("status = ?", 0).Update("status", 2).Error + if err != nil { + return err + } + + return tx.Create(&common.Migration{ + Version: version, + }).Error + }) +} diff --git a/common/global/adm.go b/common/global/adm.go index fad74f4..291e4fe 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -12,7 +12,7 @@ import ( const ( // go-admin Version Info - Version = "1.2.2" + Version = "1.2.3" ) var Cfg config.Conf = config.DefaultConfig() diff --git a/docs/docs.go b/docs/docs.go index e82ac1d..fd461e2 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,6 +1,5 @@ // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// This file was generated by swaggo/swag at -// 2020-08-27 14:47:40.749512 +0800 CST m=+0.171410739 +// This file was generated by swaggo/swag package docs @@ -22,190 +21,13 @@ var doc = `{ "contact": {}, "license": { "name": "MIT", - "url": "https://github.com/wenjianzhang/go-admin/blob/master/LICENSE.md" + "url": "https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md" }, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/api/v1/config": { - "put": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "配置" - ], - "summary": "修改配置", - "parameters": [ - { - "description": "body", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.SysConfig" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/config/{configId}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "配置" - ], - "summary": "获取配置", - "parameters": [ - { - "type": "integer", - "description": "配置编码", - "name": "configId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - }, - "delete": { - "description": "删除数据", - "tags": [ - "配置" - ], - "summary": "删除配置", - "parameters": [ - { - "type": "integer", - "description": "configId", - "name": "configId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/configKey/{configKey}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "配置" - ], - "summary": "获取配置", - "parameters": [ - { - "type": "integer", - "description": "configKey", - "name": "configKey", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, - "/api/v1/configList": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "配置" - ], - "summary": "配置列表数据", - "parameters": [ - { - "type": "string", - "description": "configKey", - "name": "configKey", - "in": "query" - }, - { - "type": "string", - "description": "configName", - "name": "configName", - "in": "query" - }, - { - "type": "string", - "description": "configType", - "name": "configType", - "in": "query" - }, - { - "type": "integer", - "description": "页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, "/api/v1/db/columns/page": { "get": { "description": "数据库表列分页列表 / database table column page list", @@ -309,7 +131,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysDept" } } @@ -344,7 +165,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysDept" } } @@ -485,7 +305,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.DictType" } } @@ -520,7 +339,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.DictType" } } @@ -697,7 +515,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.DictType" } } @@ -732,7 +549,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.DictType" } } @@ -795,7 +611,7 @@ var doc = `{ "200": { "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "$ref": "#/definitions/app.PageResponse" + "$ref": "#/definitions/app.Response" } } } @@ -856,187 +672,6 @@ var doc = `{ } } }, - "/api/v1/loginlog": { - "put": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "登录日志" - ], - "summary": "修改登录日志", - "parameters": [ - { - "description": "body", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.LoginLog" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - }, - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "登录日志" - ], - "summary": "添加登录日志", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.LoginLog" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/loginlog/{infoId}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "登录日志" - ], - "summary": "通过编码获取登录日志", - "parameters": [ - { - "type": "integer", - "description": "infoId", - "name": "infoId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - }, - "delete": { - "description": "删除数据", - "tags": [ - "登录日志" - ], - "summary": "批量删除登录日志", - "parameters": [ - { - "type": "string", - "description": "以逗号(,)分割的infoId", - "name": "infoId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/loginloglist": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "登录日志" - ], - "summary": "登录日志列表", - "parameters": [ - { - "type": "string", - "description": "status", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "dictCode", - "name": "dictCode", - "in": "query" - }, - { - "type": "string", - "description": "dictType", - "name": "dictType", - "in": "query" - }, - { - "type": "integer", - "description": "页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, "/api/v1/menu": { "get": { "security": [ @@ -1162,7 +797,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Menu" } } @@ -1318,154 +952,6 @@ var doc = `{ } } }, - "/api/v1/operlog": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "操作日志" - ], - "summary": "添加操作日志", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.SysOperLog" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/operlog/{infoId}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "登录日志" - ], - "summary": "通过编码获取登录日志", - "parameters": [ - { - "type": "integer", - "description": "infoId", - "name": "infoId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, - "/api/v1/operlog/{operId}": { - "delete": { - "description": "删除数据", - "tags": [ - "操作日志" - ], - "summary": "批量删除操作日志", - "parameters": [ - { - "type": "string", - "description": "以逗号(,)分割的operId", - "name": "operId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/operloglist": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "登录日志" - ], - "summary": "登录日志列表", - "parameters": [ - { - "type": "string", - "description": "status", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "dictCode", - "name": "dictCode", - "in": "query" - }, - { - "type": "string", - "description": "dictType", - "name": "dictType", - "in": "query" - }, - { - "type": "integer", - "description": "页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, "/api/v1/post": { "get": { "security": [ @@ -1534,7 +1020,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Post" } } @@ -1571,7 +1056,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Post" } } @@ -1728,7 +1212,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysRole" } } @@ -1758,7 +1241,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysRole" } } @@ -1971,7 +1453,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/tools.SysTables" } } @@ -2146,7 +1627,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysUser" } } @@ -2222,38 +1702,6 @@ var doc = `{ } } }, - "/api/v1/syscategory": { - "post": { - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "分类" - ], - "summary": "添加分类", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.SysCategory" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/api/v1/syscontent": { "post": { "description": "获取JSON", @@ -2271,7 +1719,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysContent" } } @@ -2286,38 +1733,6 @@ var doc = `{ } } }, - "/api/v1/sysfiledir": { - "post": { - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "SysFileDir" - ], - "summary": "添加SysFileDir", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.SysFileDir" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/api/v1/system/setting": { "post": { "description": "获取JSON", @@ -2332,7 +1747,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysUser" } } @@ -2364,7 +1778,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysUser" } } @@ -2468,7 +1881,6 @@ var doc = `{ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Login" } } @@ -2504,157 +1916,9 @@ var doc = `{ } } } - }, - "/sd/cpu": { - "get": { - "description": "CPU 使用量 DiskCheck checks the disk usage.", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "CPU 使用量", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/sd/disk": { - "get": { - "description": "服务器硬盘使用量 DiskCheck checks the disk usage.", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "服务器硬盘使用量", - "responses": { - "200": { - "description": "OK - Free space: 16321MB (15GB) / 51200MB (50GB) | Used: 31%", - "schema": { - "type": "string" - } - }, - "429": { - "description": "WARNING", - "schema": { - "type": "string" - } - }, - "500": { - "description": "CRITICAL", - "schema": { - "type": "string" - } - } - } - } - }, - "/sd/health": { - "get": { - "description": "健康状况", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "健康状况 HealthCheck shows OK as the ping-pong result.", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/sd/os": { - "get": { - "description": "Os", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "OS", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/sd/ram": { - "get": { - "description": "内存使用量 RAMCheck checks the disk usage.", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "内存使用量", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } } }, "definitions": { - "app.Page": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "list": { - "type": "object" - }, - "pageIndex": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - } - } - }, - "app.PageResponse": { - "type": "object", - "properties": { - "code": { - "description": "代码", - "type": "integer", - "example": 200 - }, - "data": { - "description": "数据集", - "type": "object", - "$ref": "#/definitions/app.Page" - }, - "msg": { - "description": "消息", - "type": "string" - } - } - }, "app.Response": { "type": "object", "properties": { @@ -2670,6 +1934,9 @@ var doc = `{ "msg": { "description": "消息", "type": "string" + }, + "requestId": { + "type": "string" } } }, @@ -2743,78 +2010,6 @@ var doc = `{ } } }, - "models.LoginLog": { - "type": "object", - "properties": { - "browser": { - "description": "浏览器", - "type": "string" - }, - "createBy": { - "description": "创建人", - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "description": "数据", - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "infoId": { - "description": "主键", - "type": "integer" - }, - "ipaddr": { - "description": "ip地址", - "type": "string" - }, - "loginLocation": { - "description": "归属地", - "type": "string" - }, - "loginTime": { - "description": "登录时间", - "type": "string" - }, - "msg": { - "type": "string" - }, - "os": { - "description": "系统", - "type": "string" - }, - "params": { - "type": "string" - }, - "platform": { - "description": "固件", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "status": { - "description": "状态", - "type": "string" - }, - "updateBy": { - "description": "更新者", - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, "models.Menu": { "type": "object", "properties": { @@ -2951,108 +2146,6 @@ var doc = `{ } } }, - "models.SysCategory": { - "type": "object", - "properties": { - "createBy": { - "description": "创建者", - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "id": { - "description": "分类Id", - "type": "integer" - }, - "img": { - "description": "图片", - "type": "string" - }, - "name": { - "description": "名称", - "type": "string" - }, - "params": { - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "sort": { - "description": "排序", - "type": "string" - }, - "status": { - "description": "状态", - "type": "string" - }, - "updateBy": { - "description": "更新者", - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "models.SysConfig": { - "type": "object", - "properties": { - "configId": { - "description": "编码", - "type": "integer" - }, - "configKey": { - "description": "参数键名", - "type": "string" - }, - "configName": { - "description": "参数名称", - "type": "string" - }, - "configType": { - "description": "是否系统内置", - "type": "string" - }, - "configValue": { - "description": "参数键值", - "type": "string" - }, - "createBy": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "params": { - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "updateBy": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, "models.SysContent": { "type": "object", "properties": { @@ -3180,163 +2273,6 @@ var doc = `{ } } }, - "models.SysFileDir": { - "type": "object", - "properties": { - "children": { - "type": "array", - "items": { - "$ref": "#/definitions/models.SysFileDir" - } - }, - "createBy": { - "description": "创建人", - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "label": { - "description": "名称", - "type": "string" - }, - "pId": { - "description": "父id", - "type": "integer" - }, - "params": { - "type": "string" - }, - "path": { - "type": "string" - }, - "sort": { - "description": "排序", - "type": "integer" - }, - "updateBy": { - "description": "编辑人", - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "models.SysOperLog": { - "type": "object", - "properties": { - "businessType": { - "description": "操作类型", - "type": "string" - }, - "businessTypes": { - "type": "string" - }, - "createBy": { - "description": "创建人", - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "description": "数据", - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "deptName": { - "description": "部门名称", - "type": "string" - }, - "jsonResult": { - "description": "返回数据", - "type": "string" - }, - "latencyime": { - "description": "耗时", - "type": "string" - }, - "method": { - "description": "函数", - "type": "string" - }, - "operId": { - "description": "日志编码", - "type": "integer" - }, - "operIp": { - "description": "客户端ip", - "type": "string" - }, - "operLocation": { - "description": "访问位置", - "type": "string" - }, - "operName": { - "description": "操作者", - "type": "string" - }, - "operParam": { - "description": "请求参数", - "type": "string" - }, - "operTime": { - "description": "操作时间", - "type": "string" - }, - "operUrl": { - "description": "访问地址", - "type": "string" - }, - "operatorType": { - "description": "操作类型", - "type": "string" - }, - "params": { - "description": "参数", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "requestMethod": { - "description": "请求方式", - "type": "string" - }, - "status": { - "description": "操作状态", - "type": "string" - }, - "title": { - "description": "操作模块", - "type": "string" - }, - "updateBy": { - "description": "更新者", - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "userAgent": { - "description": "ua", - "type": "string" - } - } - }, "models.SysRole": { "type": "object", "properties": { @@ -3665,6 +2601,15 @@ var doc = `{ "description": "功能名称", "type": "string" }, + "isActions": { + "type": "integer" + }, + "isAuth": { + "type": "integer" + }, + "isDataScope": { + "type": "integer" + }, "isLogicalDelete": { "type": "string" }, @@ -3686,7 +2631,6 @@ var doc = `{ "type": "string" }, "params": { - "type": "object", "$ref": "#/definitions/tools.Params" }, "pkColumn": { diff --git a/docs/swagger.json b/docs/swagger.json index d14e8cc..a973b90 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -11,183 +11,6 @@ "version": "1.0.1" }, "paths": { - "/api/v1/config": { - "put": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "配置" - ], - "summary": "修改配置", - "parameters": [ - { - "description": "body", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.SysConfig" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/config/{configId}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "配置" - ], - "summary": "获取配置", - "parameters": [ - { - "type": "integer", - "description": "配置编码", - "name": "configId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - }, - "delete": { - "description": "删除数据", - "tags": [ - "配置" - ], - "summary": "删除配置", - "parameters": [ - { - "type": "integer", - "description": "configId", - "name": "configId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/configKey/{configKey}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "配置" - ], - "summary": "获取配置", - "parameters": [ - { - "type": "integer", - "description": "configKey", - "name": "configKey", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, - "/api/v1/configList": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "配置" - ], - "summary": "配置列表数据", - "parameters": [ - { - "type": "string", - "description": "configKey", - "name": "configKey", - "in": "query" - }, - { - "type": "string", - "description": "configName", - "name": "configName", - "in": "query" - }, - { - "type": "string", - "description": "configType", - "name": "configType", - "in": "query" - }, - { - "type": "integer", - "description": "页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, "/api/v1/db/columns/page": { "get": { "description": "数据库表列分页列表 / database table column page list", @@ -291,7 +114,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysDept" } } @@ -326,7 +148,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysDept" } } @@ -467,7 +288,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.DictType" } } @@ -502,7 +322,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.DictType" } } @@ -679,7 +498,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.DictType" } } @@ -714,7 +532,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.DictType" } } @@ -777,7 +594,7 @@ "200": { "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "$ref": "#/definitions/app.PageResponse" + "$ref": "#/definitions/app.Response" } } } @@ -838,187 +655,6 @@ } } }, - "/api/v1/loginlog": { - "put": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "登录日志" - ], - "summary": "修改登录日志", - "parameters": [ - { - "description": "body", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.LoginLog" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - }, - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "登录日志" - ], - "summary": "添加登录日志", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.LoginLog" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/loginlog/{infoId}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "登录日志" - ], - "summary": "通过编码获取登录日志", - "parameters": [ - { - "type": "integer", - "description": "infoId", - "name": "infoId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - }, - "delete": { - "description": "删除数据", - "tags": [ - "登录日志" - ], - "summary": "批量删除登录日志", - "parameters": [ - { - "type": "string", - "description": "以逗号(,)分割的infoId", - "name": "infoId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/loginloglist": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "登录日志" - ], - "summary": "登录日志列表", - "parameters": [ - { - "type": "string", - "description": "status", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "dictCode", - "name": "dictCode", - "in": "query" - }, - { - "type": "string", - "description": "dictType", - "name": "dictType", - "in": "query" - }, - { - "type": "integer", - "description": "页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, "/api/v1/menu": { "get": { "security": [ @@ -1144,7 +780,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Menu" } } @@ -1300,154 +935,6 @@ } } }, - "/api/v1/operlog": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "操作日志" - ], - "summary": "添加操作日志", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.SysOperLog" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/operlog/{infoId}": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "登录日志" - ], - "summary": "通过编码获取登录日志", - "parameters": [ - { - "type": "integer", - "description": "infoId", - "name": "infoId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, - "/api/v1/operlog/{operId}": { - "delete": { - "description": "删除数据", - "tags": [ - "操作日志" - ], - "summary": "批量删除操作日志", - "parameters": [ - { - "type": "string", - "description": "以逗号(,)分割的operId", - "name": "operId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/operloglist": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "登录日志" - ], - "summary": "登录日志列表", - "parameters": [ - { - "type": "string", - "description": "status", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "dictCode", - "name": "dictCode", - "in": "query" - }, - { - "type": "string", - "description": "dictType", - "name": "dictType", - "in": "query" - }, - { - "type": "integer", - "description": "页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/app.Response" - } - } - } - } - }, "/api/v1/post": { "get": { "security": [ @@ -1516,7 +1003,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Post" } } @@ -1553,7 +1039,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Post" } } @@ -1710,7 +1195,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysRole" } } @@ -1740,7 +1224,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysRole" } } @@ -1953,7 +1436,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/tools.SysTables" } } @@ -2128,7 +1610,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysUser" } } @@ -2204,38 +1685,6 @@ } } }, - "/api/v1/syscategory": { - "post": { - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "分类" - ], - "summary": "添加分类", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.SysCategory" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/api/v1/syscontent": { "post": { "description": "获取JSON", @@ -2253,7 +1702,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysContent" } } @@ -2268,38 +1716,6 @@ } } }, - "/api/v1/sysfiledir": { - "post": { - "description": "获取JSON", - "consumes": [ - "application/json" - ], - "tags": [ - "SysFileDir" - ], - "summary": "添加SysFileDir", - "parameters": [ - { - "description": "data", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/models.SysFileDir" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/api/v1/system/setting": { "post": { "description": "获取JSON", @@ -2314,7 +1730,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysUser" } } @@ -2346,7 +1761,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.SysUser" } } @@ -2450,7 +1864,6 @@ "in": "body", "required": true, "schema": { - "type": "object", "$ref": "#/definitions/models.Login" } } @@ -2486,157 +1899,9 @@ } } } - }, - "/sd/cpu": { - "get": { - "description": "CPU 使用量 DiskCheck checks the disk usage.", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "CPU 使用量", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/sd/disk": { - "get": { - "description": "服务器硬盘使用量 DiskCheck checks the disk usage.", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "服务器硬盘使用量", - "responses": { - "200": { - "description": "OK - Free space: 16321MB (15GB) / 51200MB (50GB) | Used: 31%", - "schema": { - "type": "string" - } - }, - "429": { - "description": "WARNING", - "schema": { - "type": "string" - } - }, - "500": { - "description": "CRITICAL", - "schema": { - "type": "string" - } - } - } - } - }, - "/sd/health": { - "get": { - "description": "健康状况", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "健康状况 HealthCheck shows OK as the ping-pong result.", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/sd/os": { - "get": { - "description": "Os", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "OS", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } - }, - "/sd/ram": { - "get": { - "description": "内存使用量 RAMCheck checks the disk usage.", - "consumes": [ - "text/html" - ], - "produces": [ - "text/html" - ], - "summary": "内存使用量", - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "string" - } - } - } - } } }, "definitions": { - "app.Page": { - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "list": { - "type": "object" - }, - "pageIndex": { - "type": "integer" - }, - "pageSize": { - "type": "integer" - } - } - }, - "app.PageResponse": { - "type": "object", - "properties": { - "code": { - "description": "代码", - "type": "integer", - "example": 200 - }, - "data": { - "description": "数据集", - "type": "object", - "$ref": "#/definitions/app.Page" - }, - "msg": { - "description": "消息", - "type": "string" - } - } - }, "app.Response": { "type": "object", "properties": { @@ -2652,6 +1917,9 @@ "msg": { "description": "消息", "type": "string" + }, + "requestId": { + "type": "string" } } }, @@ -2725,78 +1993,6 @@ } } }, - "models.LoginLog": { - "type": "object", - "properties": { - "browser": { - "description": "浏览器", - "type": "string" - }, - "createBy": { - "description": "创建人", - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "description": "数据", - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "infoId": { - "description": "主键", - "type": "integer" - }, - "ipaddr": { - "description": "ip地址", - "type": "string" - }, - "loginLocation": { - "description": "归属地", - "type": "string" - }, - "loginTime": { - "description": "登录时间", - "type": "string" - }, - "msg": { - "type": "string" - }, - "os": { - "description": "系统", - "type": "string" - }, - "params": { - "type": "string" - }, - "platform": { - "description": "固件", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "status": { - "description": "状态", - "type": "string" - }, - "updateBy": { - "description": "更新者", - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "username": { - "description": "用户名", - "type": "string" - } - } - }, "models.Menu": { "type": "object", "properties": { @@ -2933,108 +2129,6 @@ } } }, - "models.SysCategory": { - "type": "object", - "properties": { - "createBy": { - "description": "创建者", - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "id": { - "description": "分类Id", - "type": "integer" - }, - "img": { - "description": "图片", - "type": "string" - }, - "name": { - "description": "名称", - "type": "string" - }, - "params": { - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "sort": { - "description": "排序", - "type": "string" - }, - "status": { - "description": "状态", - "type": "string" - }, - "updateBy": { - "description": "更新者", - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "models.SysConfig": { - "type": "object", - "properties": { - "configId": { - "description": "编码", - "type": "integer" - }, - "configKey": { - "description": "参数键名", - "type": "string" - }, - "configName": { - "description": "参数名称", - "type": "string" - }, - "configType": { - "description": "是否系统内置", - "type": "string" - }, - "configValue": { - "description": "参数键值", - "type": "string" - }, - "createBy": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "params": { - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "updateBy": { - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, "models.SysContent": { "type": "object", "properties": { @@ -3162,163 +2256,6 @@ } } }, - "models.SysFileDir": { - "type": "object", - "properties": { - "children": { - "type": "array", - "items": { - "$ref": "#/definitions/models.SysFileDir" - } - }, - "createBy": { - "description": "创建人", - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "label": { - "description": "名称", - "type": "string" - }, - "pId": { - "description": "父id", - "type": "integer" - }, - "params": { - "type": "string" - }, - "path": { - "type": "string" - }, - "sort": { - "description": "排序", - "type": "integer" - }, - "updateBy": { - "description": "编辑人", - "type": "string" - }, - "updatedAt": { - "type": "string" - } - } - }, - "models.SysOperLog": { - "type": "object", - "properties": { - "businessType": { - "description": "操作类型", - "type": "string" - }, - "businessTypes": { - "type": "string" - }, - "createBy": { - "description": "创建人", - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "dataScope": { - "description": "数据", - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "deptName": { - "description": "部门名称", - "type": "string" - }, - "jsonResult": { - "description": "返回数据", - "type": "string" - }, - "latencyime": { - "description": "耗时", - "type": "string" - }, - "method": { - "description": "函数", - "type": "string" - }, - "operId": { - "description": "日志编码", - "type": "integer" - }, - "operIp": { - "description": "客户端ip", - "type": "string" - }, - "operLocation": { - "description": "访问位置", - "type": "string" - }, - "operName": { - "description": "操作者", - "type": "string" - }, - "operParam": { - "description": "请求参数", - "type": "string" - }, - "operTime": { - "description": "操作时间", - "type": "string" - }, - "operUrl": { - "description": "访问地址", - "type": "string" - }, - "operatorType": { - "description": "操作类型", - "type": "string" - }, - "params": { - "description": "参数", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "requestMethod": { - "description": "请求方式", - "type": "string" - }, - "status": { - "description": "操作状态", - "type": "string" - }, - "title": { - "description": "操作模块", - "type": "string" - }, - "updateBy": { - "description": "更新者", - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "userAgent": { - "description": "ua", - "type": "string" - } - } - }, "models.SysRole": { "type": "object", "properties": { @@ -3647,6 +2584,15 @@ "description": "功能名称", "type": "string" }, + "isActions": { + "type": "integer" + }, + "isAuth": { + "type": "integer" + }, + "isDataScope": { + "type": "integer" + }, "isLogicalDelete": { "type": "string" }, @@ -3668,7 +2614,6 @@ "type": "string" }, "params": { - "type": "object", "$ref": "#/definitions/tools.Params" }, "pkColumn": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f1d0542..0ef911f 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,29 +1,4 @@ definitions: - app.Page: - properties: - count: - type: integer - list: - type: object - pageIndex: - type: integer - pageSize: - type: integer - type: object - app.PageResponse: - properties: - code: - description: 代码 - example: 200 - type: integer - data: - $ref: '#/definitions/app.Page' - description: 数据集 - type: object - msg: - description: 消息 - type: string - type: object app.Response: properties: code: @@ -36,6 +11,8 @@ definitions: msg: description: 消息 type: string + requestId: + type: string type: object models.DictType: properties: @@ -86,58 +63,6 @@ definitions: - username - uuid type: object - models.LoginLog: - properties: - browser: - description: 浏览器 - type: string - createBy: - description: 创建人 - type: string - createdAt: - type: string - dataScope: - description: 数据 - type: string - deletedAt: - type: string - infoId: - description: 主键 - type: integer - ipaddr: - description: ip地址 - type: string - loginLocation: - description: 归属地 - type: string - loginTime: - description: 登录时间 - type: string - msg: - type: string - os: - description: 系统 - type: string - params: - type: string - platform: - description: 固件 - type: string - remark: - description: 备注 - type: string - status: - description: 状态 - type: string - updateBy: - description: 更新者 - type: string - updatedAt: - type: string - username: - description: 用户名 - type: string - type: object models.Menu: properties: action: @@ -230,78 +155,6 @@ definitions: updatedAt: type: string type: object - models.SysCategory: - properties: - createBy: - description: 创建者 - type: string - createdAt: - type: string - dataScope: - type: string - deletedAt: - type: string - id: - description: 分类Id - type: integer - img: - description: 图片 - type: string - name: - description: 名称 - type: string - params: - type: string - remark: - description: 备注 - type: string - sort: - description: 排序 - type: string - status: - description: 状态 - type: string - updateBy: - description: 更新者 - type: string - updatedAt: - type: string - type: object - models.SysConfig: - properties: - configId: - description: 编码 - type: integer - configKey: - description: 参数键名 - type: string - configName: - description: 参数名称 - type: string - configType: - description: 是否系统内置 - type: string - configValue: - description: 参数键值 - type: string - createBy: - type: string - createdAt: - type: string - dataScope: - type: string - deletedAt: - type: string - params: - type: string - remark: - description: 备注 - type: string - updateBy: - type: string - updatedAt: - type: string - type: object models.SysContent: properties: cateId: @@ -392,119 +245,6 @@ definitions: updatedAt: type: string type: object - models.SysFileDir: - properties: - children: - items: - $ref: '#/definitions/models.SysFileDir' - type: array - createBy: - description: 创建人 - type: string - createdAt: - type: string - dataScope: - type: string - deletedAt: - type: string - id: - type: integer - label: - description: 名称 - type: string - pId: - description: 父id - type: integer - params: - type: string - path: - type: string - sort: - description: 排序 - type: integer - updateBy: - description: 编辑人 - type: string - updatedAt: - type: string - type: object - models.SysOperLog: - properties: - businessType: - description: 操作类型 - type: string - businessTypes: - type: string - createBy: - description: 创建人 - type: string - createdAt: - type: string - dataScope: - description: 数据 - type: string - deletedAt: - type: string - deptName: - description: 部门名称 - type: string - jsonResult: - description: 返回数据 - type: string - latencyime: - description: 耗时 - type: string - method: - description: 函数 - type: string - operId: - description: 日志编码 - type: integer - operIp: - description: 客户端ip - type: string - operLocation: - description: 访问位置 - type: string - operName: - description: 操作者 - type: string - operParam: - description: 请求参数 - type: string - operTime: - description: 操作时间 - type: string - operUrl: - description: 访问地址 - type: string - operatorType: - description: 操作类型 - type: string - params: - description: 参数 - type: string - remark: - description: 备注 - type: string - requestMethod: - description: 请求方式 - type: string - status: - description: 操作状态 - type: string - title: - description: 操作模块 - type: string - updateBy: - description: 更新者 - type: string - updatedAt: - type: string - userAgent: - description: ua - type: string - type: object models.SysRole: properties: admin: @@ -729,6 +469,12 @@ definitions: functionName: description: 功能名称 type: string + isActions: + type: integer + isAuth: + type: integer + isDataScope: + type: integer isLogicalDelete: type: string logicalDelete: @@ -745,7 +491,6 @@ definitions: type: string params: $ref: '#/definitions/tools.Params' - type: object pkColumn: type: string pkGoField: @@ -785,121 +530,10 @@ info: 添加qq群: 74520518 进入技术交流群 请备注,谢谢! license: name: MIT - url: https://github.com/wenjianzhang/go-admin/blob/master/LICENSE.md + url: https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md title: go-admin API version: 1.0.1 paths: - /api/v1/config: - put: - consumes: - - application/json - description: 获取JSON - parameters: - - description: body - in: body - name: data - required: true - schema: - $ref: '#/definitions/models.SysConfig' - type: object - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 修改配置 - tags: - - 配置 - /api/v1/config/{configId}: - delete: - description: 删除数据 - parameters: - - description: configId - in: path - name: configId - required: true - type: integer - responses: - "200": - description: '{"code": -1, "message": "删除失败"}' - schema: - type: string - summary: 删除配置 - tags: - - 配置 - get: - description: 获取JSON - parameters: - - description: 配置编码 - in: path - name: configId - required: true - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/app.Response' - security: - - Bearer: [] - summary: 获取配置 - tags: - - 配置 - /api/v1/configKey/{configKey}: - get: - description: 获取JSON - parameters: - - description: configKey - in: path - name: configKey - required: true - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/app.Response' - security: - - Bearer: [] - summary: 获取配置 - tags: - - 配置 - /api/v1/configList: - get: - description: 获取JSON - parameters: - - description: configKey - in: query - name: configKey - type: string - - description: configName - in: query - name: configName - type: string - - description: configType - in: query - name: configType - type: string - - description: 页条数 - in: query - name: pageSize - type: integer - - description: 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/app.Response' - security: - - Bearer: [] - summary: 配置列表数据 - tags: - - 配置 /api/v1/db/columns/page: get: description: 数据库表列分页列表 / database table column page list @@ -960,7 +594,6 @@ paths: required: true schema: $ref: '#/definitions/models.SysDept' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -987,7 +620,6 @@ paths: required: true schema: $ref: '#/definitions/models.SysDept' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1075,7 +707,6 @@ paths: required: true schema: $ref: '#/definitions/models.DictType' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1097,7 +728,6 @@ paths: required: true schema: $ref: '#/definitions/models.DictType' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1208,7 +838,6 @@ paths: required: true schema: $ref: '#/definitions/models.DictType' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1230,7 +859,6 @@ paths: required: true schema: $ref: '#/definitions/models.DictType' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1304,126 +932,12 @@ paths: "200": description: '{"code": 200, "data": [...]}' schema: - $ref: '#/definitions/app.PageResponse' + $ref: '#/definitions/app.Response' security: - Bearer: [] summary: 字典类型列表数据 tags: - 字典类型 - /api/v1/loginlog: - post: - consumes: - - application/json - description: 获取JSON - parameters: - - description: data - in: body - name: data - required: true - schema: - $ref: '#/definitions/models.LoginLog' - type: object - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 添加登录日志 - tags: - - 登录日志 - put: - consumes: - - application/json - description: 获取JSON - parameters: - - description: body - in: body - name: data - required: true - schema: - $ref: '#/definitions/models.LoginLog' - type: object - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 修改登录日志 - tags: - - 登录日志 - /api/v1/loginlog/{infoId}: - delete: - description: 删除数据 - parameters: - - description: 以逗号(,)分割的infoId - in: path - name: infoId - required: true - type: string - responses: - "200": - description: '{"code": -1, "message": "删除失败"}' - schema: - type: string - summary: 批量删除登录日志 - tags: - - 登录日志 - get: - description: 获取JSON - parameters: - - description: infoId - in: path - name: infoId - required: true - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/app.Response' - security: - - Bearer: [] - summary: 通过编码获取登录日志 - tags: - - 登录日志 - /api/v1/loginloglist: - get: - description: 获取JSON - parameters: - - description: status - in: query - name: status - type: string - - description: dictCode - in: query - name: dictCode - type: string - - description: dictType - in: query - name: dictType - type: string - - description: 页条数 - in: query - name: pageSize - type: integer - - description: 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/app.Response' - security: - - Bearer: [] - summary: 登录日志列表 - tags: - - 登录日志 /api/v1/menu: get: description: 获取JSON @@ -1519,7 +1033,6 @@ paths: required: true schema: $ref: '#/definitions/models.Menu' - type: object responses: "200": description: '{"code": -1, "message": "修改失败"}' @@ -1601,99 +1114,6 @@ paths: summary: 根据角色名称获取菜单列表数据(左菜单使用) tags: - 菜单 - /api/v1/operlog: - post: - consumes: - - application/json - description: 获取JSON - parameters: - - description: data - in: body - name: data - required: true - schema: - $ref: '#/definitions/models.SysOperLog' - type: object - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 添加操作日志 - tags: - - 操作日志 - /api/v1/operlog/{infoId}: - get: - description: 获取JSON - parameters: - - description: infoId - in: path - name: infoId - required: true - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/app.Response' - security: - - Bearer: [] - summary: 通过编码获取登录日志 - tags: - - 登录日志 - /api/v1/operlog/{operId}: - delete: - description: 删除数据 - parameters: - - description: 以逗号(,)分割的operId - in: path - name: operId - required: true - type: string - responses: - "200": - description: '{"code": -1, "message": "删除失败"}' - schema: - type: string - summary: 批量删除操作日志 - tags: - - 操作日志 - /api/v1/operloglist: - get: - description: 获取JSON - parameters: - - description: status - in: query - name: status - type: string - - description: dictCode - in: query - name: dictCode - type: string - - description: dictType - in: query - name: dictType - type: string - - description: 页条数 - in: query - name: pageSize - type: integer - - description: 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/app.Response' - security: - - Bearer: [] - summary: 登录日志列表 - tags: - - 登录日志 /api/v1/post: get: description: 获取JSON @@ -1735,7 +1155,6 @@ paths: required: true schema: $ref: '#/definitions/models.Post' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1758,7 +1177,6 @@ paths: required: true schema: $ref: '#/definitions/models.Post' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1861,7 +1279,6 @@ paths: required: true schema: $ref: '#/definitions/models.SysRole' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1881,7 +1298,6 @@ paths: required: true schema: $ref: '#/definitions/models.SysRole' - type: object responses: "200": description: '{"code": -1, "message": "修改失败"}' @@ -2033,7 +1449,6 @@ paths: required: true schema: $ref: '#/definitions/tools.SysTables' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -2127,7 +1542,6 @@ paths: required: true schema: $ref: '#/definitions/models.SysUser' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -2173,27 +1587,6 @@ paths: summary: 列表用户信息数据 tags: - 用户 - /api/v1/syscategory: - post: - consumes: - - application/json - description: 获取JSON - parameters: - - description: data - in: body - name: data - required: true - schema: - $ref: '#/definitions/models.SysCategory' - type: object - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - summary: 添加分类 - tags: - - 分类 /api/v1/syscontent: post: consumes: @@ -2206,7 +1599,6 @@ paths: required: true schema: $ref: '#/definitions/models.SysContent' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -2215,27 +1607,6 @@ paths: summary: 添加内容管理 tags: - 内容管理 - /api/v1/sysfiledir: - post: - consumes: - - application/json - description: 获取JSON - parameters: - - description: data - in: body - name: data - required: true - schema: - $ref: '#/definitions/models.SysFileDir' - type: object - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - summary: 添加SysFileDir - tags: - - SysFileDir /api/v1/system/setting: post: description: 获取JSON @@ -2246,7 +1617,6 @@ paths: required: true schema: $ref: '#/definitions/models.SysUser' - type: object responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -2283,7 +1653,6 @@ paths: required: true schema: $ref: '#/definitions/models.SysUser' - type: object responses: "200": description: '{"code": -1, "message": "修改失败"}' @@ -2342,7 +1711,6 @@ paths: required: true schema: $ref: '#/definitions/models.Login' - type: object responses: "200": description: '{"code": 200, "expire": "2019-08-07T12:45:48+08:00", "token": @@ -2364,79 +1732,6 @@ paths: security: - Bearer: [] summary: 退出登录 - /sd/cpu: - get: - consumes: - - text/html - description: CPU 使用量 DiskCheck checks the disk usage. - produces: - - text/html - responses: - "200": - description: OK - schema: - type: string - summary: CPU 使用量 - /sd/disk: - get: - consumes: - - text/html - description: 服务器硬盘使用量 DiskCheck checks the disk usage. - produces: - - text/html - responses: - "200": - description: 'OK - Free space: 16321MB (15GB) / 51200MB (50GB) | Used: 31%' - schema: - type: string - "429": - description: WARNING - schema: - type: string - "500": - description: CRITICAL - schema: - type: string - summary: 服务器硬盘使用量 - /sd/health: - get: - consumes: - - text/html - description: 健康状况 - produces: - - text/html - responses: - "200": - description: OK - schema: - type: string - summary: 健康状况 HealthCheck shows OK as the ping-pong result. - /sd/os: - get: - consumes: - - text/html - description: Os - produces: - - text/html - responses: - "200": - description: OK - schema: - type: string - summary: OS - /sd/ram: - get: - consumes: - - text/html - description: 内存使用量 RAMCheck checks the disk usage. - produces: - - text/html - responses: - "200": - description: OK - schema: - type: string - summary: 内存使用量 securityDefinitions: Bearer: in: header