From 2decf43b4ced0f1e6b5ecf1c92c2ffa157592c57 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 10 Aug 2021 03:35:36 +0800 Subject: [PATCH 001/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=90=8E=E7=9A=84=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/no_actions/router_check_role.go.template | 2 +- template/v4/no_actions/router_no_check_role.go.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/template/v4/no_actions/router_check_role.go.template b/template/v4/no_actions/router_check_role.go.template index 0ba642723..249c61c4c 100644 --- a/template/v4/no_actions/router_check_role.go.template +++ b/template/v4/no_actions/router_check_role.go.template @@ -15,7 +15,7 @@ func init() { // register{{.ClassName}}Router func register{{.ClassName}}Router(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { api := apis.{{.ClassName}}{} - r := v1.Group("/{{.MLTBName}}").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) + r := v1.Group("/{{.ModuleName}}").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) { r.GET("", api.GetPage) r.GET("/:id", api.Get) diff --git a/template/v4/no_actions/router_no_check_role.go.template b/template/v4/no_actions/router_no_check_role.go.template index 429e274cd..fc26fe609 100644 --- a/template/v4/no_actions/router_no_check_role.go.template +++ b/template/v4/no_actions/router_no_check_role.go.template @@ -14,7 +14,7 @@ func init() { // register{{.ClassName}}Router func register{{.ClassName}}Router(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { api := apis.{{.ClassName}}{} - r := v1.Group("/{{.MLTBName}}").Use(authMiddleware.MiddlewareFunc()) + r := v1.Group("/{{.ModuleName}}").Use(authMiddleware.MiddlewareFunc()) { r.GET("", api.GetPage) r.GET("/:id", api.Get) From b5a57e6dd9b20c4273096109fecd3634e078304d Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 10 Aug 2021 03:36:20 +0800 Subject: [PATCH 002/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=94=9F=E6=88=90=E5=8A=9F=E8=83=BD=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=92=8C=E5=88=A0=E9=99=A4=E8=AF=A2=E9=97=AE=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/vue.go.template | 40 +++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/template/v4/vue.go.template b/template/v4/vue.go.template index 201c3b5d3..b6eaaf41c 100644 --- a/template/v4/vue.go.template +++ b/template/v4/vue.go.template @@ -118,22 +118,36 @@ {{- end }} From 5d3b1c3d0f21296f2918597c73b67d312b3e3252 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 10 Aug 2021 03:37:02 +0800 Subject: [PATCH 003/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=E6=9B=B4=E6=96=B02?= =?UTF-8?q?.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index e06b63e06..d9bd32498 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.0.3" + Version = "2.0.4" ) var ( From 3e20e93797097a42adb3a4f211c461ead6e79a55 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 10 Aug 2021 03:47:31 +0800 Subject: [PATCH 004/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=BC=96=E8=BE=91=E6=9C=AA=E8=B5=8B=E6=9D=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/db.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/config/db.sql b/config/db.sql index a4a5421b1..25e2349f6 100644 --- a/config/db.sql +++ b/config/db.sql @@ -303,6 +303,7 @@ INSERT INTO `sys_menu_api_rule` VALUES (228, 27); INSERT INTO `sys_menu_api_rule` VALUES (230, 28); INSERT INTO `sys_menu_api_rule` VALUES (226, 29); INSERT INTO `sys_menu_api_rule` VALUES (51, 39); +INSERT INTO `sys_menu_api_rule` VALUES (51, 135); INSERT INTO `sys_menu_api_rule` VALUES (222, 39); INSERT INTO `sys_menu_api_rule` VALUES (221, 41); INSERT INTO `sys_menu_api_rule` VALUES (52, 44); From 5a65fcd477541e899637d2b6aebba930807534a8 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 10 Aug 2021 14:58:04 +0800 Subject: [PATCH 005/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_menu.go | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index 9d3ed7ca9..e2d8a35e8 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -331,24 +331,39 @@ func (e *SysMenu) getByRoleName(roleName string) ([]models.SysMenu, error) { MenuList = data } else { role.RoleKey = roleName + buttons := make([]models.SysMenu,0) err = e.Orm.Debug().Model(&role).Where("role_key = ? ", roleName).Preload("SysMenu", func(db *gorm.DB) *gorm.DB { - return db.Where(" menu_type in ('C')").Order("sort") + return db.Where(" menu_type in ('F')").Order("sort") }).Find(&role).Error if role.SysMenu != nil { - MenuList = *role.SysMenu + buttons = *role.SysMenu } mIds := make([]int, 0) - for _, menu := range MenuList { + for _, menu := range buttons { if menu.ParentId != 0 { mIds = append(mIds, menu.ParentId) } } - var data []models.SysMenu - err = e.Orm.Where(" menu_type in ('M') and menu_id in ?", mIds).Order("sort").Find(&data).Error + var dataC []models.SysMenu + err = e.Orm.Where(" menu_type in ('C') and menu_id in ?", mIds).Order("sort").Find(&dataC).Error + if err != nil { + return nil, err + } + for _, datum := range dataC { + MenuList = append(MenuList, datum) + } + cIds := make([]int, 0) + for _, menu := range MenuList { + if menu.ParentId != 0 { + cIds = append(cIds, menu.ParentId) + } + } + var dataM []models.SysMenu + err = e.Orm.Where(" menu_type in ('M') and menu_id in ?", cIds).Order("sort").Find(&dataM).Error if err != nil { return nil, err } - for _, datum := range data { + for _, datum := range dataM { MenuList = append(MenuList, datum) } } From 76567eea8431611f01218bf496f644bb05d0eb7e Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 10 Aug 2021 14:58:55 +0800 Subject: [PATCH 006/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=E6=9B=B4=E6=96=B02?= =?UTF-8?q?.0.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index d9bd32498..3b81b6b5c 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.0.4" + Version = "2.0.5" ) var ( From 7dd62a4cf8f55d1746cf491fef33f3ecb4949b15 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 13 Aug 2021 20:53:37 +0800 Subject: [PATCH 007/238] chore: upgrade gin to v1.7.3 Signed-off-by: Bo-Yi Wu --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 37d676c23..5d606d44e 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/bitly/go-simplejson v0.5.0 github.com/bytedance/go-tagexpr/v2 v2.7.12 github.com/casbin/casbin/v2 v2.25.1 - github.com/gin-gonic/gin v1.7.2 + github.com/gin-gonic/gin v1.7.3 github.com/go-admin-team/go-admin-core v1.3.7 github.com/go-admin-team/go-admin-core/sdk v1.3.7 github.com/google/uuid v1.2.0 From 9db940150aab844b33b8c0cfef2430ba5687b211 Mon Sep 17 00:00:00 2001 From: ninstein Date: Wed, 18 Aug 2021 14:45:22 +0800 Subject: [PATCH 008/238] =?UTF-8?q?BUGFIX:=E8=A7=92=E8=89=B2=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 切换角色状态时参数传递丢失,导致切换异常新增了一条空记录 --- app/admin/apis/sys_role.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/apis/sys_role.go b/app/admin/apis/sys_role.go index 7e28a671d..f83e3657a 100644 --- a/app/admin/apis/sys_role.go +++ b/app/admin/apis/sys_role.go @@ -227,7 +227,7 @@ func (e SysRole) Update2Status(c *gin.Context) { req := dto.UpdateStatusReq{} err := e.MakeContext(c). MakeOrm(). - Bind(&req). + Bind(&req, binding.JSON, nil). MakeService(&s.Service). Errors if err != nil { @@ -279,4 +279,4 @@ func (e SysRole) Update2DataScope(c *gin.Context) { return } e.OK(nil, "操作成功") -} \ No newline at end of file +} From 2441412714c8c41fa7d508f0370f857616233af0 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 19 Aug 2021 19:03:19 +0800 Subject: [PATCH 009/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=AA=8C=E8=AF=81=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/dto/sys_user.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/admin/service/dto/sys_user.go b/app/admin/service/dto/sys_user.go index 511234300..469844dc5 100644 --- a/app/admin/service/dto/sys_user.go +++ b/app/admin/service/dto/sys_user.go @@ -38,8 +38,8 @@ func (m *SysUserGetPageReq) GetNeedSearch() interface{} { } type ResetSysUserPwdReq struct { - UserId int `json:"userId" comment:"用户ID" binding:"required"` // 用户ID - Password string `json:"password" comment:"密码" binding:"required"` + UserId int `json:"userId" comment:"用户ID" vd:"$>0"` // 用户ID + Password string `json:"password" comment:"密码" vd:"len($)>0"` common.ControlBy } @@ -185,4 +185,4 @@ func (s *SysUserById) GenerateM() (common.ActiveRecord, error) { type PassWord struct { NewPassword string `json:"newPassword" vd:"len($)>0"` OldPassword string `json:"oldPassword" vd:"len($)>0"` -} +} \ No newline at end of file From 386c620b48c2796c359881f9617a129c87106e30 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 19 Aug 2021 19:04:03 +0800 Subject: [PATCH 010/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=A7=92=E8=89=B2=E4=BF=AE=E6=94=B9=E6=97=B6=E5=BE=AA?= =?UTF-8?q?=E7=8E=AFAddNamedPolicy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_role.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index 7f9d71b5a..ab374822d 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -142,12 +142,21 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err e.Log.Errorf("delete policy error:%s", err) return err } - + mp:=make(map [string] interface{} ,0) + polices := make([][]string, 0) for _, menu := range mlist { for _, api := range menu.SysApi { - _, err = cb.AddNamedPolicy("p", model.RoleKey, api.Path, api.Action) + if mp[model.RoleKey+"-"+api.Path+"-"+api.Action] != "" { + mp[model.RoleKey+"-"+api.Path+"-"+api.Action] = "" + //_, err = cb.AddNamedPolicy("p", model.RoleKey, api.Path, api.Action) + polices = append(polices, []string{model.RoleKey, api.Path, api.Action}) + } } } + _, err = cb.AddNamedPolicies("p", polices) + if err != nil { + return err + } _ = cb.SavePolicy() return nil } From 4740a39808f0f123b302f95ac40bb89ec1425c82 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 19 Aug 2021 19:08:47 +0800 Subject: [PATCH 011/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=A7=BB=E9=99=A4=E5=8A=9F=E8=83=BD=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/db.sql | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/config/db.sql b/config/db.sql index 25e2349f6..8bae7d27c 100644 --- a/config/db.sql +++ b/config/db.sql @@ -200,7 +200,7 @@ COMMIT; BEGIN; INSERT INTO `sys_menu` VALUES (2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL); INSERT INTO `sys_menu` VALUES (3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (43, '', '新增管理员1', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO `sys_menu` VALUES (43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); INSERT INTO `sys_menu` VALUES (44, '', '查询管理员', 'app-group-fill', '', '/0/2/3/44', 'F', 'GET', 'admin:sysUser:query', 3, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); INSERT INTO `sys_menu` VALUES (45, '', '修改管理员', 'app-group-fill', '', '/0/2/3/45', 'F', 'PUT', 'admin:sysUser:edit', 3, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); INSERT INTO `sys_menu` VALUES (46, '', '删除管理员', 'app-group-fill', '', '/0/2/3/46', 'F', 'DELETE', 'admin:sysUser:remove', 3, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); @@ -259,37 +259,14 @@ INSERT INTO `sys_menu` VALUES (462, 'sys_job', '创建定时任务', 'app-group- INSERT INTO `sys_menu` VALUES (463, 'sys_job', '修改定时任务', 'app-group-fill', '', '/0/459/460/463', 'F', '无', 'job:sysJob:edit', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); INSERT INTO `sys_menu` VALUES (464, 'sys_job', '删除定时任务', 'app-group-fill', '', '/0/459/460/464', 'F', '无', 'job:sysJob:remove', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); INSERT INTO `sys_menu` VALUES (471, 'JobLog', '日志', 'bug', '/schedule/log', '/0/459/471', 'C', '', '', 459, 0, '', '/schedule/log', 0, '1', '1', 1, 1, '2020-08-05 21:24:46.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (496, 'Sources', '资源管理', 'network', '/sources', '/0/496', 'M', '无', '', 0, 1, '', 'Layout', 50, '0', '1', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (497, 'File', '文件管理', 'documentation', '/sources/file-manage', '/0/496/497', 'C', '', '', 496, 1, '', '/other/fileManage/index', 0, '0', '1', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (498, '', '内容管理', 'archived', '/cms', '/0/498', 'M', '无', '', 0, 1, '', 'Layout', 60, '0', '1', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (499, 'SysCategoryManage', '分类', 'list', '/cms/sys-category', '/0/498/499', 'C', '无', 'cms:sysCategory:list', 498, 1, '', '/sys-category/index', 0, '0', '0', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (500, '', '分页获取分类', 'app-group-fill', '', '/0/498/499/500', 'F', '无', 'cms:sysCategory:query', 499, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (501, '', '创建分类', 'app-group-fill', '', '/0/498/499/501', 'F', '无', 'cms:sysCategory:add', 499, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (502, '', '修改分类', 'app-group-fill', '', '/0/498/499/502', 'F', '无', 'cms:sysCategory:edit', 499, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (503, '', '删除分类', 'app-group-fill', '', '/0/498/499/503', 'F', '无', 'cms:sysCategory:remove', 499, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (511, 'SysContentManage', '内容管理', 'pass', '/cms/sys-content', '/0/498/511', 'C', '无', 'cms:sysContent:list', 498, 1, '', '/sys-content/index', 0, '0', '0', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (512, '', '分页获取内容管理', 'app-group-fill', '', '/0/510/511/512', 'F', '无', 'cms:sysContent:query', 511, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (513, '', '创建内容管理', 'app-group-fill', '', '/0/510/511/513', 'F', '无', 'cms:sysContent:add', 511, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (514, '', '修改内容管理', 'app-group-fill', '', '/0/510/511/514', 'F', '无', 'cms:sysContent:edit', 511, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (515, '', '删除内容管理', 'app-group-fill', '', '/0/510/511/515', 'F', '无', 'cms:sysContent:remove', 511, 1, '', '', 0, '0', '0', 1, 1, '2021-05-13 19:56:39.690', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (522, 'SysContentCreate', '新增', 'form', '/cms/sys-content/create', '/0/498/522', 'C', '', 'cms:sysContent:add', 498, 0, '', '/syscontent/create.vue', 0, '1', '1', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (523, 'SysContentEdit', '编辑', 'edit', '/cms/sys-content/edit:id', '/0/498/523', 'C', '', 'cmd:sysContent:edit', 498, 0, '', '/sys-content/edit.vue', 0, '1', '1', 0, 1, '2021-06-05 16:06:16.525', '2021-06-05 22:15:03.465', NULL); INSERT INTO `sys_menu` VALUES (528, 'SysApiManage', '接口管理', 'api-doc', '/admin/sys-api', '/0/527/528', 'C', '无', 'admin:sysApi:list', 2, 0, '', '/admin/sys-api/index', 0, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); INSERT INTO `sys_menu` VALUES (529, '', '查询接口', 'app-group-fill', '', '/0/527/528/529', 'F', '无', 'admin:sysApi:query', 528, 0, '', '', 40, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); INSERT INTO `sys_menu` VALUES (531, '', '修改接口', 'app-group-fill', '', '/0/527/528/531', 'F', '无', 'admin:sysApi:edit', 528, 0, '', '', 30, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); INSERT INTO `sys_menu` VALUES (537, 'SysTools', '系统工具', 'system-tools', '/sys-tools', '', 'M', '', '', 0, 0, '', 'Layout', 30, '0', '1', 1, 1, '2021-05-21 11:13:32.166', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (538, 'SysChinaAreaData', '行政区管理', 'nested', '/sys-tools/sys-china-area-data', '', 'C', '', 'sysTools:sysChinaAreaData:list', 537, 0, '', '/sys-tools/sys-china-area-data/index', 0, '0', '1', 1, 1, '2021-05-21 11:18:50.712', '2021-06-16 21:26:12.446', NULL); INSERT INTO `sys_menu` VALUES (540, 'SysConfigSet', '参数设置', 'system-tools', '/admin/sys-config/set', '', 'C', '', 'admin:sysConfigSet:list', 2, 0, '', '/admin/sys-config/set', 0, '0', '1', 1, 1, '2021-05-25 16:06:52.560', '2021-06-17 11:48:40.703', NULL); INSERT INTO `sys_menu` VALUES (542, '', '修改', 'upload', '', '', 'F', '', 'admin:sysConfigSet:update', 540, 0, '', '', 0, '0', '1', 1, 1, '2021-06-13 11:45:48.670', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (544, '1', '1', '404', '1', '', 'C', '', '1', 0, 0, '', '1', 0, '0', '1', 1, 1, '2021-06-16 21:42:52.603', '2021-06-16 21:43:05.400', '2021-06-16 21:43:14.403'); -INSERT INTO `sys_menu` VALUES (545, '1', '1', 'chart', '1', '', 'C', '', '1', 0, 0, '', '1', 0, '0', '1', 1, 0, '2021-06-16 21:43:39.774', '2021-06-16 21:43:39.774', '2021-06-16 21:48:54.255'); -INSERT INTO `sys_menu` VALUES (546, '1', '1', '404', '1', '', 'C', '', '1', 0, 0, '', '1', 0, '0', '1', 1, 1, '2021-06-16 21:49:13.861', '2021-06-16 21:49:48.583', '2021-06-16 21:49:52.490'); -INSERT INTO `sys_menu_api_rule` VALUES (544, 5); -INSERT INTO `sys_menu_api_rule` VALUES (546, 5); INSERT INTO `sys_menu_api_rule` VALUES (216, 6); INSERT INTO `sys_menu_api_rule` VALUES (250, 6); -INSERT INTO `sys_menu_api_rule` VALUES (546, 6); -INSERT INTO `sys_menu_api_rule` VALUES (546, 7); INSERT INTO `sys_menu_api_rule` VALUES (58, 21); INSERT INTO `sys_menu_api_rule` VALUES (236, 21); INSERT INTO `sys_menu_api_rule` VALUES (238, 23); @@ -364,4 +341,4 @@ COMMIT; SET FOREIGN_KEY_CHECKS = 1; --- 数据完成 ; +-- 数据完成 ; \ No newline at end of file From bdaa6e0db0272d14db69dfec2ec38dc08c6ae21d Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 19 Aug 2021 19:10:32 +0800 Subject: [PATCH 012/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=8C=85go-admin-core=20v1.3.7=E5=92=8Cgo-admin-core/?= =?UTF-8?q?sdk=20v1.3.7=E8=87=B3v1.3.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5d606d44e..733e69761 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/bytedance/go-tagexpr/v2 v2.7.12 github.com/casbin/casbin/v2 v2.25.1 github.com/gin-gonic/gin v1.7.3 - github.com/go-admin-team/go-admin-core v1.3.7 - github.com/go-admin-team/go-admin-core/sdk v1.3.7 + github.com/go-admin-team/go-admin-core v1.3.8 + github.com/go-admin-team/go-admin-core/sdk v1.3.8 github.com/google/uuid v1.2.0 github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 @@ -35,4 +35,4 @@ require ( //replace ( // github.com/go-admin-team/go-admin-core => ../go-admin-core // github.com/go-admin-team/go-admin-core/sdk => ../go-admin-core/sdk -//) +//) \ No newline at end of file From 8a1573cc147ac4601c12e2e4c5f594b217ffc624 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 19 Aug 2021 19:27:55 +0800 Subject: [PATCH 013/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=E6=9B=B4=E6=96=B02?= =?UTF-8?q?.0.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/global/adm.go b/common/global/adm.go index 3b81b6b5c..651c63cc9 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,11 +2,11 @@ package global const ( // Version go-admin version info - Version = "2.0.5" + Version = "2.0.6" ) var ( Source string Driver string DBName string -) +) \ No newline at end of file From 8baae5e71209b70d3249c466c146c4b68b8ef393 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Fri, 20 Aug 2021 18:27:29 +0800 Subject: [PATCH 014/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8Djw?= =?UTF-8?q?t=E5=AF=86=E9=92=A5=E5=BC=95=E7=94=A8=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=88#545=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/middleware/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/middleware/auth.go b/common/middleware/auth.go index 95e035a1f..6562cff83 100644 --- a/common/middleware/auth.go +++ b/common/middleware/auth.go @@ -20,7 +20,7 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) { } return jwt.New(&jwt.GinJWTMiddleware{ Realm: "test zone", - Key: []byte(config.ApplicationConfig.JwtSecret), + Key: []byte(config.JwtConfig.Secret), Timeout: timeout, MaxRefresh: time.Hour, PayloadFunc: handler.PayloadFunc, @@ -33,4 +33,4 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) { TimeFunc: time.Now, }) -} +} \ No newline at end of file From bb83a976131ff75a8719c2cd4e07ca074e25b82b Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Fri, 20 Aug 2021 18:28:04 +0800 Subject: [PATCH 015/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9post=E6=8E=A5=E5=8F=A3=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/sys_post.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/admin/apis/sys_post.go b/app/admin/apis/sys_post.go index 33911fb8f..a12d54a28 100644 --- a/app/admin/apis/sys_post.go +++ b/app/admin/apis/sys_post.go @@ -2,6 +2,7 @@ package apis import ( "fmt" + "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/go-admin-team/go-admin-core/sdk/api" @@ -93,8 +94,7 @@ func (e SysPost) Get(c *gin.Context) { // @Accept application/json // @Product application/json // @Param data body dto.SysPostInsertReq true "data" -// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" -// @Success 200 {string} string "{"code": -1, "message": "添加失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post [post] // @Security Bearer func (e SysPost) Insert(c *gin.Context) { @@ -126,8 +126,7 @@ func (e SysPost) Insert(c *gin.Context) { // @Accept application/json // @Product application/json // @Param data body dto.SysPostUpdateReq true "body" -// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" -// @Success 200 {string} string "{"code": -1, "message": "添加失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post/{id} [put] // @Security Bearer func (e SysPost) Update(c *gin.Context) { @@ -159,8 +158,7 @@ func (e SysPost) Update(c *gin.Context) { // @Description 删除数据 // @Tags 岗位 // @Param id body dto.SysPostDeleteReq true "请求参数" -// @Success 200 {string} string "{"code": 200, "message": "删除成功"}" -// @Success 500 {string} string "{"code": 500, "message": "删除失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post [delete] // @Security Bearer func (e SysPost) Delete(c *gin.Context) { @@ -183,4 +181,4 @@ func (e SysPost) Delete(c *gin.Context) { return } e.OK(req.GetId(), "删除成功") -} +} \ No newline at end of file From 30eb2806989bb7eb4cac8530d0f5dc8253266691 Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Thu, 2 Sep 2021 20:21:18 +0800 Subject: [PATCH 016/238] =?UTF-8?q?fix=20:bug:=20gcc=E5=BC=BA=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 733e69761..32f540c77 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/casbin/casbin/v2 v2.25.1 github.com/gin-gonic/gin v1.7.3 github.com/go-admin-team/go-admin-core v1.3.8 - github.com/go-admin-team/go-admin-core/sdk v1.3.8 + github.com/go-admin-team/go-admin-core/sdk v1.3.9 github.com/google/uuid v1.2.0 github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 @@ -31,8 +31,3 @@ require ( gorm.io/driver/sqlite v1.1.5-0.20201206014648-c84401fbe3ba gorm.io/gorm v1.21.11 ) - -//replace ( -// github.com/go-admin-team/go-admin-core => ../go-admin-core -// github.com/go-admin-team/go-admin-core/sdk => ../go-admin-core/sdk -//) \ No newline at end of file From 16701d38a6a9e85e5c3e13cf30207c0130043b39 Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Thu, 2 Sep 2021 20:31:00 +0800 Subject: [PATCH 017/238] =?UTF-8?q?feat=20:sparkles:=20=E5=A2=9E=E5=8A=A0r?= =?UTF-8?q?elease=20pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 644578159..462875ccc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -32,3 +32,6 @@ jobs: - name: Build run: go build -v . + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') From 082c369d415b29b273aeb098de930fec62f33824 Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Mon, 6 Sep 2021 21:51:07 +0800 Subject: [PATCH 018/238] =?UTF-8?q?feat=20:sparkles:=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=88=B0gitee?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/mirror.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/mirror.yaml diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml new file mode 100644 index 000000000..902a19c8e --- /dev/null +++ b/.github/workflows/mirror.yaml @@ -0,0 +1,17 @@ +name: 'GitHub Actions Mirror' + +on: [push, delete] + +jobs: + mirror_to_gitee: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v1 + - name: 'Mirror to gitee' + uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git@gitee.com:go-admin-team/go-admin.git + ssh_private_key: + ${{ secrets.GITEE_KEY }} From 7ca776bfabfb9ac9199f41e69f758408da0d7914 Mon Sep 17 00:00:00 2001 From: lwnmengjing <991154416@qq.com> Date: Tue, 7 Sep 2021 11:20:55 +0800 Subject: [PATCH 019/238] =?UTF-8?q?:green=5Fheart:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B5=81=E6=B0=B4=E7=BA=BFCI=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go.yml | 18 +++++++++++++----- Dockerfile | 30 +++++++++++++++++++++--------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 462875ccc..797c12e9c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -29,9 +29,17 @@ jobs: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh dep ensure fi - - name: Build - run: go build -v . - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') + run: | + ref=${{ github.ref }} + go mod vendor + docker build . -t goadminteam/go-admin:${ref##*/}-${{ github.sha }} + docker tag goadminteam/go-admin:${ref##*/}-${{ github.sha }} goadminteam/go-admin:latest + - uses: Azure/docker-login@v1 + with: + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - run: | + ref=${{ github.ref }} + docker push goadminteam/go-admin:${ref##*/}-${{ github.sha }} + docker push goadminteam/go-admin:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9e24efb35..430e91ef7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,26 @@ -FROM alpine +FROM golang:alpine as builder + +MAINTAINER lwnmengjing ENV GOPROXY https://goproxy.cn/ -RUN apk update --no-cache -RUN apk add --no-cache ca-certificates -RUN apk add --no-cache tzdata -ENV TZ Asia/Shanghai +WORKDIR /go/release +#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories +RUN apk update && apk add tzdata + +COPY go.mod ./go.mod +RUN go mod tidy +COPY . . +RUN pwd && ls + +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin . + +FROM alpine + +COPY --from=builder /go/release/go-admin / + +COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime -COPY ./main /main -COPY ./config/settings.prod.yml /config/settings.yml EXPOSE 8000 -RUN chmod +x /main -CMD ["/main","server","-c", "/config/settings.yml"] \ No newline at end of file + +CMD ["/go-admin","server","-c", "/config/settings.yml"] \ No newline at end of file From 57330784ac67c7d5df3edb0e1e147c40fd379114 Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Tue, 7 Sep 2021 21:45:25 +0800 Subject: [PATCH 020/238] feat :sparkles: mirror to gitlab --- .github/workflows/mirror.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml index 902a19c8e..9249c8e78 100644 --- a/.github/workflows/mirror.yaml +++ b/.github/workflows/mirror.yaml @@ -15,3 +15,15 @@ jobs: git@gitee.com:go-admin-team/go-admin.git ssh_private_key: ${{ secrets.GITEE_KEY }} + mirror_to_gitlab: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v1 + - name: 'Mirror to gitlab' + uses: pixta-dev/repository-mirroring-action@v1 + with: + target_repo_url: + git@gitlab.com:go-admin-team/go-admin.git + ssh_private_key: + ${{ secrets.GITLAB_KEY }} From ce9d9bd3eca4e6157587b5a874fa469ae06ffd45 Mon Sep 17 00:00:00 2001 From: wkf928592 Date: Fri, 10 Sep 2021 10:19:33 +0800 Subject: [PATCH 021/238] =?UTF-8?q?fix:=E5=9C=A832=E4=BD=8D=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=B8=AD=E5=81=9A=E8=BF=81=E7=A7=BB=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E4=BD=9C=E4=B8=BA=E6=95=B4=E5=9E=8B?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BC=9A=E9=80=A0=E6=88=90=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改版本号作为字符串处理 --- cmd/migrate/migration/init.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/cmd/migrate/migration/init.go b/cmd/migrate/migration/init.go index 54261d1eb..aed6c275f 100644 --- a/cmd/migrate/migration/init.go +++ b/cmd/migrate/migration/init.go @@ -4,20 +4,18 @@ import ( "log" "path/filepath" "sort" - "strconv" "sync" - "github.com/spf13/cast" "gorm.io/gorm" ) var Migrate = &Migration{ - version: make(map[int]func(db *gorm.DB, version string) error), + version: make(map[string]func(db *gorm.DB, version string) error), } type Migration struct { db *gorm.DB - version map[int]func(db *gorm.DB, version string) error + version map[string]func(db *gorm.DB, version string) error mutex sync.Mutex } @@ -29,19 +27,19 @@ func (e *Migration) SetDb(db *gorm.DB) { e.db = db } -func (e *Migration) SetVersion(k int, f func(db *gorm.DB, version string) error) { +func (e *Migration) SetVersion(k string, f func(db *gorm.DB, version string) error) { e.mutex.Lock() defer e.mutex.Unlock() e.version[k] = f } func (e *Migration) Migrate() { - versions := make([]int, 0) + versions := make([]string, 0) for k := range e.version { versions = append(versions, k) } - if !sort.IntsAreSorted(versions) { - sort.Ints(versions) + if !sort.StringsAreSorted(versions) { + sort.Strings(versions) } var err error var count int64 @@ -55,14 +53,14 @@ func (e *Migration) Migrate() { count = 0 continue } - err = (e.version[v])(e.db.Debug(), strconv.Itoa(v)) + err = (e.version[v])(e.db.Debug(), v) if err != nil { log.Fatalln(err) } } } -func GetFilename(s string) int { +func GetFilename(s string) string { s = filepath.Base(s) - return cast.ToInt(s[:13]) + return s[:13] } From 64cbf311848169d154d1dfa29157df30f0c1844f Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Fri, 22 Oct 2021 12:04:48 +0800 Subject: [PATCH 022/238] Update db.sql --- config/db.sql | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/config/db.sql b/config/db.sql index 8bae7d27c..d1c97d14c 100644 --- a/config/db.sql +++ b/config/db.sql @@ -2,7 +2,6 @@ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -BEGIN; INSERT INTO `sys_api` VALUES (5, 'go-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', NULL, 0, 0); INSERT INTO `sys_api` VALUES (6, 'go-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', NULL, 0, 0); INSERT INTO `sys_api` VALUES (7, 'go-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', NULL, 0, 0); @@ -124,25 +123,19 @@ INSERT INTO `sys_api` VALUES (156, 'go-admin/app/admin/apis.SysUser.Delete-fm', INSERT INTO `sys_api` VALUES (157, 'go-admin/app/admin/apis/tools.(*SysTable).DeleteSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'DELETE', '2021-06-13 19:25:02.283', '2021-06-13 20:53:52.367', NULL, 0, 0); INSERT INTO `sys_api` VALUES (158, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'HEAD', '2021-06-13 19:25:02.734', '2021-06-13 20:53:52.791', NULL, 0, 0); INSERT INTO `sys_api` VALUES (159, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'HEAD', '2021-06-13 19:25:02.808', '2021-06-13 20:53:52.838', NULL, 0, 0); -COMMIT; -BEGIN; INSERT INTO `sys_config` VALUES (1, '皮肤样式', 'sys_index_skinName', 'skin-green', 'Y', '0', '主框架页-默认皮肤样式名称:蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 13:50:13.123', NULL); INSERT INTO `sys_config` VALUES (2, '初始密码', 'sys_user_initPassword', '123456', 'Y', '0', '用户管理-账号初始密码:123456', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); INSERT INTO `sys_config` VALUES (3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); INSERT INTO `sys_config` VALUES (4, '系统名称', 'sys_app_name', 'go-admin管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2021-05-28 10:08:25.248', NULL); INSERT INTO `sys_config` VALUES (5, '系统logo', 'sys_app_logo', 'https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); -COMMIT; -BEGIN; INSERT INTO `sys_dept` VALUES (1, 0, '/0/1/', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:06:44.960', NULL); INSERT INTO `sys_dept` VALUES (7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', NULL); INSERT INTO `sys_dept` VALUES (8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', NULL); INSERT INTO `sys_dept` VALUES (9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', NULL); INSERT INTO `sys_dept` VALUES (10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', '1', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', NULL); -COMMIT; -BEGIN; INSERT INTO `sys_dict_data` VALUES (1, 0, '正常', '2', 'sys_normal_disable', '', '', '', '2', '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', NULL); INSERT INTO `sys_dict_data` VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', '2', '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); INSERT INTO `sys_dict_data` VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', '2', '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); @@ -176,9 +169,7 @@ INSERT INTO `sys_dict_data` VALUES (30, 0, '退出', '11', 'sys_oper_type', '', INSERT INTO `sys_dict_data` VALUES (31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', '2', '', '获取验证码', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); INSERT INTO `sys_dict_data` VALUES (32, 0, '正常', '1', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); INSERT INTO `sys_dict_data` VALUES (33, 1, '禁用', '2', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); -COMMIT; -BEGIN; INSERT INTO `sys_dict_type` VALUES (1, '系统开关', 'sys_normal_disable', '2', '系统开关列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); INSERT INTO `sys_dict_type` VALUES (2, '用户性别', 'sys_user_sex', '2', '用户性别列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); INSERT INTO `sys_dict_type` VALUES (3, '菜单状态', 'sys_show_hide', '2', '菜单状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); @@ -190,14 +181,10 @@ INSERT INTO `sys_dict_type` VALUES (8, '系统状态', 'sys_common_status', '2', INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '2', '操作类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); INSERT INTO `sys_dict_type` VALUES (10, '通知状态', 'sys_notice_status', '2', '通知状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); INSERT INTO `sys_dict_type` VALUES (11, '内容状态', 'sys_content_status', '2', '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', NULL); -COMMIT; -BEGIN; INSERT INTO `sys_job` VALUES (1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', NULL, 1, 1); INSERT INTO `sys_job` VALUES (2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', NULL, 1, 1); -COMMIT; -BEGIN; INSERT INTO `sys_menu` VALUES (2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL); INSERT INTO `sys_menu` VALUES (3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); INSERT INTO `sys_menu` VALUES (43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); @@ -337,8 +324,7 @@ INSERT INTO `sys_post` VALUES (2, '首席技术执行官', 'CTO', 2, '2','首席 INSERT INTO `sys_post` VALUES (3, '首席运营官', 'COO', 3, '2','测试工程师', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); INSERT INTO `sys_role` VALUES (1, '系统管理员', '2', 'admin', 1, '', '', 1, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); INSERT INTO `sys_user` VALUES (1, 'admin', '$2a$10$/Glr4g9Svr6O0kvjsRJCXu3f0W8/dsP3XZyVNi1019ratWpSPMyw.', 'zhangwj', '13818888888', 1, '', '', '1', '1@qq.com', 1, 1, '', '2', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.205', NULL); -COMMIT; SET FOREIGN_KEY_CHECKS = 1; --- 数据完成 ; \ No newline at end of file +-- 数据完成 ; From 443c30d48cddffc1ed974eb4e04dac8f1c23cddd Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Fri, 22 Oct 2021 12:05:39 +0800 Subject: [PATCH 023/238] Update 1599190683659_tables.go --- cmd/migrate/migration/version/1599190683659_tables.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/migrate/migration/version/1599190683659_tables.go b/cmd/migrate/migration/version/1599190683659_tables.go index ef3076dac..09a8e0e07 100644 --- a/cmd/migrate/migration/version/1599190683659_tables.go +++ b/cmd/migrate/migration/version/1599190683659_tables.go @@ -43,8 +43,8 @@ func _1599190683659Tables(db *gorm.DB, version string) error { if err := models.InitDb(tx); err != nil { } - return db.Create(&common.Migration{ + return tx.Create(&common.Migration{ Version: version, }).Error }) -} \ No newline at end of file +} From 88e4b37c03775b0291b9ef3233217ebcce1f3785 Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Tue, 7 Dec 2021 22:44:39 +0800 Subject: [PATCH 024/238] feat :sparkles: push docker to github --- .github/workflows/go.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 797c12e9c..8ee2a6761 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -42,4 +42,25 @@ jobs: - run: | ref=${{ github.ref }} docker push goadminteam/go-admin:${ref##*/}-${{ github.sha }} - docker push goadminteam/go-admin:latest \ No newline at end of file + docker push goadminteam/go-admin:latest + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 562f761807291e83b7586e35bc434fee14c61227 Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Tue, 7 Dec 2021 22:47:44 +0800 Subject: [PATCH 025/238] feat :sparkles: add dev to ci --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8ee2a6761..22c9b5313 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,7 +2,7 @@ name: build on: push: - branches: [ master ] + branches: [ master, dev ] pull_request: branches: [ master ] From 0cc27355f7762e0ee84e91b3c3cc54a91f304836 Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Tue, 7 Dec 2021 23:24:19 +0800 Subject: [PATCH 026/238] fix :bug: push to gihub --- .github/workflows/go.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 22c9b5313..cf466b2f8 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,6 +5,9 @@ on: branches: [ master, dev ] pull_request: branches: [ master ] +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: @@ -33,16 +36,6 @@ jobs: run: | ref=${{ github.ref }} go mod vendor - docker build . -t goadminteam/go-admin:${ref##*/}-${{ github.sha }} - docker tag goadminteam/go-admin:${ref##*/}-${{ github.sha }} goadminteam/go-admin:latest - - uses: Azure/docker-login@v1 - with: - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - run: | - ref=${{ github.ref }} - docker push goadminteam/go-admin:${ref##*/}-${{ github.sha }} - docker push goadminteam/go-admin:latest - name: Log in to the Container registry uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 From 3ac1878c3c1ee2ef6538ed3fd40b1b36e29d9730 Mon Sep 17 00:00:00 2001 From: linwenxiang <991154416@qq.com> Date: Tue, 7 Dec 2021 23:37:33 +0800 Subject: [PATCH 027/238] perf :zap: performance docker build --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index cf466b2f8..bf741c087 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -35,7 +35,7 @@ jobs: - name: Build run: | ref=${{ github.ref }} - go mod vendor + CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin . - name: Log in to the Container registry uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 @@ -54,6 +54,7 @@ jobs: uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . + file: scripts/Dockerfile push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From abdc80b756a51ab418f84ee3d626282decce8ebb Mon Sep 17 00:00:00 2001 From: inits Date: Mon, 10 Jan 2022 10:21:10 +0800 Subject: [PATCH 028/238] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_role.go | 6 +++--- template/v4/dto.go.template | 6 ++++-- template/v4/no_actions/router_check_role.go.template | 7 ++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index ab374822d..c10c18c29 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -142,7 +142,7 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err e.Log.Errorf("delete policy error:%s", err) return err } - mp:=make(map [string] interface{} ,0) + mp := make(map[string]interface{}, 0) polices := make([][]string, 0) for _, menu := range mlist { for _, api := range menu.SysApi { @@ -214,7 +214,7 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { var dlist = make([]models.SysDept, 0) var model = models.SysRole{} tx.Preload("SysDept").First(&model, c.RoleId) - tx.Where("id in ?", c.DeptIds).Find(&dlist) + tx.Where("dept_id in ?", c.DeptIds).Find(&dlist) err = tx.Model(&model).Association("SysDept").Delete(model.SysDept) if err != nil { e.Log.Errorf("delete SysDept error:%s", err) @@ -299,4 +299,4 @@ func (e *SysRole) GetById(roleId int) ([]string, error) { permissions = append(permissions, l[i].Permission) } return permissions, nil -} \ No newline at end of file +} diff --git a/template/v4/dto.go.template b/template/v4/dto.go.template index 1aa5bfe46..82ee13557 100644 --- a/template/v4/dto.go.template +++ b/template/v4/dto.go.template @@ -70,7 +70,8 @@ func (s *{{.ClassName}}InsertReq) Generate(model *models.{{.ClassName}}) { {{- else if eq .GoField "CreatedAt" -}} {{- else if eq .GoField "UpdatedAt" -}} {{- else if eq .GoField "DeletedAt" -}} - {{- else if eq .GoField "CreateBy" -}} + {{- else if eq .GoField "CreateBy"}} + model.{{.GoField}} = s.{{.GoField}} // 添加这而,需要记录是被谁创建的 {{- else if eq .GoField "UpdateBy" -}} {{- else }} model.{{.GoField}} = s.{{.GoField}} @@ -110,7 +111,8 @@ func (s *{{.ClassName}}UpdateReq) Generate(model *models.{{.ClassName}}) { {{- else if eq .GoField "UpdatedAt" -}} {{- else if eq .GoField "DeletedAt" -}} {{- else if eq .GoField "CreateBy" -}} - {{- else if eq .GoField "UpdateBy" -}} + {{- else if eq .GoField "UpdateBy"}} + model.{{.GoField}} = s.{{.GoField}} // 添加这而,需要记录是被谁更新的 {{- else }} model.{{.GoField}} = s.{{.GoField}} {{- end -}} diff --git a/template/v4/no_actions/router_check_role.go.template b/template/v4/no_actions/router_check_role.go.template index 249c61c4c..f8a3c3a7c 100644 --- a/template/v4/no_actions/router_check_role.go.template +++ b/template/v4/no_actions/router_check_role.go.template @@ -6,6 +6,7 @@ import ( "go-admin/app/{{.PackageName}}/apis" "go-admin/common/middleware" + "go-admin/common/actions" ) func init() { @@ -17,10 +18,10 @@ func register{{.ClassName}}Router(v1 *gin.RouterGroup, authMiddleware *jwt.GinJW api := apis.{{.ClassName}}{} r := v1.Group("/{{.ModuleName}}").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) { - r.GET("", api.GetPage) - r.GET("/:id", api.Get) + r.GET("", actions.PermissionAction(), api.GetPage) + r.GET("/:id", actions.PermissionAction(), api.Get) r.POST("", api.Insert) - r.PUT("/:id", api.Update) + r.PUT("/:id", actions.PermissionAction(), api.Update) r.DELETE("", api.Delete) } } \ No newline at end of file From 34b3395d15cd3674e9852666491d7197292daba1 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 10 Jan 2022 13:17:28 +0800 Subject: [PATCH 029/238] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 860b62901..4338902d2 100644 --- a/README.md +++ b/README.md @@ -161,10 +161,10 @@ cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` bash # The first configuration needs to initialize the database resource information # Use under macOS or linux -$ ./go-admin migrate -c=config/settings.dev.yml +$ ./go-admin migrate -c config/settings.dev.yml # ⚠️Note: Use under windows -$ go-admin.exe migrate -c=config/settings.dev.yml +$ go-admin.exe migrate -c config/settings.dev.yml # Start the project, you can also use the IDE for debugging # Use under macOS or linux @@ -274,4 +274,4 @@ The `go-admin` project has always been developed in the GoLand integrated develo [MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md) -Copyright (c) 2020 wenjianzhang \ No newline at end of file +Copyright (c) 2020 wenjianzhang From fd2709affa8b760a07c5f725b15e8ef0d6e91bc1 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 10 Jan 2022 13:18:23 +0800 Subject: [PATCH 030/238] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 860b62901..4338902d2 100644 --- a/README.md +++ b/README.md @@ -161,10 +161,10 @@ cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` bash # The first configuration needs to initialize the database resource information # Use under macOS or linux -$ ./go-admin migrate -c=config/settings.dev.yml +$ ./go-admin migrate -c config/settings.dev.yml # ⚠️Note: Use under windows -$ go-admin.exe migrate -c=config/settings.dev.yml +$ go-admin.exe migrate -c config/settings.dev.yml # Start the project, you can also use the IDE for debugging # Use under macOS or linux @@ -274,4 +274,4 @@ The `go-admin` project has always been developed in the GoLand integrated develo [MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md) -Copyright (c) 2020 wenjianzhang \ No newline at end of file +Copyright (c) 2020 wenjianzhang From ae8e32d8060d95efdf2c5432b04982ea698af56f Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 10 Jan 2022 13:18:59 +0800 Subject: [PATCH 031/238] Update README.Zh-cn.md --- README.Zh-cn.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 1d4cc3231..9447895f4 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -167,10 +167,10 @@ cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` bash # 首次配置需要初始化数据库资源信息 # macOS or linux 下使用 -$ ./go-admin migrate -c=config/settings.dev.yml +$ ./go-admin migrate -c config/settings.dev.yml # ⚠️注意:windows 下使用 -$ go-admin.exe migrate -c=config/settings.dev.yml +$ go-admin.exe migrate -c config/settings.dev.yml # 启动项目,也可以用IDE进行调试 @@ -284,4 +284,4 @@ npm run dev [MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md) -Copyright (c) 2020 wenjianzhang \ No newline at end of file +Copyright (c) 2020 wenjianzhang From ccccab310466e55c9995dddf72c4b306163460ad Mon Sep 17 00:00:00 2001 From: yangyu Date: Wed, 12 Jan 2022 17:10:52 +0800 Subject: [PATCH 032/238] fix bug --- app/other/models/tools/sys_columns.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/other/models/tools/sys_columns.go b/app/other/models/tools/sys_columns.go index 34fe27c7b..1acc6aba5 100644 --- a/app/other/models/tools/sys_columns.go +++ b/app/other/models/tools/sys_columns.go @@ -56,7 +56,7 @@ func (e *SysColumns) GetList(tx *gorm.DB, exclude bool) ([]SysColumns, error) { table := tx.Table("sys_columns") table = table.Where("table_id = ? ", e.TableId) if exclude { - notIn := make([]string, 6) + notIn := make([]string, 0, 6) notIn = append(notIn, "id") notIn = append(notIn, "create_by") notIn = append(notIn, "update_by") From 0b73bd7b25c9281e0e4b91e005b975fe8fe1e103 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sat, 22 Jan 2022 19:37:56 +0800 Subject: [PATCH 033/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9sqplite=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/migrate/migration/models/initdb.go | 12 +- config/db-begin-mysql.sql | 2 + config/db-end-mysql.sql | 1 + config/db.sql | 640 ++++++++++++------------- go-admin-db.db | Bin 0 -> 319488 bytes 5 files changed, 330 insertions(+), 325 deletions(-) create mode 100644 config/db-begin-mysql.sql create mode 100644 config/db-end-mysql.sql create mode 100644 go-admin-db.db diff --git a/cmd/migrate/migration/models/initdb.go b/cmd/migrate/migration/models/initdb.go index 9bb37a2ab..5a37ec593 100644 --- a/cmd/migrate/migration/models/initdb.go +++ b/cmd/migrate/migration/models/initdb.go @@ -11,10 +11,18 @@ import ( func InitDb(db *gorm.DB) (err error) { filePath := "config/db.sql" - err = ExecSql(db, filePath) if global.Driver == "postgres" { filePath = "config/pg.sql" err = ExecSql(db, filePath) + } else if global.Driver == "mysql" { + filePath = "config/db-begin-mysql.sql" + err = ExecSql(db, filePath) + filePath = "config/db.sql" + err = ExecSql(db, filePath) + filePath = "config/db-end-mysql.sql" + err = ExecSql(db, filePath) + } else { + err = ExecSql(db, filePath) } return err } @@ -52,4 +60,4 @@ func Ioutil(filePath string) (string, error) { } else { return "", err } -} +} \ No newline at end of file diff --git a/config/db-begin-mysql.sql b/config/db-begin-mysql.sql new file mode 100644 index 000000000..04da2f1a2 --- /dev/null +++ b/config/db-begin-mysql.sql @@ -0,0 +1,2 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; \ No newline at end of file diff --git a/config/db-end-mysql.sql b/config/db-end-mysql.sql new file mode 100644 index 000000000..4bd9d01eb --- /dev/null +++ b/config/db-end-mysql.sql @@ -0,0 +1 @@ +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/config/db.sql b/config/db.sql index d1c97d14c..9ec63b4c9 100644 --- a/config/db.sql +++ b/config/db.sql @@ -1,330 +1,324 @@ -- 开始初始化数据 ; -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; +INSERT INTO sys_api VALUES (5, 'go-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', NULL, 0, 0); +INSERT INTO sys_api VALUES (6, 'go-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (7, 'go-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', NULL, 0, 0); +INSERT INTO sys_api VALUES (8, 'go-admin/common/actions.IndexAction.func1', '分类列表', '/api/v1/syscategory', 'BUS', 'GET', '2021-05-13 19:59:00.870', '2021-06-13 20:53:47.883', NULL, 0, 0); +INSERT INTO sys_api VALUES (9, 'go-admin/common/actions.ViewAction.func1', '分类通过id获取', '/api/v1/syscategory/:id', 'BUS', 'GET', '2021-05-13 19:59:00.945', '2021-06-13 20:53:47.926', NULL, 0, 0); +INSERT INTO sys_api VALUES (10, 'go-admin/common/actions.IndexAction.func1', '内容列表', '/api/v1/syscontent', 'BUS', 'GET', '2021-05-13 19:59:01.005', '2021-06-13 20:53:47.966', NULL, 0, 0); +INSERT INTO sys_api VALUES (11, 'go-admin/common/actions.ViewAction.func1', '内容通过id获取', '/api/v1/syscontent/:id', 'BUS', 'GET', '2021-05-13 19:59:01.056', '2021-06-13 20:53:48.005', NULL, 0, 0); +INSERT INTO sys_api VALUES (15, 'go-admin/common/actions.IndexAction.func1', 'job列表', '/api/v1/sysjob', 'BUS', 'GET', '2021-05-13 19:59:01.248', '2021-06-13 20:53:48.169', NULL, 0, 0); +INSERT INTO sys_api VALUES (16, 'go-admin/common/actions.ViewAction.func1', 'job通过id获取', '/api/v1/sysjob/:id', 'BUS', 'GET', '2021-05-13 19:59:01.298', '2021-06-13 20:53:48.214', NULL, 0, 0); +INSERT INTO sys_api VALUES (21, 'go-admin/app/admin/apis.SysDictType.GetPage-fm', '字典类型列表', '/api/v1/dict/type', 'BUS', 'GET', '2021-05-13 19:59:01.525', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (22, 'go-admin/app/admin/apis.SysDictType.GetAll-fm', '字典类型查询【代码生成】', '/api/v1/dict/type-option-select', 'SYS', 'GET', '2021-05-13 19:59:01.582', '2021-06-13 20:53:48.388', NULL, 0, 0); +INSERT INTO sys_api VALUES (23, 'go-admin/app/admin/apis.SysDictType.Get-fm', '字典类型通过id获取', '/api/v1/dict/type/:id', 'BUS', 'GET', '2021-05-13 19:59:01.632', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (24, 'go-admin/app/admin/apis.SysDictData.GetPage-fm', '字典数据列表', '/api/v1/dict/data', 'BUS', 'GET', '2021-05-13 19:59:01.684', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (25, 'go-admin/app/admin/apis.SysDictData.Get-fm', '字典数据通过code获取', '/api/v1/dict/data/:dictCode', 'BUS', 'GET', '2021-05-13 19:59:01.732', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (26, 'go-admin/app/admin/apis.SysDictData.GetSysDictDataAll-fm', '数据字典根据key获取', '/api/v1/dict-data/option-select', 'SYS', 'GET', '2021-05-13 19:59:01.832', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (27, 'go-admin/app/admin/apis.SysDept.GetPage-fm', '部门列表', '/api/v1/dept', 'BUS', 'GET', '2021-05-13 19:59:01.940', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (28, 'go-admin/app/admin/apis.SysDept.Get-fm', '部门通过id获取', '/api/v1/dept/:id', 'BUS', 'GET', '2021-05-13 19:59:02.009', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (29, 'go-admin/app/admin/apis.SysDept.Get2Tree-fm', '查询部门下拉树【角色权限-自定权限】', '/api/v1/deptTree', 'SYS', 'GET', '2021-05-13 19:59:02.050', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (30, 'go-admin/app/admin/apis/tools.(*Gen).GetDBTableList-fm', '数据库表列表', '/api/v1/db/tables/page', 'SYS', 'GET', '2021-05-13 19:59:02.098', '2021-06-13 20:53:48.730', NULL, 0, 0); +INSERT INTO sys_api VALUES (31, 'go-admin/app/admin/apis/tools.(*Gen).GetDBColumnList-fm', '数据表列列表', '/api/v1/db/columns/page', 'SYS', 'GET', '2021-05-13 19:59:02.140', '2021-06-13 20:53:48.771', NULL, 0, 0); +INSERT INTO sys_api VALUES (32, 'go-admin/app/admin/apis/tools.Gen.GenCode-fm', '数据库表生成到项目', '/api/v1/gen/toproject/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.183', '2021-06-13 20:53:48.812', NULL, 0, 0); +INSERT INTO sys_api VALUES (33, 'go-admin/app/admin/apis/tools.Gen.GenMenuAndApi-fm', '数据库表生成到DB', '/api/v1/gen/todb/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.227', '2021-06-13 20:53:48.853', NULL, 0, 0); +INSERT INTO sys_api VALUES (34, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesTree-fm', '关系表数据【代码生成】', '/api/v1/gen/tabletree', 'SYS', 'GET', '2021-05-13 19:59:02.271', '2021-06-13 20:53:48.893', NULL, 0, 0); +INSERT INTO sys_api VALUES (35, 'go-admin/app/admin/apis/tools.Gen.Preview-fm', '生成预览通过id获取', '/api/v1/gen/preview/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.315', '2021-06-13 20:53:48.935', NULL, 0, 0); +INSERT INTO sys_api VALUES (36, 'go-admin/app/admin/apis/tools.Gen.GenApiToFile-fm', '生成api带文件', '/api/v1/gen/apitofile/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.357', '2021-06-13 20:53:48.977', NULL, 0, 0); +INSERT INTO sys_api VALUES (37, 'go-admin/app/admin/apis.System.GenerateCaptchaHandler-fm', '验证码获取', '/api/v1/getCaptcha', 'SYS', 'GET', '2021-05-13 19:59:02.405', '2021-06-13 20:53:49.020', NULL, 0, 0); +INSERT INTO sys_api VALUES (38, 'go-admin/app/admin/apis.SysUser.GetInfo-fm', '用户信息获取', '/api/v1/getinfo', 'SYS', 'GET', '2021-05-13 19:59:02.447', '2021-06-13 20:53:49.065', NULL, 0, 0); +INSERT INTO sys_api VALUES (39, 'go-admin/app/admin/apis.SysMenu.GetPage-fm', '菜单列表', '/api/v1/menu', 'BUS', 'GET', '2021-05-13 19:59:02.497', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (40, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '查询菜单下拉树结构【废弃】', '/api/v1/menuTreeselect', 'SYS', 'GET', '2021-05-13 19:59:02.542', '2021-06-03 22:37:21.857', NULL, 0, 0); +INSERT INTO sys_api VALUES (41, 'go-admin/app/admin/apis.SysMenu.Get-fm', '菜单通过id获取', '/api/v1/menu/:id', 'BUS', 'GET', '2021-05-13 19:59:02.584', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (42, 'go-admin/app/admin/apis.SysMenu.GetMenuRole-fm', '角色菜单【顶部左侧菜单】', '/api/v1/menurole', 'SYS', 'GET', '2021-05-13 19:59:02.630', '2021-06-13 20:53:49.574', NULL, 0, 0); +INSERT INTO sys_api VALUES (43, 'go-admin/app/admin/apis.SysMenu.GetMenuIDS-fm', '获取角色对应的菜单id数组【废弃】', '/api/v1/menuids', 'SYS', 'GET', '2021-05-13 19:59:02.675', '2021-06-03 22:39:52.500', NULL, 0, 0); +INSERT INTO sys_api VALUES (44, 'go-admin/app/admin/apis.SysRole.GetPage-fm', '角色列表', '/api/v1/role', 'BUS', 'GET', '2021-05-13 19:59:02.720', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (45, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '菜单权限列表【角色配菜单使用】', '/api/v1/roleMenuTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.762', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (46, 'go-admin/app/admin/apis.SysDept.GetDeptTreeRoleSelect-fm', '角色部门结构树【自定义数据权限】', '/api/v1/roleDeptTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.809', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (47, 'go-admin/app/admin/apis.SysRole.Get-fm', '角色通过id获取', '/api/v1/role/:id', 'BUS', 'GET', '2021-05-13 19:59:02.850', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (48, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).RefreshHandler-fm', '刷新token', '/api/v1/refresh_token', 'SYS', 'GET', '2021-05-13 19:59:02.892', '2021-06-13 20:53:49.278', NULL, 0, 0); +INSERT INTO sys_api VALUES (53, 'go-admin/app/admin/apis.SysConfig.GetPage-fm', '参数列表', '/api/v1/config', 'BUS', 'GET', '2021-05-13 19:59:03.116', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (54, 'go-admin/app/admin/apis.SysConfig.Get-fm', '参数通过id获取', '/api/v1/config/:id', 'BUS', 'GET', '2021-05-13 19:59:03.157', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (55, 'go-admin/app/admin/apis.SysConfig.GetSysConfigByKEYForService-fm', '参数通过键名搜索【基础默认配置】', '/api/v1/configKey/:configKey', 'SYS', 'GET', '2021-05-13 19:59:03.198', '2021-06-13 20:53:49.745', NULL, 0, 0); +INSERT INTO sys_api VALUES (57, 'go-admin/app/jobs/apis.SysJob.RemoveJobForService-fm', 'job移除', '/api/v1/job/remove/:id', 'BUS', 'GET', '2021-05-13 19:59:03.295', '2021-06-13 20:53:49.786', NULL, 0, 0); +INSERT INTO sys_api VALUES (58, 'go-admin/app/jobs/apis.SysJob.StartJobForService-fm', 'job启动', '/api/v1/job/start/:id', 'BUS', 'GET', '2021-05-13 19:59:03.339', '2021-06-13 20:53:49.829', NULL, 0, 0); +INSERT INTO sys_api VALUES (59, 'go-admin/app/admin/apis.SysPost.GetPage-fm', '岗位列表', '/api/v1/post', 'BUS', 'GET', '2021-05-13 19:59:03.381', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (60, 'go-admin/app/admin/apis.SysPost.Get-fm', '岗位通过id获取', '/api/v1/post/:id', 'BUS', 'GET', '2021-05-13 19:59:03.433', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (62, 'go-admin/app/admin/apis.SysConfig.GetSysConfigBySysApp-fm', '系统前端参数', '/api/v1/app-config', 'SYS', 'GET', '2021-05-13 19:59:03.526', '2021-06-13 20:53:49.994', NULL, 0, 0); +INSERT INTO sys_api VALUES (63, 'go-admin/app/admin/apis.SysUser.GetProfile-fm', '*用户信息获取', '/api/v1/user/profile', 'SYS', 'GET', '2021-05-13 19:59:03.567', '2021-06-13 20:53:50.038', NULL, 0, 0); +INSERT INTO sys_api VALUES (66, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).WsClient-fm', '链接ws【定时任务log】', '/ws/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.705', '2021-06-13 20:53:50.167', NULL, 0, 0); +INSERT INTO sys_api VALUES (67, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).UnWsClient-fm', '退出ws【定时任务log】', '/wslogout/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.756', '2021-06-13 20:53:50.209', NULL, 0, 0); +INSERT INTO sys_api VALUES (68, 'go-admin/common/middleware/handler.Ping', '*用户基本信息', '/info', 'SYS', 'GET', '2021-05-13 19:59:03.800', '2021-06-13 20:53:50.251', NULL, 0, 0); +INSERT INTO sys_api VALUES (72, 'go-admin/common/actions.CreateAction.func1', '分类创建', '/api/v1/syscategory', 'BUS', 'POST', '2021-05-13 19:59:03.982', '2021-06-13 20:53:50.336', NULL, 0, 0); +INSERT INTO sys_api VALUES (73, 'go-admin/common/actions.CreateAction.func1', '内容创建', '/api/v1/syscontent', 'BUS', 'POST', '2021-05-13 19:59:04.027', '2021-06-13 20:53:50.375', NULL, 0, 0); +INSERT INTO sys_api VALUES (76, 'go-admin/common/actions.CreateAction.func1', 'job创建', '/api/v1/sysjob', 'BUS', 'POST', '2021-05-13 19:59:04.164', '2021-06-13 20:53:50.500', NULL, 0, 0); +INSERT INTO sys_api VALUES (80, 'go-admin/app/admin/apis.SysDictData.Insert-fm', '字典数据创建', '/api/v1/dict/data', 'BUS', 'POST', '2021-05-13 19:59:04.347', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (81, 'go-admin/app/admin/apis.SysDictType.Insert-fm', '字典类型创建', '/api/v1/dict/type', 'BUS', 'POST', '2021-05-13 19:59:04.391', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (82, 'go-admin/app/admin/apis.SysDept.Insert-fm', '部门创建', '/api/v1/dept', 'BUS', 'POST', '2021-05-13 19:59:04.435', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (85, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).LoginHandler-fm', '*登录', '/api/v1/login', 'SYS', 'POST', '2021-05-13 19:59:04.597', '2021-06-13 20:53:50.784', NULL, 0, 0); +INSERT INTO sys_api VALUES (86, 'go-admin/common/middleware/handler.LogOut', '*退出', '/api/v1/logout', 'SYS', 'POST', '2021-05-13 19:59:04.642', '2021-06-13 20:53:50.824', NULL, 0, 0); +INSERT INTO sys_api VALUES (87, 'go-admin/app/admin/apis.SysConfig.Insert-fm', '参数创建', '/api/v1/config', 'BUS', 'POST', '2021-05-13 19:59:04.685', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (88, 'go-admin/app/admin/apis.SysMenu.Insert-fm', '菜单创建', '/api/v1/menu', 'BUS', 'POST', '2021-05-13 19:59:04.777', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (89, 'go-admin/app/admin/apis.SysPost.Insert-fm', '岗位创建', '/api/v1/post', 'BUS', 'POST', '2021-05-13 19:59:04.886', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (90, 'go-admin/app/admin/apis.SysRole.Insert-fm', '角色创建', '/api/v1/role', 'BUS', 'POST', '2021-05-13 19:59:04.975', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (91, 'go-admin/app/admin/apis.SysUser.InsetAvatar-fm', '*用户头像编辑', '/api/v1/user/avatar', 'SYS', 'POST', '2021-05-13 19:59:05.058', '2021-06-13 20:53:51.079', NULL, 0, 0); +INSERT INTO sys_api VALUES (92, 'go-admin/app/admin/apis.SysApi.Update-fm', '接口编辑', '/api/v1/sys-api/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.122', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (95, 'go-admin/common/actions.UpdateAction.func1', '分类编辑', '/api/v1/syscategory/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.255', '2021-06-13 20:53:51.247', NULL, 0, 0); +INSERT INTO sys_api VALUES (96, 'go-admin/common/actions.UpdateAction.func1', '内容编辑', '/api/v1/syscontent/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.299', '2021-06-13 20:53:51.289', NULL, 0, 0); +INSERT INTO sys_api VALUES (97, 'go-admin/common/actions.UpdateAction.func1', 'job编辑', '/api/v1/sysjob', 'BUS', 'PUT', '2021-05-13 19:59:05.343', '2021-06-13 20:53:51.331', NULL, 0, 0); +INSERT INTO sys_api VALUES (101, 'go-admin/app/admin/apis.SysDictData.Update-fm', '字典数据编辑', '/api/v1/dict/data/:dictCode', 'BUS', 'PUT', '2021-05-13 19:59:05.519', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (102, 'go-admin/app/admin/apis.SysDictType.Update-fm', '字典类型编辑', '/api/v1/dict/type/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.569', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (103, 'go-admin/app/admin/apis.SysDept.Update-fm', '部门编辑', '/api/v1/dept/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.613', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (104, 'go-admin/app/other/apis.SysFileDir.Update-fm', '文件夹编辑', '/api/v1/file-dir/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.662', '2021-06-13 20:53:51.847', NULL, 0, 0); +INSERT INTO sys_api VALUES (105, 'go-admin/app/other/apis.SysFileInfo.Update-fm', '文件编辑', '/api/v1/file-info/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.709', '2021-06-13 20:53:51.892', NULL, 0, 0); +INSERT INTO sys_api VALUES (106, 'go-admin/app/admin/apis.SysRole.Update-fm', '角色编辑', '/api/v1/role/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.752', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (107, 'go-admin/app/admin/apis.SysRole.Update2DataScope-fm', '角色数据权限修改', '/api/v1/roledatascope', 'BUS', 'PUT', '2021-05-13 19:59:05.803', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (108, 'go-admin/app/admin/apis.SysConfig.Update-fm', '参数编辑', '/api/v1/config/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.848', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (109, 'go-admin/app/admin/apis.SysMenu.Update-fm', '编辑菜单', '/api/v1/menu/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.891', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (110, 'go-admin/app/admin/apis.SysPost.Update-fm', '岗位编辑', '/api/v1/post/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.934', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (111, 'go-admin/app/admin/apis.SysUser.UpdatePwd-fm', '*用户修改密码', '/api/v1/user/pwd', 'SYS', 'PUT', '2021-05-13 19:59:05.987', '2021-06-13 20:53:51.724', NULL, 0, 0); +INSERT INTO sys_api VALUES (112, 'go-admin/common/actions.DeleteAction.func1', '分类删除', '/api/v1/syscategory', 'BUS', 'DELETE', '2021-05-13 19:59:06.030', '2021-06-13 20:53:52.237', NULL, 0, 0); +INSERT INTO sys_api VALUES (113, 'go-admin/common/actions.DeleteAction.func1', '内容删除', '/api/v1/syscontent', 'BUS', 'DELETE', '2021-05-13 19:59:06.076', '2021-06-13 20:53:52.278', NULL, 0, 0); +INSERT INTO sys_api VALUES (114, 'go-admin/app/admin/apis.SysLoginLog.Delete-fm', '登录日志删除', '/api/v1/sys-login-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.118', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (115, 'go-admin/app/admin/apis.SysOperaLog.Delete-fm', '操作日志删除', '/api/v1/sys-opera-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.162', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (116, 'go-admin/common/actions.DeleteAction.func1', 'job删除', '/api/v1/sysjob', 'BUS', 'DELETE', '2021-05-13 19:59:06.206', '2021-06-13 20:53:52.323', NULL, 0, 0); +INSERT INTO sys_api VALUES (117, 'go-admin/app/other/apis.SysChinaAreaData.Delete-fm', '行政区删除', '/api/v1/sys-area-data', 'BUS', 'DELETE', '2021-05-13 19:59:06.249', '2021-06-13 20:53:52.061', NULL, 0, 0); +INSERT INTO sys_api VALUES (120, 'go-admin/app/admin/apis.SysDictData.Delete-fm', '字典数据删除', '/api/v1/dict/data', 'BUS', 'DELETE', '2021-05-13 19:59:06.387', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (121, 'go-admin/app/admin/apis.SysDictType.Delete-fm', '字典类型删除', '/api/v1/dict/type', 'BUS', 'DELETE', '2021-05-13 19:59:06.432', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (122, 'go-admin/app/admin/apis.SysDept.Delete-fm', '部门删除', '/api/v1/dept/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.475', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (123, 'go-admin/app/other/apis.SysFileDir.Delete-fm', '文件夹删除', '/api/v1/file-dir/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.520', '2021-06-13 20:53:52.539', NULL, 0, 0); +INSERT INTO sys_api VALUES (124, 'go-admin/app/other/apis.SysFileInfo.Delete-fm', '文件删除', '/api/v1/file-info/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.566', '2021-06-13 20:53:52.580', NULL, 0, 0); +INSERT INTO sys_api VALUES (125, 'go-admin/app/admin/apis.SysConfig.Delete-fm', '参数删除', '/api/v1/config', 'BUS', 'DELETE', '2021-05-13 19:59:06.612', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (126, 'go-admin/app/admin/apis.SysMenu.Delete-fm', '删除菜单', '/api/v1/menu', 'BUS', 'DELETE', '2021-05-13 19:59:06.654', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (127, 'go-admin/app/admin/apis.SysPost.Delete-fm', '岗位删除', '/api/v1/post/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.702', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (128, 'go-admin/app/admin/apis.SysRole.Delete-fm', '角色删除', '/api/v1/role', 'BUS', 'DELETE', '2021-05-13 19:59:06.746', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (131, 'github.com/go-admin-team/go-admin-core/tools/transfer.Handler.func1', '系统指标', '/api/v1/metrics', 'SYS', 'GET', '2021-05-17 22:13:55.933', '2021-06-13 20:53:49.614', NULL, 0, 0); +INSERT INTO sys_api VALUES (132, 'go-admin/app/other/router.registerMonitorRouter.func1', '健康状态', '/api/v1/health', 'SYS', 'GET', '2021-05-17 22:13:56.285', '2021-06-13 20:53:49.951', NULL, 0, 0); +INSERT INTO sys_api VALUES (133, 'go-admin/app/admin/apis.HelloWorld', '项目默认接口', '/', 'SYS', 'GET', '2021-05-24 10:30:44.553', '2021-06-13 20:53:47.406', NULL, 0, 0); +INSERT INTO sys_api VALUES (134, 'go-admin/app/other/apis.ServerMonitor.ServerInfo-fm', '服务器基本状态', '/api/v1/server-monitor', 'SYS', 'GET', '2021-05-24 10:30:44.937', '2021-06-13 20:53:48.255', NULL, 0, 0); +INSERT INTO sys_api VALUES (135, 'go-admin/app/admin/apis.SysApi.GetPage-fm', '接口列表', '/api/v1/sys-api', 'BUS', 'GET', '2021-05-24 11:37:53.303', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (136, 'go-admin/app/admin/apis.SysApi.Get-fm', '接口通过id获取', '/api/v1/sys-api/:id', 'BUS', 'GET', '2021-05-24 11:37:53.359', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (137, 'go-admin/app/admin/apis.SysLoginLog.GetPage-fm', '登录日志列表', '/api/v1/sys-login-log', 'BUS', 'GET', '2021-05-24 11:47:30.397', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (138, 'go-admin/app/other/apis.File.UploadFile-fm', '文件上传', '/api/v1/public/uploadFile', 'SYS', 'POST', '2021-05-25 19:16:18.493', '2021-06-13 20:53:50.866', NULL, 0, 0); +INSERT INTO sys_api VALUES (139, 'go-admin/app/admin/apis.SysConfig.Update2Set-fm', '参数信息修改【参数配置】', '/api/v1/set-config', 'BUS', 'PUT', '2021-05-27 09:45:14.853', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (140, 'go-admin/app/admin/apis.SysConfig.Get2Set-fm', '参数获取全部【配置使用】', '/api/v1/set-config', 'BUS', 'GET', '2021-05-27 11:54:14.384', '2021-06-17 11:48:40.732', NULL, 0, 0); +INSERT INTO sys_api VALUES (141, 'go-admin/app/admin/apis.SysUser.GetPage-fm', '管理员列表', '/api/v1/sys-user', 'BUS', 'GET', '2021-06-13 19:24:57.111', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (142, 'go-admin/app/admin/apis.SysUser.Get-fm', '管理员通过id获取', '/api/v1/sys-user/:id', 'BUS', 'GET', '2021-06-13 19:24:57.188', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (143, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesInfo-fm', '', '/api/v1/sys/tables/info', '', 'GET', '2021-06-13 19:24:57.437', '2021-06-13 20:53:48.047', NULL, 0, 0); +INSERT INTO sys_api VALUES (144, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'GET', '2021-06-13 19:24:57.510', '2021-06-13 20:53:48.088', NULL, 0, 0); +INSERT INTO sys_api VALUES (145, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTableList-fm', '', '/api/v1/sys/tables/page', '', 'GET', '2021-06-13 19:24:57.582', '2021-06-13 20:53:48.128', NULL, 0, 0); +INSERT INTO sys_api VALUES (146, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'GET', '2021-06-13 19:24:59.641', '2021-06-13 20:53:50.081', NULL, 0, 0); +INSERT INTO sys_api VALUES (147, 'github.com/swaggo/gin-swagger.CustomWrapHandler.func1', '', '/swagger/*any', '', 'GET', '2021-06-13 19:24:59.713', '2021-06-13 20:53:50.123', NULL, 0, 0); +INSERT INTO sys_api VALUES (148, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'GET', '2021-06-13 19:24:59.914', '2021-06-13 20:53:50.295', NULL, 0, 0); +INSERT INTO sys_api VALUES (149, 'go-admin/app/admin/apis/tools.(*SysTable).InsertSysTable-fm', '', '/api/v1/sys/tables/info', '', 'POST', '2021-06-13 19:25:00.163', '2021-06-13 20:53:50.539', NULL, 0, 0); +INSERT INTO sys_api VALUES (150, 'go-admin/app/admin/apis.SysUser.Insert-fm', '管理员创建', '/api/v1/sys-user', 'BUS', 'POST', '2021-06-13 19:25:00.233', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (151, 'go-admin/app/admin/apis.SysUser.Update-fm', '管理员编辑', '/api/v1/sys-user', 'BUS', 'PUT', '2021-06-13 19:25:00.986', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (152, 'go-admin/app/admin/apis/tools.(*SysTable).UpdateSysTable-fm', '', '/api/v1/sys/tables/info', '', 'PUT', '2021-06-13 19:25:01.149', '2021-06-13 20:53:51.375', NULL, 0, 0); +INSERT INTO sys_api VALUES (153, 'go-admin/app/admin/apis.SysRole.Update2Status-fm', '', '/api/v1/role-status', '', 'PUT', '2021-06-13 19:25:01.446', '2021-06-13 20:53:51.636', NULL, 0, 0); +INSERT INTO sys_api VALUES (154, 'go-admin/app/admin/apis.SysUser.ResetPwd-fm', '', '/api/v1/user/pwd/reset', '', 'PUT', '2021-06-13 19:25:01.601', '2021-06-13 20:53:51.764', NULL, 0, 0); +INSERT INTO sys_api VALUES (155, 'go-admin/app/admin/apis.SysUser.UpdateStatus-fm', '', '/api/v1/user/status', '', 'PUT', '2021-06-13 19:25:01.671', '2021-06-13 20:53:51.806', NULL, 0, 0); +INSERT INTO sys_api VALUES (156, 'go-admin/app/admin/apis.SysUser.Delete-fm', '管理员删除', '/api/v1/sys-user', 'BUS', 'DELETE', '2021-06-13 19:25:02.043', '2021-06-17 20:31:14.318', NULL, 0, 0); +INSERT INTO sys_api VALUES (157, 'go-admin/app/admin/apis/tools.(*SysTable).DeleteSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'DELETE', '2021-06-13 19:25:02.283', '2021-06-13 20:53:52.367', NULL, 0, 0); +INSERT INTO sys_api VALUES (158, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'HEAD', '2021-06-13 19:25:02.734', '2021-06-13 20:53:52.791', NULL, 0, 0); +INSERT INTO sys_api VALUES (159, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'HEAD', '2021-06-13 19:25:02.808', '2021-06-13 20:53:52.838', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (5, 'go-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (6, 'go-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (7, 'go-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (8, 'go-admin/common/actions.IndexAction.func1', '分类列表', '/api/v1/syscategory', 'BUS', 'GET', '2021-05-13 19:59:00.870', '2021-06-13 20:53:47.883', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (9, 'go-admin/common/actions.ViewAction.func1', '分类通过id获取', '/api/v1/syscategory/:id', 'BUS', 'GET', '2021-05-13 19:59:00.945', '2021-06-13 20:53:47.926', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (10, 'go-admin/common/actions.IndexAction.func1', '内容列表', '/api/v1/syscontent', 'BUS', 'GET', '2021-05-13 19:59:01.005', '2021-06-13 20:53:47.966', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (11, 'go-admin/common/actions.ViewAction.func1', '内容通过id获取', '/api/v1/syscontent/:id', 'BUS', 'GET', '2021-05-13 19:59:01.056', '2021-06-13 20:53:48.005', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (15, 'go-admin/common/actions.IndexAction.func1', 'job列表', '/api/v1/sysjob', 'BUS', 'GET', '2021-05-13 19:59:01.248', '2021-06-13 20:53:48.169', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (16, 'go-admin/common/actions.ViewAction.func1', 'job通过id获取', '/api/v1/sysjob/:id', 'BUS', 'GET', '2021-05-13 19:59:01.298', '2021-06-13 20:53:48.214', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (21, 'go-admin/app/admin/apis.SysDictType.GetPage-fm', '字典类型列表', '/api/v1/dict/type', 'BUS', 'GET', '2021-05-13 19:59:01.525', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (22, 'go-admin/app/admin/apis.SysDictType.GetAll-fm', '字典类型查询【代码生成】', '/api/v1/dict/type-option-select', 'SYS', 'GET', '2021-05-13 19:59:01.582', '2021-06-13 20:53:48.388', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (23, 'go-admin/app/admin/apis.SysDictType.Get-fm', '字典类型通过id获取', '/api/v1/dict/type/:id', 'BUS', 'GET', '2021-05-13 19:59:01.632', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (24, 'go-admin/app/admin/apis.SysDictData.GetPage-fm', '字典数据列表', '/api/v1/dict/data', 'BUS', 'GET', '2021-05-13 19:59:01.684', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (25, 'go-admin/app/admin/apis.SysDictData.Get-fm', '字典数据通过code获取', '/api/v1/dict/data/:dictCode', 'BUS', 'GET', '2021-05-13 19:59:01.732', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (26, 'go-admin/app/admin/apis.SysDictData.GetSysDictDataAll-fm', '数据字典根据key获取', '/api/v1/dict-data/option-select', 'SYS', 'GET', '2021-05-13 19:59:01.832', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (27, 'go-admin/app/admin/apis.SysDept.GetPage-fm', '部门列表', '/api/v1/dept', 'BUS', 'GET', '2021-05-13 19:59:01.940', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (28, 'go-admin/app/admin/apis.SysDept.Get-fm', '部门通过id获取', '/api/v1/dept/:id', 'BUS', 'GET', '2021-05-13 19:59:02.009', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (29, 'go-admin/app/admin/apis.SysDept.Get2Tree-fm', '查询部门下拉树【角色权限-自定权限】', '/api/v1/deptTree', 'SYS', 'GET', '2021-05-13 19:59:02.050', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (30, 'go-admin/app/admin/apis/tools.(*Gen).GetDBTableList-fm', '数据库表列表', '/api/v1/db/tables/page', 'SYS', 'GET', '2021-05-13 19:59:02.098', '2021-06-13 20:53:48.730', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (31, 'go-admin/app/admin/apis/tools.(*Gen).GetDBColumnList-fm', '数据表列列表', '/api/v1/db/columns/page', 'SYS', 'GET', '2021-05-13 19:59:02.140', '2021-06-13 20:53:48.771', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (32, 'go-admin/app/admin/apis/tools.Gen.GenCode-fm', '数据库表生成到项目', '/api/v1/gen/toproject/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.183', '2021-06-13 20:53:48.812', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (33, 'go-admin/app/admin/apis/tools.Gen.GenMenuAndApi-fm', '数据库表生成到DB', '/api/v1/gen/todb/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.227', '2021-06-13 20:53:48.853', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (34, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesTree-fm', '关系表数据【代码生成】', '/api/v1/gen/tabletree', 'SYS', 'GET', '2021-05-13 19:59:02.271', '2021-06-13 20:53:48.893', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (35, 'go-admin/app/admin/apis/tools.Gen.Preview-fm', '生成预览通过id获取', '/api/v1/gen/preview/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.315', '2021-06-13 20:53:48.935', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (36, 'go-admin/app/admin/apis/tools.Gen.GenApiToFile-fm', '生成api带文件', '/api/v1/gen/apitofile/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.357', '2021-06-13 20:53:48.977', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (37, 'go-admin/app/admin/apis.System.GenerateCaptchaHandler-fm', '验证码获取', '/api/v1/getCaptcha', 'SYS', 'GET', '2021-05-13 19:59:02.405', '2021-06-13 20:53:49.020', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (38, 'go-admin/app/admin/apis.SysUser.GetInfo-fm', '用户信息获取', '/api/v1/getinfo', 'SYS', 'GET', '2021-05-13 19:59:02.447', '2021-06-13 20:53:49.065', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (39, 'go-admin/app/admin/apis.SysMenu.GetPage-fm', '菜单列表', '/api/v1/menu', 'BUS', 'GET', '2021-05-13 19:59:02.497', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (40, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '查询菜单下拉树结构【废弃】', '/api/v1/menuTreeselect', 'SYS', 'GET', '2021-05-13 19:59:02.542', '2021-06-03 22:37:21.857', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (41, 'go-admin/app/admin/apis.SysMenu.Get-fm', '菜单通过id获取', '/api/v1/menu/:id', 'BUS', 'GET', '2021-05-13 19:59:02.584', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (42, 'go-admin/app/admin/apis.SysMenu.GetMenuRole-fm', '角色菜单【顶部左侧菜单】', '/api/v1/menurole', 'SYS', 'GET', '2021-05-13 19:59:02.630', '2021-06-13 20:53:49.574', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (43, 'go-admin/app/admin/apis.SysMenu.GetMenuIDS-fm', '获取角色对应的菜单id数组【废弃】', '/api/v1/menuids', 'SYS', 'GET', '2021-05-13 19:59:02.675', '2021-06-03 22:39:52.500', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (44, 'go-admin/app/admin/apis.SysRole.GetPage-fm', '角色列表', '/api/v1/role', 'BUS', 'GET', '2021-05-13 19:59:02.720', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (45, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '菜单权限列表【角色配菜单使用】', '/api/v1/roleMenuTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.762', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (46, 'go-admin/app/admin/apis.SysDept.GetDeptTreeRoleSelect-fm', '角色部门结构树【自定义数据权限】', '/api/v1/roleDeptTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.809', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (47, 'go-admin/app/admin/apis.SysRole.Get-fm', '角色通过id获取', '/api/v1/role/:id', 'BUS', 'GET', '2021-05-13 19:59:02.850', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (48, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).RefreshHandler-fm', '刷新token', '/api/v1/refresh_token', 'SYS', 'GET', '2021-05-13 19:59:02.892', '2021-06-13 20:53:49.278', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (53, 'go-admin/app/admin/apis.SysConfig.GetPage-fm', '参数列表', '/api/v1/config', 'BUS', 'GET', '2021-05-13 19:59:03.116', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (54, 'go-admin/app/admin/apis.SysConfig.Get-fm', '参数通过id获取', '/api/v1/config/:id', 'BUS', 'GET', '2021-05-13 19:59:03.157', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (55, 'go-admin/app/admin/apis.SysConfig.GetSysConfigByKEYForService-fm', '参数通过键名搜索【基础默认配置】', '/api/v1/configKey/:configKey', 'SYS', 'GET', '2021-05-13 19:59:03.198', '2021-06-13 20:53:49.745', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (57, 'go-admin/app/jobs/apis.SysJob.RemoveJobForService-fm', 'job移除', '/api/v1/job/remove/:id', 'BUS', 'GET', '2021-05-13 19:59:03.295', '2021-06-13 20:53:49.786', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (58, 'go-admin/app/jobs/apis.SysJob.StartJobForService-fm', 'job启动', '/api/v1/job/start/:id', 'BUS', 'GET', '2021-05-13 19:59:03.339', '2021-06-13 20:53:49.829', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (59, 'go-admin/app/admin/apis.SysPost.GetPage-fm', '岗位列表', '/api/v1/post', 'BUS', 'GET', '2021-05-13 19:59:03.381', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (60, 'go-admin/app/admin/apis.SysPost.Get-fm', '岗位通过id获取', '/api/v1/post/:id', 'BUS', 'GET', '2021-05-13 19:59:03.433', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (62, 'go-admin/app/admin/apis.SysConfig.GetSysConfigBySysApp-fm', '系统前端参数', '/api/v1/app-config', 'SYS', 'GET', '2021-05-13 19:59:03.526', '2021-06-13 20:53:49.994', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (63, 'go-admin/app/admin/apis.SysUser.GetProfile-fm', '*用户信息获取', '/api/v1/user/profile', 'SYS', 'GET', '2021-05-13 19:59:03.567', '2021-06-13 20:53:50.038', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (66, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).WsClient-fm', '链接ws【定时任务log】', '/ws/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.705', '2021-06-13 20:53:50.167', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (67, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).UnWsClient-fm', '退出ws【定时任务log】', '/wslogout/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.756', '2021-06-13 20:53:50.209', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (68, 'go-admin/common/middleware/handler.Ping', '*用户基本信息', '/info', 'SYS', 'GET', '2021-05-13 19:59:03.800', '2021-06-13 20:53:50.251', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (72, 'go-admin/common/actions.CreateAction.func1', '分类创建', '/api/v1/syscategory', 'BUS', 'POST', '2021-05-13 19:59:03.982', '2021-06-13 20:53:50.336', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (73, 'go-admin/common/actions.CreateAction.func1', '内容创建', '/api/v1/syscontent', 'BUS', 'POST', '2021-05-13 19:59:04.027', '2021-06-13 20:53:50.375', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (76, 'go-admin/common/actions.CreateAction.func1', 'job创建', '/api/v1/sysjob', 'BUS', 'POST', '2021-05-13 19:59:04.164', '2021-06-13 20:53:50.500', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (80, 'go-admin/app/admin/apis.SysDictData.Insert-fm', '字典数据创建', '/api/v1/dict/data', 'BUS', 'POST', '2021-05-13 19:59:04.347', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (81, 'go-admin/app/admin/apis.SysDictType.Insert-fm', '字典类型创建', '/api/v1/dict/type', 'BUS', 'POST', '2021-05-13 19:59:04.391', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (82, 'go-admin/app/admin/apis.SysDept.Insert-fm', '部门创建', '/api/v1/dept', 'BUS', 'POST', '2021-05-13 19:59:04.435', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (85, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).LoginHandler-fm', '*登录', '/api/v1/login', 'SYS', 'POST', '2021-05-13 19:59:04.597', '2021-06-13 20:53:50.784', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (86, 'go-admin/common/middleware/handler.LogOut', '*退出', '/api/v1/logout', 'SYS', 'POST', '2021-05-13 19:59:04.642', '2021-06-13 20:53:50.824', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (87, 'go-admin/app/admin/apis.SysConfig.Insert-fm', '参数创建', '/api/v1/config', 'BUS', 'POST', '2021-05-13 19:59:04.685', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (88, 'go-admin/app/admin/apis.SysMenu.Insert-fm', '菜单创建', '/api/v1/menu', 'BUS', 'POST', '2021-05-13 19:59:04.777', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (89, 'go-admin/app/admin/apis.SysPost.Insert-fm', '岗位创建', '/api/v1/post', 'BUS', 'POST', '2021-05-13 19:59:04.886', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (90, 'go-admin/app/admin/apis.SysRole.Insert-fm', '角色创建', '/api/v1/role', 'BUS', 'POST', '2021-05-13 19:59:04.975', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (91, 'go-admin/app/admin/apis.SysUser.InsetAvatar-fm', '*用户头像编辑', '/api/v1/user/avatar', 'SYS', 'POST', '2021-05-13 19:59:05.058', '2021-06-13 20:53:51.079', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (92, 'go-admin/app/admin/apis.SysApi.Update-fm', '接口编辑', '/api/v1/sys-api/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.122', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (95, 'go-admin/common/actions.UpdateAction.func1', '分类编辑', '/api/v1/syscategory/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.255', '2021-06-13 20:53:51.247', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (96, 'go-admin/common/actions.UpdateAction.func1', '内容编辑', '/api/v1/syscontent/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.299', '2021-06-13 20:53:51.289', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (97, 'go-admin/common/actions.UpdateAction.func1', 'job编辑', '/api/v1/sysjob', 'BUS', 'PUT', '2021-05-13 19:59:05.343', '2021-06-13 20:53:51.331', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (101, 'go-admin/app/admin/apis.SysDictData.Update-fm', '字典数据编辑', '/api/v1/dict/data/:dictCode', 'BUS', 'PUT', '2021-05-13 19:59:05.519', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (102, 'go-admin/app/admin/apis.SysDictType.Update-fm', '字典类型编辑', '/api/v1/dict/type/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.569', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (103, 'go-admin/app/admin/apis.SysDept.Update-fm', '部门编辑', '/api/v1/dept/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.613', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (104, 'go-admin/app/other/apis.SysFileDir.Update-fm', '文件夹编辑', '/api/v1/file-dir/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.662', '2021-06-13 20:53:51.847', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (105, 'go-admin/app/other/apis.SysFileInfo.Update-fm', '文件编辑', '/api/v1/file-info/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.709', '2021-06-13 20:53:51.892', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (106, 'go-admin/app/admin/apis.SysRole.Update-fm', '角色编辑', '/api/v1/role/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.752', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (107, 'go-admin/app/admin/apis.SysRole.Update2DataScope-fm', '角色数据权限修改', '/api/v1/roledatascope', 'BUS', 'PUT', '2021-05-13 19:59:05.803', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (108, 'go-admin/app/admin/apis.SysConfig.Update-fm', '参数编辑', '/api/v1/config/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.848', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (109, 'go-admin/app/admin/apis.SysMenu.Update-fm', '编辑菜单', '/api/v1/menu/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.891', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (110, 'go-admin/app/admin/apis.SysPost.Update-fm', '岗位编辑', '/api/v1/post/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.934', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (111, 'go-admin/app/admin/apis.SysUser.UpdatePwd-fm', '*用户修改密码', '/api/v1/user/pwd', 'SYS', 'PUT', '2021-05-13 19:59:05.987', '2021-06-13 20:53:51.724', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (112, 'go-admin/common/actions.DeleteAction.func1', '分类删除', '/api/v1/syscategory', 'BUS', 'DELETE', '2021-05-13 19:59:06.030', '2021-06-13 20:53:52.237', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (113, 'go-admin/common/actions.DeleteAction.func1', '内容删除', '/api/v1/syscontent', 'BUS', 'DELETE', '2021-05-13 19:59:06.076', '2021-06-13 20:53:52.278', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (114, 'go-admin/app/admin/apis.SysLoginLog.Delete-fm', '登录日志删除', '/api/v1/sys-login-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.118', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (115, 'go-admin/app/admin/apis.SysOperaLog.Delete-fm', '操作日志删除', '/api/v1/sys-opera-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.162', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (116, 'go-admin/common/actions.DeleteAction.func1', 'job删除', '/api/v1/sysjob', 'BUS', 'DELETE', '2021-05-13 19:59:06.206', '2021-06-13 20:53:52.323', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (117, 'go-admin/app/other/apis.SysChinaAreaData.Delete-fm', '行政区删除', '/api/v1/sys-area-data', 'BUS', 'DELETE', '2021-05-13 19:59:06.249', '2021-06-13 20:53:52.061', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (120, 'go-admin/app/admin/apis.SysDictData.Delete-fm', '字典数据删除', '/api/v1/dict/data', 'BUS', 'DELETE', '2021-05-13 19:59:06.387', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (121, 'go-admin/app/admin/apis.SysDictType.Delete-fm', '字典类型删除', '/api/v1/dict/type', 'BUS', 'DELETE', '2021-05-13 19:59:06.432', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (122, 'go-admin/app/admin/apis.SysDept.Delete-fm', '部门删除', '/api/v1/dept/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.475', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (123, 'go-admin/app/other/apis.SysFileDir.Delete-fm', '文件夹删除', '/api/v1/file-dir/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.520', '2021-06-13 20:53:52.539', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (124, 'go-admin/app/other/apis.SysFileInfo.Delete-fm', '文件删除', '/api/v1/file-info/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.566', '2021-06-13 20:53:52.580', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (125, 'go-admin/app/admin/apis.SysConfig.Delete-fm', '参数删除', '/api/v1/config', 'BUS', 'DELETE', '2021-05-13 19:59:06.612', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (126, 'go-admin/app/admin/apis.SysMenu.Delete-fm', '删除菜单', '/api/v1/menu', 'BUS', 'DELETE', '2021-05-13 19:59:06.654', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (127, 'go-admin/app/admin/apis.SysPost.Delete-fm', '岗位删除', '/api/v1/post/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.702', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (128, 'go-admin/app/admin/apis.SysRole.Delete-fm', '角色删除', '/api/v1/role', 'BUS', 'DELETE', '2021-05-13 19:59:06.746', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (131, 'github.com/go-admin-team/go-admin-core/tools/transfer.Handler.func1', '系统指标', '/api/v1/metrics', 'SYS', 'GET', '2021-05-17 22:13:55.933', '2021-06-13 20:53:49.614', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (132, 'go-admin/app/other/router.registerMonitorRouter.func1', '健康状态', '/api/v1/health', 'SYS', 'GET', '2021-05-17 22:13:56.285', '2021-06-13 20:53:49.951', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (133, 'go-admin/app/admin/apis.HelloWorld', '项目默认接口', '/', 'SYS', 'GET', '2021-05-24 10:30:44.553', '2021-06-13 20:53:47.406', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (134, 'go-admin/app/other/apis.ServerMonitor.ServerInfo-fm', '服务器基本状态', '/api/v1/server-monitor', 'SYS', 'GET', '2021-05-24 10:30:44.937', '2021-06-13 20:53:48.255', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (135, 'go-admin/app/admin/apis.SysApi.GetPage-fm', '接口列表', '/api/v1/sys-api', 'BUS', 'GET', '2021-05-24 11:37:53.303', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (136, 'go-admin/app/admin/apis.SysApi.Get-fm', '接口通过id获取', '/api/v1/sys-api/:id', 'BUS', 'GET', '2021-05-24 11:37:53.359', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (137, 'go-admin/app/admin/apis.SysLoginLog.GetPage-fm', '登录日志列表', '/api/v1/sys-login-log', 'BUS', 'GET', '2021-05-24 11:47:30.397', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (138, 'go-admin/app/other/apis.File.UploadFile-fm', '文件上传', '/api/v1/public/uploadFile', 'SYS', 'POST', '2021-05-25 19:16:18.493', '2021-06-13 20:53:50.866', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (139, 'go-admin/app/admin/apis.SysConfig.Update2Set-fm', '参数信息修改【参数配置】', '/api/v1/set-config', 'BUS', 'PUT', '2021-05-27 09:45:14.853', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (140, 'go-admin/app/admin/apis.SysConfig.Get2Set-fm', '参数获取全部【配置使用】', '/api/v1/set-config', 'BUS', 'GET', '2021-05-27 11:54:14.384', '2021-06-17 11:48:40.732', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (141, 'go-admin/app/admin/apis.SysUser.GetPage-fm', '管理员列表', '/api/v1/sys-user', 'BUS', 'GET', '2021-06-13 19:24:57.111', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (142, 'go-admin/app/admin/apis.SysUser.Get-fm', '管理员通过id获取', '/api/v1/sys-user/:id', 'BUS', 'GET', '2021-06-13 19:24:57.188', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (143, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesInfo-fm', '', '/api/v1/sys/tables/info', '', 'GET', '2021-06-13 19:24:57.437', '2021-06-13 20:53:48.047', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (144, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'GET', '2021-06-13 19:24:57.510', '2021-06-13 20:53:48.088', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (145, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTableList-fm', '', '/api/v1/sys/tables/page', '', 'GET', '2021-06-13 19:24:57.582', '2021-06-13 20:53:48.128', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (146, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'GET', '2021-06-13 19:24:59.641', '2021-06-13 20:53:50.081', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (147, 'github.com/swaggo/gin-swagger.CustomWrapHandler.func1', '', '/swagger/*any', '', 'GET', '2021-06-13 19:24:59.713', '2021-06-13 20:53:50.123', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (148, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'GET', '2021-06-13 19:24:59.914', '2021-06-13 20:53:50.295', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (149, 'go-admin/app/admin/apis/tools.(*SysTable).InsertSysTable-fm', '', '/api/v1/sys/tables/info', '', 'POST', '2021-06-13 19:25:00.163', '2021-06-13 20:53:50.539', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (150, 'go-admin/app/admin/apis.SysUser.Insert-fm', '管理员创建', '/api/v1/sys-user', 'BUS', 'POST', '2021-06-13 19:25:00.233', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (151, 'go-admin/app/admin/apis.SysUser.Update-fm', '管理员编辑', '/api/v1/sys-user', 'BUS', 'PUT', '2021-06-13 19:25:00.986', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (152, 'go-admin/app/admin/apis/tools.(*SysTable).UpdateSysTable-fm', '', '/api/v1/sys/tables/info', '', 'PUT', '2021-06-13 19:25:01.149', '2021-06-13 20:53:51.375', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (153, 'go-admin/app/admin/apis.SysRole.Update2Status-fm', '', '/api/v1/role-status', '', 'PUT', '2021-06-13 19:25:01.446', '2021-06-13 20:53:51.636', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (154, 'go-admin/app/admin/apis.SysUser.ResetPwd-fm', '', '/api/v1/user/pwd/reset', '', 'PUT', '2021-06-13 19:25:01.601', '2021-06-13 20:53:51.764', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (155, 'go-admin/app/admin/apis.SysUser.UpdateStatus-fm', '', '/api/v1/user/status', '', 'PUT', '2021-06-13 19:25:01.671', '2021-06-13 20:53:51.806', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (156, 'go-admin/app/admin/apis.SysUser.Delete-fm', '管理员删除', '/api/v1/sys-user', 'BUS', 'DELETE', '2021-06-13 19:25:02.043', '2021-06-17 20:31:14.318', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (157, 'go-admin/app/admin/apis/tools.(*SysTable).DeleteSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'DELETE', '2021-06-13 19:25:02.283', '2021-06-13 20:53:52.367', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (158, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'HEAD', '2021-06-13 19:25:02.734', '2021-06-13 20:53:52.791', NULL, 0, 0); -INSERT INTO `sys_api` VALUES (159, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'HEAD', '2021-06-13 19:25:02.808', '2021-06-13 20:53:52.838', NULL, 0, 0); +INSERT INTO sys_config VALUES (1, '皮肤样式', 'sys_index_skinName', 'skin-green', 'Y', '0', '主框架页-默认皮肤样式名称:蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 13:50:13.123', NULL); +INSERT INTO sys_config VALUES (2, '初始密码', 'sys_user_initPassword', '123456', 'Y', '0', '用户管理-账号初始密码:123456', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_config VALUES (3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_config VALUES (4, '系统名称', 'sys_app_name', 'go-admin管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2021-05-28 10:08:25.248', NULL); +INSERT INTO sys_config VALUES (5, '系统logo', 'sys_app_logo', 'https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); -INSERT INTO `sys_config` VALUES (1, '皮肤样式', 'sys_index_skinName', 'skin-green', 'Y', '0', '主框架页-默认皮肤样式名称:蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 13:50:13.123', NULL); -INSERT INTO `sys_config` VALUES (2, '初始密码', 'sys_user_initPassword', '123456', 'Y', '0', '用户管理-账号初始密码:123456', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_config` VALUES (3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_config` VALUES (4, '系统名称', 'sys_app_name', 'go-admin管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2021-05-28 10:08:25.248', NULL); -INSERT INTO `sys_config` VALUES (5, '系统logo', 'sys_app_logo', 'https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); +INSERT INTO sys_dept VALUES (1, 0, '/0/1/', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:06:44.960', NULL); +INSERT INTO sys_dept VALUES (7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', NULL); +INSERT INTO sys_dept VALUES (8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', NULL); +INSERT INTO sys_dept VALUES (9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', NULL); +INSERT INTO sys_dept VALUES (10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', '1', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', NULL); -INSERT INTO `sys_dept` VALUES (1, 0, '/0/1/', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:06:44.960', NULL); -INSERT INTO `sys_dept` VALUES (7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', NULL); -INSERT INTO `sys_dept` VALUES (8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', NULL); -INSERT INTO `sys_dept` VALUES (9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', NULL); -INSERT INTO `sys_dept` VALUES (10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', '1', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', NULL); +INSERT INTO sys_dict_data VALUES (1, 0, '正常', '2', 'sys_normal_disable', '', '', '', '2', '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', NULL); +INSERT INTO sys_dict_data VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', '2', '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', '2', '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (4, 0, '女', '1', 'sys_user_sex', '', '', '', '2', '', '性别女', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (5, 0, '未知', '2', 'sys_user_sex', '', '', '', '2', '', '性别未知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (6, 0, '显示', '0', 'sys_show_hide', '', '', '', '2', '', '显示菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (7, 0, '隐藏', '1', 'sys_show_hide', '', '', '', '2', '', '隐藏菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (8, 0, '是', 'Y', 'sys_yes_no', '', '', '', '2', '', '系统默认是', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (9, 0, '否', 'N', 'sys_yes_no', '', '', '', '2', '', '系统默认否', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (10, 0, '正常', '2', 'sys_job_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (11, 0, '停用', '1', 'sys_job_status', '', '', '', '2', '', '停用状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (12, 0, '默认', 'DEFAULT', 'sys_job_group', '', '', '', '2', '', '默认分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (13, 0, '系统', 'SYSTEM', 'sys_job_group', '', '', '', '2', '', '系统分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (14, 0, '通知', '1', 'sys_notice_type', '', '', '', '2', '', '通知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (15, 0, '公告', '2', 'sys_notice_type', '', '', '', '2', '', '公告', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (16, 0, '正常', '2', 'sys_common_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (17, 0, '关闭', '1', 'sys_common_status', '', '', '', '2', '', '关闭状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (18, 0, '新增', '1', 'sys_oper_type', '', '', '', '2', '', '新增操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (19, 0, '修改', '2', 'sys_oper_type', '', '', '', '2', '', '修改操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (20, 0, '删除', '3', 'sys_oper_type', '', '', '', '2', '', '删除操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (21, 0, '授权', '4', 'sys_oper_type', '', '', '', '2', '', '授权操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (22, 0, '导出', '5', 'sys_oper_type', '', '', '', '2', '', '导出操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (23, 0, '导入', '6', 'sys_oper_type', '', '', '', '2', '', '导入操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (24, 0, '强退', '7', 'sys_oper_type', '', '', '', '2', '', '强退操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (25, 0, '生成代码', '8', 'sys_oper_type', '', '', '', '2', '', '生成操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (26, 0, '清空数据', '9', 'sys_oper_type', '', '', '', '2', '', '清空操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (27, 0, '成功', '0', 'sys_notice_status', '', '', '', '2', '', '成功状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (28, 0, '失败', '1', 'sys_notice_status', '', '', '', '2', '', '失败状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (29, 0, '登录', '10', 'sys_oper_type', '', '', '', '2', '', '登录操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (30, 0, '退出', '11', 'sys_oper_type', '', '', '', '2', '', '', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', '2', '', '获取验证码', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (32, 0, '正常', '1', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); +INSERT INTO sys_dict_data VALUES (33, 1, '禁用', '2', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); -INSERT INTO `sys_dict_data` VALUES (1, 0, '正常', '2', 'sys_normal_disable', '', '', '', '2', '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', NULL); -INSERT INTO `sys_dict_data` VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', '2', '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', '2', '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (4, 0, '女', '1', 'sys_user_sex', '', '', '', '2', '', '性别女', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (5, 0, '未知', '2', 'sys_user_sex', '', '', '', '2', '', '性别未知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (6, 0, '显示', '0', 'sys_show_hide', '', '', '', '2', '', '显示菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (7, 0, '隐藏', '1', 'sys_show_hide', '', '', '', '2', '', '隐藏菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (8, 0, '是', 'Y', 'sys_yes_no', '', '', '', '2', '', '系统默认是', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (9, 0, '否', 'N', 'sys_yes_no', '', '', '', '2', '', '系统默认否', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (10, 0, '正常', '2', 'sys_job_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (11, 0, '停用', '1', 'sys_job_status', '', '', '', '2', '', '停用状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (12, 0, '默认', 'DEFAULT', 'sys_job_group', '', '', '', '2', '', '默认分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (13, 0, '系统', 'SYSTEM', 'sys_job_group', '', '', '', '2', '', '系统分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (14, 0, '通知', '1', 'sys_notice_type', '', '', '', '2', '', '通知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (15, 0, '公告', '2', 'sys_notice_type', '', '', '', '2', '', '公告', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (16, 0, '正常', '2', 'sys_common_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (17, 0, '关闭', '1', 'sys_common_status', '', '', '', '2', '', '关闭状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (18, 0, '新增', '1', 'sys_oper_type', '', '', '', '2', '', '新增操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (19, 0, '修改', '2', 'sys_oper_type', '', '', '', '2', '', '修改操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (20, 0, '删除', '3', 'sys_oper_type', '', '', '', '2', '', '删除操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (21, 0, '授权', '4', 'sys_oper_type', '', '', '', '2', '', '授权操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (22, 0, '导出', '5', 'sys_oper_type', '', '', '', '2', '', '导出操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (23, 0, '导入', '6', 'sys_oper_type', '', '', '', '2', '', '导入操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (24, 0, '强退', '7', 'sys_oper_type', '', '', '', '2', '', '强退操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (25, 0, '生成代码', '8', 'sys_oper_type', '', '', '', '2', '', '生成操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (26, 0, '清空数据', '9', 'sys_oper_type', '', '', '', '2', '', '清空操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (27, 0, '成功', '0', 'sys_notice_status', '', '', '', '2', '', '成功状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (28, 0, '失败', '1', 'sys_notice_status', '', '', '', '2', '', '失败状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (29, 0, '登录', '10', 'sys_oper_type', '', '', '', '2', '', '登录操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (30, 0, '退出', '11', 'sys_oper_type', '', '', '', '2', '', '', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', '2', '', '获取验证码', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_data` VALUES (32, 0, '正常', '1', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); -INSERT INTO `sys_dict_data` VALUES (33, 1, '禁用', '2', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); +INSERT INTO sys_dict_type VALUES (1, '系统开关', 'sys_normal_disable', '2', '系统开关列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (2, '用户性别', 'sys_user_sex', '2', '用户性别列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (3, '菜单状态', 'sys_show_hide', '2', '菜单状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (4, '系统是否', 'sys_yes_no', '2', '系统是否列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (5, '任务状态', 'sys_job_status', '2', '任务状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (6, '任务分组', 'sys_job_group', '2', '任务分组列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (7, '通知类型', 'sys_notice_type', '2', '通知类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (8, '系统状态', 'sys_common_status', '2', '登录状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (9, '操作类型', 'sys_oper_type', '2', '操作类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (10, '通知状态', 'sys_notice_status', '2', '通知状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (11, '内容状态', 'sys_content_status', '2', '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', NULL); -INSERT INTO `sys_dict_type` VALUES (1, '系统开关', 'sys_normal_disable', '2', '系统开关列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (2, '用户性别', 'sys_user_sex', '2', '用户性别列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (3, '菜单状态', 'sys_show_hide', '2', '菜单状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (4, '系统是否', 'sys_yes_no', '2', '系统是否列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (5, '任务状态', 'sys_job_status', '2', '任务状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (6, '任务分组', 'sys_job_group', '2', '任务分组列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', '2', '通知类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (8, '系统状态', 'sys_common_status', '2', '登录状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', '2', '操作类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (10, '通知状态', 'sys_notice_status', '2', '通知状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); -INSERT INTO `sys_dict_type` VALUES (11, '内容状态', 'sys_content_status', '2', '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', NULL); +INSERT INTO sys_job VALUES (1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', NULL, 1, 1); +INSERT INTO sys_job VALUES (2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', NULL, 1, 1); -INSERT INTO `sys_job` VALUES (1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', NULL, 1, 1); -INSERT INTO `sys_job` VALUES (2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', NULL, 1, 1); - -INSERT INTO `sys_menu` VALUES (2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (44, '', '查询管理员', 'app-group-fill', '', '/0/2/3/44', 'F', 'GET', 'admin:sysUser:query', 3, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (45, '', '修改管理员', 'app-group-fill', '', '/0/2/3/45', 'F', 'PUT', 'admin:sysUser:edit', 3, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (46, '', '删除管理员', 'app-group-fill', '', '/0/2/3/46', 'F', 'DELETE', 'admin:sysUser:remove', 3, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); -INSERT INTO `sys_menu` VALUES (51, 'SysMenuManage', '菜单管理', 'tree-table', '/admin/sys-menu', '/0/2/51', 'C', '无', 'admin:sysMenu:list', 2, 1, '', '/admin/sys-menu/index', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (52, 'SysRoleManage', '角色管理', 'peoples', '/admin/sys-role', '/0/2/52', 'C', '无', 'admin:sysRole:list', 2, 1, '', '/admin/sys-role/index', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (56, 'SysDeptManage', '部门管理', 'tree', '/admin/sys-dept', '/0/2/56', 'C', '无', 'admin:sysDept:list', 2, 0, '', '/admin/sys-dept/index', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (57, 'SysPostManage', '岗位管理', 'pass', '/admin/sys-post', '/0/2/57', 'C', '无', 'admin:sysPost:list', 2, 0, '', '/admin/sys-post/index', 50, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (58, 'Dict', '字典管理', 'education', '/admin/dict', '/0/2/58', 'C', '无', 'admin:sysDictType:list', 2, 0, '', '/admin/dict/index', 60, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (59, 'SysDictDataManage', '字典数据', 'education', '/admin/dict/data/:dictId', '/0/2/59', 'C', '无', 'admin:sysDictData:list', 2, 0, '', '/admin/dict/data', 100, '1', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (60, 'Tools', '开发工具', 'dev-tools', '/dev-tools', '/0/60', 'M', '无', '', 0, 0, '', 'Layout', 40, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (61, 'Swagger', '系统接口', 'guide', '/dev-tools/swagger', '/0/60/61', 'C', '无', '', 60, 0, '', '/dev-tools/swagger/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (62, 'SysConfigManage', '参数管理', 'swagger', '/admin/sys-config', '/0/2/62', 'C', '无', 'admin:sysConfig:list', 2, 0, '', '/admin/sys-config/index', 70, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (211, 'Log', '日志管理', 'log', '/log', '/0/2/211', 'M', '', '', 2, 0, '', '/log/index', 80, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (212, 'SysLoginLogManage', '登录日志', 'logininfor', '/admin/sys-login-log', '/0/2/211/212', 'C', '', 'admin:sysLoginLog:list', 211, 0, '', '/admin/sys-login-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (216, 'OperLog', '操作日志', 'skill', '/admin/sys-oper-log', '/0/2/211/216', 'C', '', 'admin:sysOperLog:list', 211, 0, '', '/admin/sys-oper-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (220, '', '新增菜单', 'app-group-fill', '', '/0/2/51/220', 'F', '', 'admin:sysMenu:add', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (221, '', '修改菜单', 'app-group-fill', '', '/0/2/51/221', 'F', '', 'admin:sysMenu:edit', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (222, '', '查询菜单', 'app-group-fill', '', '/0/2/51/222', 'F', '', 'admin:sysMenu:query', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (223, '', '删除菜单', 'app-group-fill', '', '/0/2/51/223', 'F', '', 'admin:sysMenu:remove', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (224, '', '新增角色', 'app-group-fill', '', '/0/2/52/224', 'F', '', 'admin:sysRole:add', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (225, '', '查询角色', 'app-group-fill', '', '/0/2/52/225', 'F', '', 'admin:sysRole:query', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (226, '', '修改角色', 'app-group-fill', '', '/0/2/52/226', 'F', '', 'admin:sysRole:update', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (227, '', '删除角色', 'app-group-fill', '', '/0/2/52/227', 'F', '', 'admin:sysRole:remove', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (228, '', '查询部门', 'app-group-fill', '', '/0/2/56/228', 'F', '', 'admin:sysDept:query', 56, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (229, '', '新增部门', 'app-group-fill', '', '/0/2/56/229', 'F', '', 'admin:sysDept:add', 56, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (230, '', '修改部门', 'app-group-fill', '', '/0/2/56/230', 'F', '', 'admin:sysDept:edit', 56, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (231, '', '删除部门', 'app-group-fill', '', '/0/2/56/231', 'F', '', 'admin:sysDept:remove', 56, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (232, '', '查询岗位', 'app-group-fill', '', '/0/2/57/232', 'F', '', 'admin:sysPost:query', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (233, '', '新增岗位', 'app-group-fill', '', '/0/2/57/233', 'F', '', 'admin:sysPost:add', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (234, '', '修改岗位', 'app-group-fill', '', '/0/2/57/234', 'F', '', 'admin:sysPost:edit', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (235, '', '删除岗位', 'app-group-fill', '', '/0/2/57/235', 'F', '', 'admin:sysPost:remove', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (236, '', '查询字典', 'app-group-fill', '', '/0/2/58/236', 'F', '', 'admin:sysDictType:query', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (237, '', '新增类型', 'app-group-fill', '', '/0/2/58/237', 'F', '', 'admin:sysDictType:add', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (238, '', '修改类型', 'app-group-fill', '', '/0/2/58/238', 'F', '', 'admin:sysDictType:edit', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (239, '', '删除类型', 'app-group-fill', '', '/0/2/58/239', 'F', '', 'system:sysdicttype:remove', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (240, '', '查询数据', 'app-group-fill', '', '/0/2/59/240', 'F', '', 'admin:sysDictData:query', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (241, '', '新增数据', 'app-group-fill', '', '/0/2/59/241', 'F', '', 'admin:sysDictData:add', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (242, '', '修改数据', 'app-group-fill', '', '/0/2/59/242', 'F', '', 'admin:sysDictData:edit', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (243, '', '删除数据', 'app-group-fill', '', '/0/2/59/243', 'F', '', 'admin:sysDictData:remove', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (244, '', '查询参数', 'app-group-fill', '', '/0/2/62/244', 'F', '', 'admin:sysConfig:query', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (245, '', '新增参数', 'app-group-fill', '', '/0/2/62/245', 'F', '', 'admin:sysConfig:add', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (246, '', '修改参数', 'app-group-fill', '', '/0/2/62/246', 'F', '', 'admin:sysConfig:edit', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (247, '', '删除参数', 'app-group-fill', '', '/0/2/62/247', 'F', '', 'admin:sysConfig:remove', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (248, '', '查询登录日志', 'app-group-fill', '', '/0/2/211/212/248', 'F', '', 'admin:sysLoginLog:query', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (249, '', '删除登录日志', 'app-group-fill', '', '/0/2/211/212/249', 'F', '', 'admin:sysLoginLog:remove', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (250, '', '查询操作日志', 'app-group-fill', '', '/0/2/211/216/250', 'F', '', 'admin:sysOperLog:query', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (251, '', '删除操作日志', 'app-group-fill', '', '/0/2/211/216/251', 'F', '', 'admin:sysOperLog:remove', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (261, 'Gen', '代码生成', 'code', '/dev-tools/gen', '/0/60/261', 'C', '', '', 60, 0, '', '/dev-tools/gen/index', 2, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (262, 'EditTable', '代码生成修改', 'build', '/dev-tools/editTable', '/0/60/262', 'C', '', '', 60, 0, '', '/dev-tools/gen/editTable', 100, '1', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (264, 'Build', '表单构建', 'build', '/dev-tools/build', '/0/60/264', 'C', '', '', 60, 0, '', '/dev-tools/build/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (269, 'ServerMonitor', '服务监控', 'druid', '/sys-tools/monitor', '/0/60/269', 'C', '', 'sysTools:serverMonitor:list', 537, 0, '', '/sys-tools/monitor', 0, '0', '1', 1, 1, '2020-04-14 00:28:19.000', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (459, 'Schedule', '定时任务', 'time-range', '/schedule', '/0/459', 'M', '无', '', 0, 0, '', 'Layout', 20, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (460, 'ScheduleManage', 'Schedule', 'job', '/schedule/manage', '/0/459/460', 'C', '无', 'job:sysJob:list', 459, 0, '', '/schedule/index', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (461, 'sys_job', '分页获取定时任务', 'app-group-fill', '', '/0/459/460/461', 'F', '无', 'job:sysJob:query', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (462, 'sys_job', '创建定时任务', 'app-group-fill', '', '/0/459/460/462', 'F', '无', 'job:sysJob:add', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (463, 'sys_job', '修改定时任务', 'app-group-fill', '', '/0/459/460/463', 'F', '无', 'job:sysJob:edit', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (464, 'sys_job', '删除定时任务', 'app-group-fill', '', '/0/459/460/464', 'F', '无', 'job:sysJob:remove', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (471, 'JobLog', '日志', 'bug', '/schedule/log', '/0/459/471', 'C', '', '', 459, 0, '', '/schedule/log', 0, '1', '1', 1, 1, '2020-08-05 21:24:46.000', '2021-06-05 22:15:03.465', NULL); -INSERT INTO `sys_menu` VALUES (528, 'SysApiManage', '接口管理', 'api-doc', '/admin/sys-api', '/0/527/528', 'C', '无', 'admin:sysApi:list', 2, 0, '', '/admin/sys-api/index', 0, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (529, '', '查询接口', 'app-group-fill', '', '/0/527/528/529', 'F', '无', 'admin:sysApi:query', 528, 0, '', '', 40, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (531, '', '修改接口', 'app-group-fill', '', '/0/527/528/531', 'F', '无', 'admin:sysApi:edit', 528, 0, '', '', 30, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (537, 'SysTools', '系统工具', 'system-tools', '/sys-tools', '', 'M', '', '', 0, 0, '', 'Layout', 30, '0', '1', 1, 1, '2021-05-21 11:13:32.166', '2021-06-16 21:26:12.446', NULL); -INSERT INTO `sys_menu` VALUES (540, 'SysConfigSet', '参数设置', 'system-tools', '/admin/sys-config/set', '', 'C', '', 'admin:sysConfigSet:list', 2, 0, '', '/admin/sys-config/set', 0, '0', '1', 1, 1, '2021-05-25 16:06:52.560', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu` VALUES (542, '', '修改', 'upload', '', '', 'F', '', 'admin:sysConfigSet:update', 540, 0, '', '', 0, '0', '1', 1, 1, '2021-06-13 11:45:48.670', '2021-06-17 11:48:40.703', NULL); -INSERT INTO `sys_menu_api_rule` VALUES (216, 6); -INSERT INTO `sys_menu_api_rule` VALUES (250, 6); -INSERT INTO `sys_menu_api_rule` VALUES (58, 21); -INSERT INTO `sys_menu_api_rule` VALUES (236, 21); -INSERT INTO `sys_menu_api_rule` VALUES (238, 23); -INSERT INTO `sys_menu_api_rule` VALUES (59, 24); -INSERT INTO `sys_menu_api_rule` VALUES (240, 24); -INSERT INTO `sys_menu_api_rule` VALUES (242, 25); -INSERT INTO `sys_menu_api_rule` VALUES (58, 26); -INSERT INTO `sys_menu_api_rule` VALUES (236, 26); -INSERT INTO `sys_menu_api_rule` VALUES (56, 27); -INSERT INTO `sys_menu_api_rule` VALUES (228, 27); -INSERT INTO `sys_menu_api_rule` VALUES (230, 28); -INSERT INTO `sys_menu_api_rule` VALUES (226, 29); -INSERT INTO `sys_menu_api_rule` VALUES (51, 39); -INSERT INTO `sys_menu_api_rule` VALUES (51, 135); -INSERT INTO `sys_menu_api_rule` VALUES (222, 39); -INSERT INTO `sys_menu_api_rule` VALUES (221, 41); -INSERT INTO `sys_menu_api_rule` VALUES (52, 44); -INSERT INTO `sys_menu_api_rule` VALUES (225, 44); -INSERT INTO `sys_menu_api_rule` VALUES (226, 45); -INSERT INTO `sys_menu_api_rule` VALUES (226, 46); -INSERT INTO `sys_menu_api_rule` VALUES (226, 47); -INSERT INTO `sys_menu_api_rule` VALUES (62, 53); -INSERT INTO `sys_menu_api_rule` VALUES (244, 53); -INSERT INTO `sys_menu_api_rule` VALUES (246, 54); -INSERT INTO `sys_menu_api_rule` VALUES (57, 59); -INSERT INTO `sys_menu_api_rule` VALUES (232, 59); -INSERT INTO `sys_menu_api_rule` VALUES (234, 60); -INSERT INTO `sys_menu_api_rule` VALUES (241, 80); -INSERT INTO `sys_menu_api_rule` VALUES (237, 81); -INSERT INTO `sys_menu_api_rule` VALUES (229, 82); -INSERT INTO `sys_menu_api_rule` VALUES (245, 87); -INSERT INTO `sys_menu_api_rule` VALUES (220, 88); -INSERT INTO `sys_menu_api_rule` VALUES (233, 89); -INSERT INTO `sys_menu_api_rule` VALUES (224, 90); -INSERT INTO `sys_menu_api_rule` VALUES (531, 92); -INSERT INTO `sys_menu_api_rule` VALUES (242, 101); -INSERT INTO `sys_menu_api_rule` VALUES (238, 102); -INSERT INTO `sys_menu_api_rule` VALUES (230, 103); -INSERT INTO `sys_menu_api_rule` VALUES (226, 106); -INSERT INTO `sys_menu_api_rule` VALUES (226, 107); -INSERT INTO `sys_menu_api_rule` VALUES (246, 108); -INSERT INTO `sys_menu_api_rule` VALUES (221, 109); -INSERT INTO `sys_menu_api_rule` VALUES (234, 110); -INSERT INTO `sys_menu_api_rule` VALUES (249, 114); -INSERT INTO `sys_menu_api_rule` VALUES (251, 115); -INSERT INTO `sys_menu_api_rule` VALUES (243, 120); -INSERT INTO `sys_menu_api_rule` VALUES (239, 121); -INSERT INTO `sys_menu_api_rule` VALUES (231, 122); -INSERT INTO `sys_menu_api_rule` VALUES (247, 125); -INSERT INTO `sys_menu_api_rule` VALUES (223, 126); -INSERT INTO `sys_menu_api_rule` VALUES (235, 127); -INSERT INTO `sys_menu_api_rule` VALUES (227, 128); -INSERT INTO `sys_menu_api_rule` VALUES (528, 135); -INSERT INTO `sys_menu_api_rule` VALUES (529, 135); -INSERT INTO `sys_menu_api_rule` VALUES (531, 136); -INSERT INTO `sys_menu_api_rule` VALUES (212, 137); -INSERT INTO `sys_menu_api_rule` VALUES (248, 137); -INSERT INTO `sys_menu_api_rule` VALUES (542, 139); -INSERT INTO `sys_menu_api_rule` VALUES (540, 140); -INSERT INTO `sys_menu_api_rule` VALUES (3, 141); -INSERT INTO `sys_menu_api_rule` VALUES (44, 141); -INSERT INTO `sys_menu_api_rule` VALUES (45, 142); -INSERT INTO `sys_menu_api_rule` VALUES (43, 150); -INSERT INTO `sys_menu_api_rule` VALUES (45, 151); -INSERT INTO `sys_menu_api_rule` VALUES (46, 156); -INSERT INTO `sys_post` VALUES (1, '首席执行官', 'CEO', 0, '2','首席执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_post` VALUES (2, '首席技术执行官', 'CTO', 2, '2','首席技术执行官', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_post` VALUES (3, '首席运营官', 'COO', 3, '2','测试工程师', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_role` VALUES (1, '系统管理员', '2', 'admin', 1, '', '', 1, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); -INSERT INTO `sys_user` VALUES (1, 'admin', '$2a$10$/Glr4g9Svr6O0kvjsRJCXu3f0W8/dsP3XZyVNi1019ratWpSPMyw.', 'zhangwj', '13818888888', 1, '', '', '1', '1@qq.com', 1, 1, '', '2', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.205', NULL); - -SET FOREIGN_KEY_CHECKS = 1; - --- 数据完成 ; +INSERT INTO sys_menu VALUES (2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (44, '', '查询管理员', 'app-group-fill', '', '/0/2/3/44', 'F', 'GET', 'admin:sysUser:query', 3, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (45, '', '修改管理员', 'app-group-fill', '', '/0/2/3/45', 'F', 'PUT', 'admin:sysUser:edit', 3, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (46, '', '删除管理员', 'app-group-fill', '', '/0/2/3/46', 'F', 'DELETE', 'admin:sysUser:remove', 3, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL); +INSERT INTO sys_menu VALUES (51, 'SysMenuManage', '菜单管理', 'tree-table', '/admin/sys-menu', '/0/2/51', 'C', '无', 'admin:sysMenu:list', 2, 1, '', '/admin/sys-menu/index', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (52, 'SysRoleManage', '角色管理', 'peoples', '/admin/sys-role', '/0/2/52', 'C', '无', 'admin:sysRole:list', 2, 1, '', '/admin/sys-role/index', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (56, 'SysDeptManage', '部门管理', 'tree', '/admin/sys-dept', '/0/2/56', 'C', '无', 'admin:sysDept:list', 2, 0, '', '/admin/sys-dept/index', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (57, 'SysPostManage', '岗位管理', 'pass', '/admin/sys-post', '/0/2/57', 'C', '无', 'admin:sysPost:list', 2, 0, '', '/admin/sys-post/index', 50, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (58, 'Dict', '字典管理', 'education', '/admin/dict', '/0/2/58', 'C', '无', 'admin:sysDictType:list', 2, 0, '', '/admin/dict/index', 60, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (59, 'SysDictDataManage', '字典数据', 'education', '/admin/dict/data/:dictId', '/0/2/59', 'C', '无', 'admin:sysDictData:list', 2, 0, '', '/admin/dict/data', 100, '1', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (60, 'Tools', '开发工具', 'dev-tools', '/dev-tools', '/0/60', 'M', '无', '', 0, 0, '', 'Layout', 40, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (61, 'Swagger', '系统接口', 'guide', '/dev-tools/swagger', '/0/60/61', 'C', '无', '', 60, 0, '', '/dev-tools/swagger/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (62, 'SysConfigManage', '参数管理', 'swagger', '/admin/sys-config', '/0/2/62', 'C', '无', 'admin:sysConfig:list', 2, 0, '', '/admin/sys-config/index', 70, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (211, 'Log', '日志管理', 'log', '/log', '/0/2/211', 'M', '', '', 2, 0, '', '/log/index', 80, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (212, 'SysLoginLogManage', '登录日志', 'logininfor', '/admin/sys-login-log', '/0/2/211/212', 'C', '', 'admin:sysLoginLog:list', 211, 0, '', '/admin/sys-login-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (216, 'OperLog', '操作日志', 'skill', '/admin/sys-oper-log', '/0/2/211/216', 'C', '', 'admin:sysOperLog:list', 211, 0, '', '/admin/sys-oper-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (220, '', '新增菜单', 'app-group-fill', '', '/0/2/51/220', 'F', '', 'admin:sysMenu:add', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (221, '', '修改菜单', 'app-group-fill', '', '/0/2/51/221', 'F', '', 'admin:sysMenu:edit', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (222, '', '查询菜单', 'app-group-fill', '', '/0/2/51/222', 'F', '', 'admin:sysMenu:query', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (223, '', '删除菜单', 'app-group-fill', '', '/0/2/51/223', 'F', '', 'admin:sysMenu:remove', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (224, '', '新增角色', 'app-group-fill', '', '/0/2/52/224', 'F', '', 'admin:sysRole:add', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (225, '', '查询角色', 'app-group-fill', '', '/0/2/52/225', 'F', '', 'admin:sysRole:query', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (226, '', '修改角色', 'app-group-fill', '', '/0/2/52/226', 'F', '', 'admin:sysRole:update', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (227, '', '删除角色', 'app-group-fill', '', '/0/2/52/227', 'F', '', 'admin:sysRole:remove', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (228, '', '查询部门', 'app-group-fill', '', '/0/2/56/228', 'F', '', 'admin:sysDept:query', 56, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (229, '', '新增部门', 'app-group-fill', '', '/0/2/56/229', 'F', '', 'admin:sysDept:add', 56, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (230, '', '修改部门', 'app-group-fill', '', '/0/2/56/230', 'F', '', 'admin:sysDept:edit', 56, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (231, '', '删除部门', 'app-group-fill', '', '/0/2/56/231', 'F', '', 'admin:sysDept:remove', 56, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (232, '', '查询岗位', 'app-group-fill', '', '/0/2/57/232', 'F', '', 'admin:sysPost:query', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (233, '', '新增岗位', 'app-group-fill', '', '/0/2/57/233', 'F', '', 'admin:sysPost:add', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (234, '', '修改岗位', 'app-group-fill', '', '/0/2/57/234', 'F', '', 'admin:sysPost:edit', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (235, '', '删除岗位', 'app-group-fill', '', '/0/2/57/235', 'F', '', 'admin:sysPost:remove', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (236, '', '查询字典', 'app-group-fill', '', '/0/2/58/236', 'F', '', 'admin:sysDictType:query', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (237, '', '新增类型', 'app-group-fill', '', '/0/2/58/237', 'F', '', 'admin:sysDictType:add', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (238, '', '修改类型', 'app-group-fill', '', '/0/2/58/238', 'F', '', 'admin:sysDictType:edit', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (239, '', '删除类型', 'app-group-fill', '', '/0/2/58/239', 'F', '', 'system:sysdicttype:remove', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (240, '', '查询数据', 'app-group-fill', '', '/0/2/59/240', 'F', '', 'admin:sysDictData:query', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (241, '', '新增数据', 'app-group-fill', '', '/0/2/59/241', 'F', '', 'admin:sysDictData:add', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (242, '', '修改数据', 'app-group-fill', '', '/0/2/59/242', 'F', '', 'admin:sysDictData:edit', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (243, '', '删除数据', 'app-group-fill', '', '/0/2/59/243', 'F', '', 'admin:sysDictData:remove', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (244, '', '查询参数', 'app-group-fill', '', '/0/2/62/244', 'F', '', 'admin:sysConfig:query', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (245, '', '新增参数', 'app-group-fill', '', '/0/2/62/245', 'F', '', 'admin:sysConfig:add', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (246, '', '修改参数', 'app-group-fill', '', '/0/2/62/246', 'F', '', 'admin:sysConfig:edit', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (247, '', '删除参数', 'app-group-fill', '', '/0/2/62/247', 'F', '', 'admin:sysConfig:remove', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (248, '', '查询登录日志', 'app-group-fill', '', '/0/2/211/212/248', 'F', '', 'admin:sysLoginLog:query', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (249, '', '删除登录日志', 'app-group-fill', '', '/0/2/211/212/249', 'F', '', 'admin:sysLoginLog:remove', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (250, '', '查询操作日志', 'app-group-fill', '', '/0/2/211/216/250', 'F', '', 'admin:sysOperLog:query', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (251, '', '删除操作日志', 'app-group-fill', '', '/0/2/211/216/251', 'F', '', 'admin:sysOperLog:remove', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (261, 'Gen', '代码生成', 'code', '/dev-tools/gen', '/0/60/261', 'C', '', '', 60, 0, '', '/dev-tools/gen/index', 2, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (262, 'EditTable', '代码生成修改', 'build', '/dev-tools/editTable', '/0/60/262', 'C', '', '', 60, 0, '', '/dev-tools/gen/editTable', 100, '1', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (264, 'Build', '表单构建', 'build', '/dev-tools/build', '/0/60/264', 'C', '', '', 60, 0, '', '/dev-tools/build/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (269, 'ServerMonitor', '服务监控', 'druid', '/sys-tools/monitor', '/0/60/269', 'C', '', 'sysTools:serverMonitor:list', 537, 0, '', '/sys-tools/monitor', 0, '0', '1', 1, 1, '2020-04-14 00:28:19.000', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (459, 'Schedule', '定时任务', 'time-range', '/schedule', '/0/459', 'M', '无', '', 0, 0, '', 'Layout', 20, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (460, 'ScheduleManage', 'Schedule', 'job', '/schedule/manage', '/0/459/460', 'C', '无', 'job:sysJob:list', 459, 0, '', '/schedule/index', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (461, 'sys_job', '分页获取定时任务', 'app-group-fill', '', '/0/459/460/461', 'F', '无', 'job:sysJob:query', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (462, 'sys_job', '创建定时任务', 'app-group-fill', '', '/0/459/460/462', 'F', '无', 'job:sysJob:add', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (463, 'sys_job', '修改定时任务', 'app-group-fill', '', '/0/459/460/463', 'F', '无', 'job:sysJob:edit', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (464, 'sys_job', '删除定时任务', 'app-group-fill', '', '/0/459/460/464', 'F', '无', 'job:sysJob:remove', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (471, 'JobLog', '日志', 'bug', '/schedule/log', '/0/459/471', 'C', '', '', 459, 0, '', '/schedule/log', 0, '1', '1', 1, 1, '2020-08-05 21:24:46.000', '2021-06-05 22:15:03.465', NULL); +INSERT INTO sys_menu VALUES (528, 'SysApiManage', '接口管理', 'api-doc', '/admin/sys-api', '/0/527/528', 'C', '无', 'admin:sysApi:list', 2, 0, '', '/admin/sys-api/index', 0, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (529, '', '查询接口', 'app-group-fill', '', '/0/527/528/529', 'F', '无', 'admin:sysApi:query', 528, 0, '', '', 40, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (531, '', '修改接口', 'app-group-fill', '', '/0/527/528/531', 'F', '无', 'admin:sysApi:edit', 528, 0, '', '', 30, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (537, 'SysTools', '系统工具', 'system-tools', '/sys-tools', '', 'M', '', '', 0, 0, '', 'Layout', 30, '0', '1', 1, 1, '2021-05-21 11:13:32.166', '2021-06-16 21:26:12.446', NULL); +INSERT INTO sys_menu VALUES (540, 'SysConfigSet', '参数设置', 'system-tools', '/admin/sys-config/set', '', 'C', '', 'admin:sysConfigSet:list', 2, 0, '', '/admin/sys-config/set', 0, '0', '1', 1, 1, '2021-05-25 16:06:52.560', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu VALUES (542, '', '修改', 'upload', '', '', 'F', '', 'admin:sysConfigSet:update', 540, 0, '', '', 0, '0', '1', 1, 1, '2021-06-13 11:45:48.670', '2021-06-17 11:48:40.703', NULL); +INSERT INTO sys_menu_api_rule VALUES (216, 6); +INSERT INTO sys_menu_api_rule VALUES (250, 6); +INSERT INTO sys_menu_api_rule VALUES (58, 21); +INSERT INTO sys_menu_api_rule VALUES (236, 21); +INSERT INTO sys_menu_api_rule VALUES (238, 23); +INSERT INTO sys_menu_api_rule VALUES (59, 24); +INSERT INTO sys_menu_api_rule VALUES (240, 24); +INSERT INTO sys_menu_api_rule VALUES (242, 25); +INSERT INTO sys_menu_api_rule VALUES (58, 26); +INSERT INTO sys_menu_api_rule VALUES (236, 26); +INSERT INTO sys_menu_api_rule VALUES (56, 27); +INSERT INTO sys_menu_api_rule VALUES (228, 27); +INSERT INTO sys_menu_api_rule VALUES (230, 28); +INSERT INTO sys_menu_api_rule VALUES (226, 29); +INSERT INTO sys_menu_api_rule VALUES (51, 39); +INSERT INTO sys_menu_api_rule VALUES (51, 135); +INSERT INTO sys_menu_api_rule VALUES (222, 39); +INSERT INTO sys_menu_api_rule VALUES (221, 41); +INSERT INTO sys_menu_api_rule VALUES (52, 44); +INSERT INTO sys_menu_api_rule VALUES (225, 44); +INSERT INTO sys_menu_api_rule VALUES (226, 45); +INSERT INTO sys_menu_api_rule VALUES (226, 46); +INSERT INTO sys_menu_api_rule VALUES (226, 47); +INSERT INTO sys_menu_api_rule VALUES (62, 53); +INSERT INTO sys_menu_api_rule VALUES (244, 53); +INSERT INTO sys_menu_api_rule VALUES (246, 54); +INSERT INTO sys_menu_api_rule VALUES (57, 59); +INSERT INTO sys_menu_api_rule VALUES (232, 59); +INSERT INTO sys_menu_api_rule VALUES (234, 60); +INSERT INTO sys_menu_api_rule VALUES (241, 80); +INSERT INTO sys_menu_api_rule VALUES (237, 81); +INSERT INTO sys_menu_api_rule VALUES (229, 82); +INSERT INTO sys_menu_api_rule VALUES (245, 87); +INSERT INTO sys_menu_api_rule VALUES (220, 88); +INSERT INTO sys_menu_api_rule VALUES (233, 89); +INSERT INTO sys_menu_api_rule VALUES (224, 90); +INSERT INTO sys_menu_api_rule VALUES (531, 92); +INSERT INTO sys_menu_api_rule VALUES (242, 101); +INSERT INTO sys_menu_api_rule VALUES (238, 102); +INSERT INTO sys_menu_api_rule VALUES (230, 103); +INSERT INTO sys_menu_api_rule VALUES (226, 106); +INSERT INTO sys_menu_api_rule VALUES (226, 107); +INSERT INTO sys_menu_api_rule VALUES (246, 108); +INSERT INTO sys_menu_api_rule VALUES (221, 109); +INSERT INTO sys_menu_api_rule VALUES (234, 110); +INSERT INTO sys_menu_api_rule VALUES (249, 114); +INSERT INTO sys_menu_api_rule VALUES (251, 115); +INSERT INTO sys_menu_api_rule VALUES (243, 120); +INSERT INTO sys_menu_api_rule VALUES (239, 121); +INSERT INTO sys_menu_api_rule VALUES (231, 122); +INSERT INTO sys_menu_api_rule VALUES (247, 125); +INSERT INTO sys_menu_api_rule VALUES (223, 126); +INSERT INTO sys_menu_api_rule VALUES (235, 127); +INSERT INTO sys_menu_api_rule VALUES (227, 128); +INSERT INTO sys_menu_api_rule VALUES (528, 135); +INSERT INTO sys_menu_api_rule VALUES (529, 135); +INSERT INTO sys_menu_api_rule VALUES (531, 136); +INSERT INTO sys_menu_api_rule VALUES (212, 137); +INSERT INTO sys_menu_api_rule VALUES (248, 137); +INSERT INTO sys_menu_api_rule VALUES (542, 139); +INSERT INTO sys_menu_api_rule VALUES (540, 140); +INSERT INTO sys_menu_api_rule VALUES (3, 141); +INSERT INTO sys_menu_api_rule VALUES (44, 141); +INSERT INTO sys_menu_api_rule VALUES (45, 142); +INSERT INTO sys_menu_api_rule VALUES (43, 150); +INSERT INTO sys_menu_api_rule VALUES (45, 151); +INSERT INTO sys_menu_api_rule VALUES (46, 156); +INSERT INTO sys_post VALUES (1, '首席执行官', 'CEO', 0, '2','首席执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_post VALUES (2, '首席技术执行官', 'CTO', 2, '2','首席技术执行官', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_post VALUES (3, '首席运营官', 'COO', 3, '2','测试工程师', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_role VALUES (1, '系统管理员', '2', 'admin', 1, '', '', 1, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_user VALUES (1, 'admin', '$2a$10$/Glr4g9Svr6O0kvjsRJCXu3f0W8/dsP3XZyVNi1019ratWpSPMyw.', 'zhangwj', '13818888888', 1, '', '', '1', '1@qq.com', 1, 1, '', '2', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.205', NULL); +-- 数据完成 ; \ No newline at end of file diff --git a/go-admin-db.db b/go-admin-db.db new file mode 100644 index 0000000000000000000000000000000000000000..b09e1fa7fc52aa399bcf18864121544710679fea GIT binary patch literal 319488 zcmeI53v?XUdEW;lzy*kXh@xqjl4va@@i8Jm>Puov?2GNYX^MX<5lRNl(-Cq)ktIdg7iotwWIFNgUVB zX`0rl+wYs%xiho7GXN7;N;iKT>2l|OGjqTDyWjoph+?w{Bt)3M((-2Pv5SUi|To;cs^HOspkrn zQgf+X&o!$>rJ?5LRvejIr%%pIot}x#9y>JiNHp*HNIrV}STyf=Fuyl1-j|o38Q&5Z zx&8LOkL_wGb0yVrpX1|=t+Gx}-FIZh{j%uZys2eQE9RqGxuGtowb8usGIv(%wz9IM z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fhb%uaQzy+0qFVp$5B`HY-SxxVK( zkDT<2qn!sH+@{Vt8PiIklNoqi=kJSp7=J8FlU(mX$|2ToIY!?1I(`GM)h$n%zl8U- z?~-rx`XxLsfycH$K1Mb++fhnW;nF zqN$0P{kyMg$@SY8TBj|3TH5j^ob$AWmzETip}#ERy;0(n>)YpfKW^9BVH;yVPDDb? zkd3+j+qoa-69CC3Vp*R}oVY`-Z&gV*I;6d3fXfJgwCUCv0P)c(lb(oq#{X#t(;@%A DVu9aO literal 0 HcmV?d00001 From e9f36e74ca528816db0e573b6bf7378bf5e1537b Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sat, 22 Jan 2022 19:44:36 +0800 Subject: [PATCH 034/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/global/adm.go b/common/global/adm.go index 651c63cc9..22da11c8d 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,11 +2,11 @@ package global const ( // Version go-admin version info - Version = "2.0.6" + Version = "2.0.8" ) var ( Source string Driver string DBName string -) \ No newline at end of file +) From b76db481129d755f7b89c994c2b5781532844226 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sat, 22 Jan 2022 21:49:11 +0800 Subject: [PATCH 035/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E9=92=88=E5=AF=B9sqlite3=E7=9A=84=E4=BA=8B=E5=8A=A1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_role.go | 100 ++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index ab374822d..d5879a3d9 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -2,6 +2,7 @@ package service import ( "errors" + "github.com/go-admin-team/go-admin-core/sdk/config" "gorm.io/gorm/clause" "github.com/casbin/casbin/v2" @@ -71,14 +72,17 @@ func (e *SysRole) Insert(c *dto.SysRoleInsertReq, cb *casbin.SyncedEnforcer) err } c.SysMenu = dataMenu c.Generate(&data) - tx := e.Orm.Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx := e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } err = tx.Create(&data).Error if err != nil { @@ -108,14 +112,17 @@ func (e *SysRole) Insert(c *dto.SysRoleInsertReq, cb *casbin.SyncedEnforcer) err // Update 修改SysRole对象 func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) error { var err error - tx := e.Orm.Debug().Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx := e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } var model = models.SysRole{} var mlist = make([]models.SysMenu, 0) tx.Preload("SysMenu").First(&model, c.GetId()) @@ -142,7 +149,7 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err e.Log.Errorf("delete policy error:%s", err) return err } - mp:=make(map [string] interface{} ,0) + mp := make(map[string]interface{}, 0) polices := make([][]string, 0) for _, menu := range mlist { for _, api := range menu.SysApi { @@ -164,14 +171,17 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err // Remove 删除SysRole func (e *SysRole) Remove(c *dto.SysRoleDeleteReq) error { var err error - tx := e.Orm.Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx := e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } var model = models.SysRole{} tx.Preload("SysMenu").Preload("SysDept").First(&model, c.GetId()) db := tx.Select(clause.Associations).Delete(&model) @@ -203,14 +213,17 @@ func (e *SysRole) GetRoleMenuId(roleId int) ([]int, error) { func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { var err error - tx := e.Orm.Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx := e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } var dlist = make([]models.SysDept, 0) var model = models.SysRole{} tx.Preload("SysDept").First(&model, c.RoleId) @@ -239,14 +252,17 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { // UpdateStatus 修改SysRole对象status func (e *SysRole) UpdateStatus(c *dto.UpdateStatusReq) error { var err error - tx := e.Orm.Debug().Begin() - defer func() { - if err != nil { - tx.Rollback() - } else { - tx.Commit() - } - }() + tx := e.Orm + if config.DatabaseConfig.Driver != "sqlite3" { + tx := e.Orm.Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + } var model = models.SysRole{} tx.First(&model, c.GetId()) c.Generate(&model) @@ -299,4 +315,4 @@ func (e *SysRole) GetById(roleId int) ([]string, error) { permissions = append(permissions, l[i].Permission) } return permissions, nil -} \ No newline at end of file +} From 26ee7b7985ac96b102a485d1aeabba2d40c20e23 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sat, 22 Jan 2022 21:49:42 +0800 Subject: [PATCH 036/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E6=B8=85?= =?UTF-8?q?=E7=A9=BAsqlite=E6=95=B0=E6=8D=AE=E5=BA=93=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go-admin-db.db | Bin 319488 -> 335872 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/go-admin-db.db b/go-admin-db.db index b09e1fa7fc52aa399bcf18864121544710679fea..5152f46f01355ce66606ca35ebb7339afcce872c 100644 GIT binary patch literal 335872 zcmeFa31A%6m8e~UA?!=5?PiV2XELi;4CAx)g`%6tGnrL z$rcl0H^yLaz$PpP0$~YTHbX+f<`Cxp-^@QRnSYWulgvx<{_ME5B$Itl=AZY@xwZEu z$#@7(jzOoZ@2#qH>bvJIr|zxlomX#82z`&_jUN&0e^1z zv%%kc;jaPylz%2=qsHggIrmk^8)1if{uj90I{r`mZ~0#||4q{`nr@lrv^{I{Tff-& z_l?^c{#U~ulb3s`#<}!a`_8kpUb)g#SdvJ^#r=u+{=VFJu5Tcn934sJ`bIPHSYGVg zGpE6-P)!XCTv~_*Yb>(}&vfu{}vq zx1VnFJXu$7*SgI;#*;Z$_e)mxCF1?gL@F;1iP`pkb~0m#XKw4J3VKk8y z)w8hOa$;6B1QNt}LjN_H$mze{Fe+xp6)o(G!OXq+k)$CZo*2j*5^`zOrc%?N9?egU zj)>XBKzqMts+yD=&4^jqLv(wN=CByc({%vUQzTN-)v5{7)v90R%TvDt!B|$MIyl@X zm9oA>4T*gN$yhF@@G)j(VgtjmA+>-ZGa1_>CYj4fg{mg$&kv;tH6h*?18i6)@`(|# zUH0eF)VP=w%lDPe0Ch>nU8@gjS#002X-n6R-Oj6eb{kyWGB!R^lHQY~l+vaL9k$P~ zTPE2z0FE}4)@r)!yN3Nn((zHKcltx+q`_=Dl{aMU8OA`LAdB$YRd=?tn+t7JYaVp9=Ut07Cs#In#Dm#6Cu!yVOD z$GN^|L)Wg&z0Sc{G6&UhAUg_;s@!a-nfdG}9D(h7i(Yj0Tu$ zNCXVVlw^7+F%V126;A$$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 22 Jan 2022 23:03:01 +0800 Subject: [PATCH 037/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0error=E5=88=A4=E6=96=AD=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 ++ cmd/migrate/migration/models/initdb.go | 30 ++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 952901248..24509c977 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ PROJECT:=go-admin .PHONY: build build: CGO_ENABLED=0 go build -o go-admin main.go +build-linux: + env GOOS=linux GOARCH=amd64 go build build-sqlite: go build -tags sqlite3 -o go-admin main.go #.PHONY: test diff --git a/cmd/migrate/migration/models/initdb.go b/cmd/migrate/migration/models/initdb.go index 5a37ec593..08fbfa572 100644 --- a/cmd/migrate/migration/models/initdb.go +++ b/cmd/migrate/migration/models/initdb.go @@ -1,6 +1,7 @@ package models import ( + "errors" "fmt" "go-admin/common/global" "gorm.io/gorm" @@ -12,19 +13,40 @@ import ( func InitDb(db *gorm.DB) (err error) { filePath := "config/db.sql" if global.Driver == "postgres" { + err = ExecSql(db, filePath) + if err != nil { + return err + } filePath = "config/pg.sql" err = ExecSql(db, filePath) + if err != nil { + return err + } } else if global.Driver == "mysql" { filePath = "config/db-begin-mysql.sql" err = ExecSql(db, filePath) + if err != nil { + return err + } filePath = "config/db.sql" err = ExecSql(db, filePath) + if err != nil { + return err + } filePath = "config/db-end-mysql.sql" err = ExecSql(db, filePath) - } else { + if err != nil { + return err + } + } else if global.Driver == "sqlite3" { err = ExecSql(db, filePath) + if err != nil { + return err + } + } else { + return errors.New("database type is not supported") } - return err + return nil } func ExecSql(db *gorm.DB, filePath string) error { @@ -39,7 +61,7 @@ func ExecSql(db *gorm.DB, filePath string) error { fmt.Println(sqlList[i]) continue } - sql := strings.Replace(sqlList[i]+";", "\n", "", 0) + sql := strings.Replace(sqlList[i]+";", "\n", "", -1) sql = strings.TrimSpace(sql) if err = db.Exec(sql).Error; err != nil { log.Printf("error sql: %s", sql) @@ -60,4 +82,4 @@ func Ioutil(filePath string) (string, error) { } else { return "", err } -} \ No newline at end of file +} From 02b62a288ddc2845a10c439164711e4521192850 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 22 Jan 2022 23:05:38 +0800 Subject: [PATCH 038/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8E=86=E5=8F=B2=E7=9A=84sqlite=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqlite3.db | Bin 155648 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 sqlite3.db diff --git a/sqlite3.db b/sqlite3.db deleted file mode 100644 index 65124d045c2aa8245f04f14b937e28500d351ccd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 155648 zcmeHw3w&F}mAB-VB-^qA#&KN}V&fP`O&sa!{u+{7PKv}+3mJ#+S+V3 z+ZW;A74T2~w7^A`Ou)BYb8U6`MO*jJpRR`73ePXF%wo^4Jin;Fr0&VO_td`R_-WOb zDjoL6JioNM{eN)!!QJ(a=FU$0p_Y7XBq`>`bJ1jaR7$}g?X`Pg^WdtjgKb+^UAtkh zZCIN%+_rRBO6^ETrNnTXl*)^vVs`m(Atz>2u`zMDEidlRFCWh3WBEc(rld?Pk;uvv zVF+yFvAmQ{$*CjR^ggIWCezBznPe=FiX`XI+w&4(27iIoSZ4WfJS)cXVsvC&E?3AT z^a)vUESB9ZXOHDZ=V)HE$bNXeg7%o0Dj=NrU2jAglM!M3)+0<(v=HZ|d{V(%imOOwV)>nN)9_kB zl2nl&&nS1r;@Td_h}khIm(%n~CYBXbdA%H|bTl4|?}R#1g)uQJ#g`9{0Q8A?wlFp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KKh1t>Ubh5X!w-og@e{S0ejSJ^0CTd@=-oK&ocRlSWiBPyE%`k zM{(f~SF%|~rjyL2uypNI z5*>;X8yw3 zjZ#B7FaZ{|1didh07QgC{h^35!bdPd3lZ6XA7+5CwGZ2Gu=!;ilz5mP-5k5JfBqz64;;{UJzY_z{WQK1{N{`9A@1F z0N8}%)9M{9osXa7IvYH{9qj>~*rj3dAi_}w8; zymW%ZWcdpIw~8<5SMa*{2focyU3${B8;gI)XBy;1rEblMv+DU-9D62kGv>DsLPDe_ z1pmmpCGEdd=1Lc`kXtZ8-;n|ba3P*(ftP*)DT4$E!mv$6qOYTzCz)C&aC0ZzcqNG~ zYGl#}6lq^t$fnG2seJT2)%-x#GC}r(jN)mRO0x;4Mi!}XbOUpKgtJe;_R*r2#zkZX zronDN7kmNK4Be=oeO-uBwNARA0|gd0(+I)VCYo?cS@*HHirRZZ#1{_851m$2&5O=o zG6`o+Ks`*bF&AZV zq(O0jYP~kfi1w+(7}3iLBx0uS1YC%DwoT%R7{M5WH<~94B!>k*h#Vv_;@KH0<0|dAWVBI(jPhd6L`D+4n;!`mP2%|*D&f^y3EAmRjj9K}==a#V95X<;{ARMPd8Q*?C+dM!G P!_j$w{95w)nMVD8B#A6f From 054199d1e4c2f8f69cf62e2469306158efc376e0 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Sun, 30 Jan 2022 17:19:50 +0800 Subject: [PATCH 039/238] fix 404 link. --- README.Zh-cn.md | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 9447895f4..7d38d5ec1 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -74,9 +74,9 @@ ### 轻松实现go-admin写出第一个应用 - 文档教程 -[步骤一 - 基础内容介绍](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial01.html) +[步骤一 - 基础内容介绍](https://doc.zhangwj.com/guide/intro/tutorial01.html) -[步骤二 - 实际应用 - 编写增删改查](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial02.html) +[步骤二 - 实际应用 - 编写增删改查](https://doc.zhangwj.com/guide/intro/tutorial02.html) ### 手把手教你从入门到放弃 - 视频教程 diff --git a/README.md b/README.md index 4338902d2..427fa1346 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,9 @@ At the same time, a series of tutorials including videos and documents are provi ### Easily implement go-admin to write the first application-documentation tutorial -[Step 1 - basic content introduction](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial01.html) +[Step 1 - basic content introduction](https://doc.zhangwj.com/guide/intro/tutorial01.html) -[Step 2 - Practical application - writing database operations](http://doc.zhangwj.com/go-admin-site/guide/intro/tutorial02.html) +[Step 2 - Practical application - writing database operations](https://doc.zhangwj.com/guide/intro/tutorial02.html) ### Teach you from getting started to giving up-video tutorial From 3cfa7a2767ceba1bd638f8ec1c0b329e67ab9bb0 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Mon, 31 Jan 2022 12:00:26 +0800 Subject: [PATCH 040/238] fix code gen problem. --- template/v4/dto.go.template | 8 ++++---- template/v4/model.go.template | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/template/v4/dto.go.template b/template/v4/dto.go.template index 1aa5bfe46..a9304e0b1 100644 --- a/template/v4/dto.go.template +++ b/template/v4/dto.go.template @@ -1,10 +1,6 @@ package dto import ( - "go-admin/app/{{.PackageName}}/models" - "go-admin/common/dto" - common "go-admin/common/models" - {{- $bb := false -}} {{- range .Columns -}} {{$z := .IsQuery}} @@ -18,6 +14,10 @@ import ( {{- if eq $bb true -}} "time" {{- end }} + + "go-admin/app/{{.PackageName}}/models" + "go-admin/common/dto" + common "go-admin/common/models" ) type {{.ClassName}}GetPageReq struct { diff --git a/template/v4/model.go.template b/template/v4/model.go.template index 1862b0338..246c5c591 100644 --- a/template/v4/model.go.template +++ b/template/v4/model.go.template @@ -1,9 +1,22 @@ package models import ( - // "gorm.io/gorm" + {{- $bb := false -}} + {{- range .Columns -}} + {{$z := .IsQuery}} + {{- if ($z) }} + {{if eq .GoType "time.Time"}}{{- $bb = true -}}{{- end -}} + {{- end -}} + {{- end -}} + {{- range .Columns -}} + {{if eq .GoType "time.Time"}}{{- $bb = true -}}{{- end -}} + {{- end -}} + {{- if eq $bb true -}} + "time" + {{- end }} "go-admin/common/models" + ) type {{.ClassName}} struct { From b52da434bb397cd3e405aa40f0cff00e20edaec8 Mon Sep 17 00:00:00 2001 From: horizonzy Date: Mon, 31 Jan 2022 13:00:21 +0800 Subject: [PATCH 041/238] fix code gen problem. --- template/v4/dto.go.template | 1 + template/v4/model.go.template | 1 + 2 files changed, 2 insertions(+) diff --git a/template/v4/dto.go.template b/template/v4/dto.go.template index a9304e0b1..691780211 100644 --- a/template/v4/dto.go.template +++ b/template/v4/dto.go.template @@ -1,6 +1,7 @@ package dto import ( + {{- $bb := false -}} {{- range .Columns -}} {{$z := .IsQuery}} diff --git a/template/v4/model.go.template b/template/v4/model.go.template index 246c5c591..1e34cd9b8 100644 --- a/template/v4/model.go.template +++ b/template/v4/model.go.template @@ -1,6 +1,7 @@ package models import ( + {{- $bb := false -}} {{- range .Columns -}} {{$z := .IsQuery}} From d02b52f38368429cadf9c1ca323f24b056bf1546 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 8 Feb 2022 18:41:09 +0800 Subject: [PATCH 042/238] =?UTF-8?q?feat=E2=9C=A8:=20=E6=B7=BB=E5=8A=A0sqls?= =?UTF-8?q?erver=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/migrate/migration/init.go | 4 +- cmd/migrate/migration/models/initdb.go | 26 +- cmd/migrate/migration/models/sys_user.go | 8 +- common/database/open.go | 7 +- common/database/open_sqlite3.go | 9 +- config/db-sqlserver.sql | 342 +++++++++++++++++++++++ config/settings.yml | 5 +- go.mod | 3 +- 8 files changed, 366 insertions(+), 38 deletions(-) create mode 100644 config/db-sqlserver.sql diff --git a/cmd/migrate/migration/init.go b/cmd/migrate/migration/init.go index 54261d1eb..541f1d6b5 100644 --- a/cmd/migrate/migration/init.go +++ b/cmd/migrate/migration/init.go @@ -46,7 +46,7 @@ func (e *Migration) Migrate() { var err error var count int64 for _, v := range versions { - err = e.db.Debug().Table("sys_migration").Where("version = ?", v).Count(&count).Error + err = e.db.Table("sys_migration").Where("version = ?", v).Count(&count).Error if err != nil { log.Fatalln(err) } @@ -55,7 +55,7 @@ func (e *Migration) Migrate() { count = 0 continue } - err = (e.version[v])(e.db.Debug(), strconv.Itoa(v)) + err = (e.version[v])(e.db, strconv.Itoa(v)) if err != nil { log.Fatalln(err) } diff --git a/cmd/migrate/migration/models/initdb.go b/cmd/migrate/migration/models/initdb.go index 08fbfa572..644ba4993 100644 --- a/cmd/migrate/migration/models/initdb.go +++ b/cmd/migrate/migration/models/initdb.go @@ -1,7 +1,6 @@ package models import ( - "errors" "fmt" "go-admin/common/global" "gorm.io/gorm" @@ -13,40 +12,19 @@ import ( func InitDb(db *gorm.DB) (err error) { filePath := "config/db.sql" if global.Driver == "postgres" { - err = ExecSql(db, filePath) - if err != nil { - return err - } filePath = "config/pg.sql" err = ExecSql(db, filePath) - if err != nil { - return err - } } else if global.Driver == "mysql" { filePath = "config/db-begin-mysql.sql" err = ExecSql(db, filePath) - if err != nil { - return err - } filePath = "config/db.sql" err = ExecSql(db, filePath) - if err != nil { - return err - } filePath = "config/db-end-mysql.sql" err = ExecSql(db, filePath) - if err != nil { - return err - } - } else if global.Driver == "sqlite3" { - err = ExecSql(db, filePath) - if err != nil { - return err - } } else { - return errors.New("database type is not supported") + err = ExecSql(db, filePath) } - return nil + return err } func ExecSql(db *gorm.DB, filePath string) error { diff --git a/cmd/migrate/migration/models/sys_user.go b/cmd/migrate/migration/models/sys_user.go index ab22a6c48..1860b5bb5 100644 --- a/cmd/migrate/migration/models/sys_user.go +++ b/cmd/migrate/migration/models/sys_user.go @@ -11,13 +11,13 @@ type SysUser struct { Password string `json:"-" gorm:"type:varchar(128);comment:密码"` NickName string `json:"nickName" gorm:"type:varchar(128);comment:昵称"` Phone string `json:"phone" gorm:"type:varchar(11);comment:手机号"` - RoleId int `json:"roleId" gorm:"type:bigint(20);comment:角色ID"` + RoleId int `json:"roleId" gorm:"type:bigint;comment:角色ID"` Salt string `json:"-" gorm:"type:varchar(255);comment:加盐"` Avatar string `json:"avatar" gorm:"type:varchar(255);comment:头像"` Sex string `json:"sex" gorm:"type:varchar(255);comment:性别"` Email string `json:"email" gorm:"type:varchar(128);comment:邮箱"` - DeptId int `json:"deptId" gorm:"type:bigint(20);comment:部门"` - PostId int `json:"postId" gorm:"type:bigint(20);comment:岗位"` + DeptId int `json:"deptId" gorm:"type:bigint;comment:部门"` + PostId int `json:"postId" gorm:"type:bigint;comment:岗位"` Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` Status string `json:"status" gorm:"type:varchar(4);comment:状态"` ControlBy @@ -45,4 +45,4 @@ func (e *SysUser) Encrypt() (err error) { func (e *SysUser) BeforeCreate(_ *gorm.DB) error { return e.Encrypt() -} \ No newline at end of file +} diff --git a/common/database/open.go b/common/database/open.go index 50c10feac..550566b71 100644 --- a/common/database/open.go +++ b/common/database/open.go @@ -1,3 +1,4 @@ +//go:build !sqlite3 // +build !sqlite3 package database @@ -5,10 +6,12 @@ package database import ( "gorm.io/driver/mysql" "gorm.io/driver/postgres" + "gorm.io/driver/sqlserver" "gorm.io/gorm" ) var opens = map[string]func(string) gorm.Dialector{ - "mysql": mysql.Open, - "postgres": postgres.Open, + "mysql": mysql.Open, + "postgres": postgres.Open, + "sqlserver": sqlserver.Open, } diff --git a/common/database/open_sqlite3.go b/common/database/open_sqlite3.go index 51754190d..aaebe94d2 100644 --- a/common/database/open_sqlite3.go +++ b/common/database/open_sqlite3.go @@ -1,3 +1,4 @@ +//go:build sqlite3 // +build sqlite3 package database @@ -6,11 +7,13 @@ import ( "gorm.io/driver/mysql" "gorm.io/driver/postgres" "gorm.io/driver/sqlite" + "gorm.io/driver/sqlserver" "gorm.io/gorm" ) var opens = map[string]func(string) gorm.Dialector{ - "mysql": mysql.Open, - "postgres": postgres.Open, - "sqlite3": sqlite.Open, + "mysql": mysql.Open, + "postgres": postgres.Open, + "sqlite3": sqlite.Open, + "sqlserver": sqlserver.Open, } diff --git a/config/db-sqlserver.sql b/config/db-sqlserver.sql new file mode 100644 index 000000000..0ba4168c0 --- /dev/null +++ b/config/db-sqlserver.sql @@ -0,0 +1,342 @@ +-- 开始初始化数据 ; +SET IDENTITY_INSERT sys_api ON; +INSERT INTO sys_api (id, handle, title, path, type, "action", created_at, updated_at, deleted_at, create_by, update_by)VALUES +(5, 'go-admin/app/admin/apis.SysLoginLog.Get-fm', '登录日志通过id获取', '/api/v1/sys-login-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.728', '2021-06-17 11:37:12.331', NULL, 0, 0), +(6, 'go-admin/app/admin/apis.SysOperaLog.GetPage-fm', '操作日志列表', '/api/v1/sys-opera-log', 'BUS', 'GET', '2021-05-13 19:59:00.778', '2021-06-17 11:48:40.732', NULL, 0, 0), +(7, 'go-admin/app/admin/apis.SysOperaLog.Get-fm', '操作日志通过id获取', '/api/v1/sys-opera-log/:id', 'BUS', 'GET', '2021-05-13 19:59:00.821', '2021-06-16 21:49:48.598', NULL, 0, 0), +(8, 'go-admin/common/actions.IndexAction.func1', '分类列表', '/api/v1/syscategory', 'BUS', 'GET', '2021-05-13 19:59:00.870', '2021-06-13 20:53:47.883', NULL, 0, 0), +(9, 'go-admin/common/actions.ViewAction.func1', '分类通过id获取', '/api/v1/syscategory/:id', 'BUS', 'GET', '2021-05-13 19:59:00.945', '2021-06-13 20:53:47.926', NULL, 0, 0), +(10, 'go-admin/common/actions.IndexAction.func1', '内容列表', '/api/v1/syscontent', 'BUS', 'GET', '2021-05-13 19:59:01.005', '2021-06-13 20:53:47.966', NULL, 0, 0), +(11, 'go-admin/common/actions.ViewAction.func1', '内容通过id获取', '/api/v1/syscontent/:id', 'BUS', 'GET', '2021-05-13 19:59:01.056', '2021-06-13 20:53:48.005', NULL, 0, 0), +(15, 'go-admin/common/actions.IndexAction.func1', 'job列表', '/api/v1/sysjob', 'BUS', 'GET', '2021-05-13 19:59:01.248', '2021-06-13 20:53:48.169', NULL, 0, 0), +(16, 'go-admin/common/actions.ViewAction.func1', 'job通过id获取', '/api/v1/sysjob/:id', 'BUS', 'GET', '2021-05-13 19:59:01.298', '2021-06-13 20:53:48.214', NULL, 0, 0), +(21, 'go-admin/app/admin/apis.SysDictType.GetPage-fm', '字典类型列表', '/api/v1/dict/type', 'BUS', 'GET', '2021-05-13 19:59:01.525', '2021-06-17 11:48:40.732', NULL, 0, 0), +(22, 'go-admin/app/admin/apis.SysDictType.GetAll-fm', '字典类型查询【代码生成】', '/api/v1/dict/type-option-select', 'SYS', 'GET', '2021-05-13 19:59:01.582', '2021-06-13 20:53:48.388', NULL, 0, 0), +(23, 'go-admin/app/admin/apis.SysDictType.Get-fm', '字典类型通过id获取', '/api/v1/dict/type/:id', 'BUS', 'GET', '2021-05-13 19:59:01.632', '2021-06-17 11:48:40.732', NULL, 0, 0), +(24, 'go-admin/app/admin/apis.SysDictData.GetPage-fm', '字典数据列表', '/api/v1/dict/data', 'BUS', 'GET', '2021-05-13 19:59:01.684', '2021-06-17 11:48:40.732', NULL, 0, 0), +(25, 'go-admin/app/admin/apis.SysDictData.Get-fm', '字典数据通过code获取', '/api/v1/dict/data/:dictCode', 'BUS', 'GET', '2021-05-13 19:59:01.732', '2021-06-17 11:48:40.732', NULL, 0, 0), +(26, 'go-admin/app/admin/apis.SysDictData.GetSysDictDataAll-fm', '数据字典根据key获取', '/api/v1/dict-data/option-select', 'SYS', 'GET', '2021-05-13 19:59:01.832', '2021-06-17 11:48:40.732', NULL, 0, 0), +(27, 'go-admin/app/admin/apis.SysDept.GetPage-fm', '部门列表', '/api/v1/dept', 'BUS', 'GET', '2021-05-13 19:59:01.940', '2021-06-17 11:48:40.732', NULL, 0, 0), +(28, 'go-admin/app/admin/apis.SysDept.Get-fm', '部门通过id获取', '/api/v1/dept/:id', 'BUS', 'GET', '2021-05-13 19:59:02.009', '2021-06-17 11:48:40.732', NULL, 0, 0), +(29, 'go-admin/app/admin/apis.SysDept.Get2Tree-fm', '查询部门下拉树【角色权限-自定权限】', '/api/v1/deptTree', 'SYS', 'GET', '2021-05-13 19:59:02.050', '2021-06-17 11:48:40.732', NULL, 0, 0), +(30, 'go-admin/app/admin/apis/tools.(*Gen).GetDBTableList-fm', '数据库表列表', '/api/v1/db/tables/page', 'SYS', 'GET', '2021-05-13 19:59:02.098', '2021-06-13 20:53:48.730', NULL, 0, 0), +(31, 'go-admin/app/admin/apis/tools.(*Gen).GetDBColumnList-fm', '数据表列列表', '/api/v1/db/columns/page', 'SYS', 'GET', '2021-05-13 19:59:02.140', '2021-06-13 20:53:48.771', NULL, 0, 0), +(32, 'go-admin/app/admin/apis/tools.Gen.GenCode-fm', '数据库表生成到项目', '/api/v1/gen/toproject/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.183', '2021-06-13 20:53:48.812', NULL, 0, 0), +(33, 'go-admin/app/admin/apis/tools.Gen.GenMenuAndApi-fm', '数据库表生成到DB', '/api/v1/gen/todb/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.227', '2021-06-13 20:53:48.853', NULL, 0, 0), +(34, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesTree-fm', '关系表数据【代码生成】', '/api/v1/gen/tabletree', 'SYS', 'GET', '2021-05-13 19:59:02.271', '2021-06-13 20:53:48.893', NULL, 0, 0), +(35, 'go-admin/app/admin/apis/tools.Gen.Preview-fm', '生成预览通过id获取', '/api/v1/gen/preview/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.315', '2021-06-13 20:53:48.935', NULL, 0, 0), +(36, 'go-admin/app/admin/apis/tools.Gen.GenApiToFile-fm', '生成api带文件', '/api/v1/gen/apitofile/:tableId', 'SYS', 'GET', '2021-05-13 19:59:02.357', '2021-06-13 20:53:48.977', NULL, 0, 0), +(37, 'go-admin/app/admin/apis.System.GenerateCaptchaHandler-fm', '验证码获取', '/api/v1/getCaptcha', 'SYS', 'GET', '2021-05-13 19:59:02.405', '2021-06-13 20:53:49.020', NULL, 0, 0), +(38, 'go-admin/app/admin/apis.SysUser.GetInfo-fm', '用户信息获取', '/api/v1/getinfo', 'SYS', 'GET', '2021-05-13 19:59:02.447', '2021-06-13 20:53:49.065', NULL, 0, 0), +(39, 'go-admin/app/admin/apis.SysMenu.GetPage-fm', '菜单列表', '/api/v1/menu', 'BUS', 'GET', '2021-05-13 19:59:02.497', '2021-06-17 11:48:40.732', NULL, 0, 0), +(40, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '查询菜单下拉树结构【废弃】', '/api/v1/menuTreeselect', 'SYS', 'GET', '2021-05-13 19:59:02.542', '2021-06-03 22:37:21.857', NULL, 0, 0), +(41, 'go-admin/app/admin/apis.SysMenu.Get-fm', '菜单通过id获取', '/api/v1/menu/:id', 'BUS', 'GET', '2021-05-13 19:59:02.584', '2021-06-17 11:48:40.732', NULL, 0, 0), +(42, 'go-admin/app/admin/apis.SysMenu.GetMenuRole-fm', '角色菜单【顶部左侧菜单】', '/api/v1/menurole', 'SYS', 'GET', '2021-05-13 19:59:02.630', '2021-06-13 20:53:49.574', NULL, 0, 0), +(43, 'go-admin/app/admin/apis.SysMenu.GetMenuIDS-fm', '获取角色对应的菜单id数组【废弃】', '/api/v1/menuids', 'SYS', 'GET', '2021-05-13 19:59:02.675', '2021-06-03 22:39:52.500', NULL, 0, 0), +(44, 'go-admin/app/admin/apis.SysRole.GetPage-fm', '角色列表', '/api/v1/role', 'BUS', 'GET', '2021-05-13 19:59:02.720', '2021-06-17 11:48:40.732', NULL, 0, 0), +(45, 'go-admin/app/admin/apis.SysMenu.GetMenuTreeSelect-fm', '菜单权限列表【角色配菜单使用】', '/api/v1/roleMenuTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.762', '2021-06-17 11:48:40.732', NULL, 0, 0), +(46, 'go-admin/app/admin/apis.SysDept.GetDeptTreeRoleSelect-fm', '角色部门结构树【自定义数据权限】', '/api/v1/roleDeptTreeselect/:roleId', 'SYS', 'GET', '2021-05-13 19:59:02.809', '2021-06-17 11:48:40.732', NULL, 0, 0), +(47, 'go-admin/app/admin/apis.SysRole.Get-fm', '角色通过id获取', '/api/v1/role/:id', 'BUS', 'GET', '2021-05-13 19:59:02.850', '2021-06-17 11:48:40.732', NULL, 0, 0), +(48, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).RefreshHandler-fm', '刷新token', '/api/v1/refresh_token', 'SYS', 'GET', '2021-05-13 19:59:02.892', '2021-06-13 20:53:49.278', NULL, 0, 0), +(53, 'go-admin/app/admin/apis.SysConfig.GetPage-fm', '参数列表', '/api/v1/config', 'BUS', 'GET', '2021-05-13 19:59:03.116', '2021-06-17 11:48:40.732', NULL, 0, 0), +(54, 'go-admin/app/admin/apis.SysConfig.Get-fm', '参数通过id获取', '/api/v1/config/:id', 'BUS', 'GET', '2021-05-13 19:59:03.157', '2021-06-17 11:48:40.732', NULL, 0, 0), +(55, 'go-admin/app/admin/apis.SysConfig.GetSysConfigByKEYForService-fm', '参数通过键名搜索【基础默认配置】', '/api/v1/configKey/:configKey', 'SYS', 'GET', '2021-05-13 19:59:03.198', '2021-06-13 20:53:49.745', NULL, 0, 0), +(57, 'go-admin/app/jobs/apis.SysJob.RemoveJobForService-fm', 'job移除', '/api/v1/job/remove/:id', 'BUS', 'GET', '2021-05-13 19:59:03.295', '2021-06-13 20:53:49.786', NULL, 0, 0), +(58, 'go-admin/app/jobs/apis.SysJob.StartJobForService-fm', 'job启动', '/api/v1/job/start/:id', 'BUS', 'GET', '2021-05-13 19:59:03.339', '2021-06-13 20:53:49.829', NULL, 0, 0), +(59, 'go-admin/app/admin/apis.SysPost.GetPage-fm', '岗位列表', '/api/v1/post', 'BUS', 'GET', '2021-05-13 19:59:03.381', '2021-06-17 11:48:40.732', NULL, 0, 0), +(60, 'go-admin/app/admin/apis.SysPost.Get-fm', '岗位通过id获取', '/api/v1/post/:id', 'BUS', 'GET', '2021-05-13 19:59:03.433', '2021-06-17 11:48:40.732', NULL, 0, 0), +(62, 'go-admin/app/admin/apis.SysConfig.GetSysConfigBySysApp-fm', '系统前端参数', '/api/v1/app-config', 'SYS', 'GET', '2021-05-13 19:59:03.526', '2021-06-13 20:53:49.994', NULL, 0, 0), +(63, 'go-admin/app/admin/apis.SysUser.GetProfile-fm', '*用户信息获取', '/api/v1/user/profile', 'SYS', 'GET', '2021-05-13 19:59:03.567', '2021-06-13 20:53:50.038', NULL, 0, 0), +(66, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).WsClient-fm', '链接ws【定时任务log】', '/ws/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.705', '2021-06-13 20:53:50.167', NULL, 0, 0), +(67, 'github.com/go-admin-team/go-admin-core/sdk/pkg/ws.(*Manager).UnWsClient-fm', '退出ws【定时任务log】', '/wslogout/:id/:channel', 'BUS', 'GET', '2021-05-13 19:59:03.756', '2021-06-13 20:53:50.209', NULL, 0, 0), +(68, 'go-admin/common/middleware/handler.Ping', '*用户基本信息', '/info', 'SYS', 'GET', '2021-05-13 19:59:03.800', '2021-06-13 20:53:50.251', NULL, 0, 0), +(72, 'go-admin/common/actions.CreateAction.func1', '分类创建', '/api/v1/syscategory', 'BUS', 'POST', '2021-05-13 19:59:03.982', '2021-06-13 20:53:50.336', NULL, 0, 0), +(73, 'go-admin/common/actions.CreateAction.func1', '内容创建', '/api/v1/syscontent', 'BUS', 'POST', '2021-05-13 19:59:04.027', '2021-06-13 20:53:50.375', NULL, 0, 0), +(76, 'go-admin/common/actions.CreateAction.func1', 'job创建', '/api/v1/sysjob', 'BUS', 'POST', '2021-05-13 19:59:04.164', '2021-06-13 20:53:50.500', NULL, 0, 0), +(80, 'go-admin/app/admin/apis.SysDictData.Insert-fm', '字典数据创建', '/api/v1/dict/data', 'BUS', 'POST', '2021-05-13 19:59:04.347', '2021-06-17 11:48:40.732', NULL, 0, 0), +(81, 'go-admin/app/admin/apis.SysDictType.Insert-fm', '字典类型创建', '/api/v1/dict/type', 'BUS', 'POST', '2021-05-13 19:59:04.391', '2021-06-17 11:48:40.732', NULL, 0, 0), +(82, 'go-admin/app/admin/apis.SysDept.Insert-fm', '部门创建', '/api/v1/dept', 'BUS', 'POST', '2021-05-13 19:59:04.435', '2021-06-17 11:48:40.732', NULL, 0, 0), +(85, 'github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth.(*GinJWTMiddleware).LoginHandler-fm', '*登录', '/api/v1/login', 'SYS', 'POST', '2021-05-13 19:59:04.597', '2021-06-13 20:53:50.784', NULL, 0, 0), +(86, 'go-admin/common/middleware/handler.LogOut', '*退出', '/api/v1/logout', 'SYS', 'POST', '2021-05-13 19:59:04.642', '2021-06-13 20:53:50.824', NULL, 0, 0), +(87, 'go-admin/app/admin/apis.SysConfig.Insert-fm', '参数创建', '/api/v1/config', 'BUS', 'POST', '2021-05-13 19:59:04.685', '2021-06-17 11:48:40.732', NULL, 0, 0), +(88, 'go-admin/app/admin/apis.SysMenu.Insert-fm', '菜单创建', '/api/v1/menu', 'BUS', 'POST', '2021-05-13 19:59:04.777', '2021-06-17 11:48:40.732', NULL, 0, 0), +(89, 'go-admin/app/admin/apis.SysPost.Insert-fm', '岗位创建', '/api/v1/post', 'BUS', 'POST', '2021-05-13 19:59:04.886', '2021-06-17 11:48:40.732', NULL, 0, 0), +(90, 'go-admin/app/admin/apis.SysRole.Insert-fm', '角色创建', '/api/v1/role', 'BUS', 'POST', '2021-05-13 19:59:04.975', '2021-06-17 11:48:40.732', NULL, 0, 0), +(91, 'go-admin/app/admin/apis.SysUser.InsetAvatar-fm', '*用户头像编辑', '/api/v1/user/avatar', 'SYS', 'POST', '2021-05-13 19:59:05.058', '2021-06-13 20:53:51.079', NULL, 0, 0), +(92, 'go-admin/app/admin/apis.SysApi.Update-fm', '接口编辑', '/api/v1/sys-api/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.122', '2021-06-17 11:48:40.732', NULL, 0, 0), +(95, 'go-admin/common/actions.UpdateAction.func1', '分类编辑', '/api/v1/syscategory/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.255', '2021-06-13 20:53:51.247', NULL, 0, 0), +(96, 'go-admin/common/actions.UpdateAction.func1', '内容编辑', '/api/v1/syscontent/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.299', '2021-06-13 20:53:51.289', NULL, 0, 0), +(97, 'go-admin/common/actions.UpdateAction.func1', 'job编辑', '/api/v1/sysjob', 'BUS', 'PUT', '2021-05-13 19:59:05.343', '2021-06-13 20:53:51.331', NULL, 0, 0), +(101, 'go-admin/app/admin/apis.SysDictData.Update-fm', '字典数据编辑', '/api/v1/dict/data/:dictCode', 'BUS', 'PUT', '2021-05-13 19:59:05.519', '2021-06-17 11:48:40.732', NULL, 0, 0), +(102, 'go-admin/app/admin/apis.SysDictType.Update-fm', '字典类型编辑', '/api/v1/dict/type/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.569', '2021-06-17 11:48:40.732', NULL, 0, 0), +(103, 'go-admin/app/admin/apis.SysDept.Update-fm', '部门编辑', '/api/v1/dept/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.613', '2021-06-17 11:48:40.732', NULL, 0, 0), +(104, 'go-admin/app/other/apis.SysFileDir.Update-fm', '文件夹编辑', '/api/v1/file-dir/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.662', '2021-06-13 20:53:51.847', NULL, 0, 0), +(105, 'go-admin/app/other/apis.SysFileInfo.Update-fm', '文件编辑', '/api/v1/file-info/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.709', '2021-06-13 20:53:51.892', NULL, 0, 0), +(106, 'go-admin/app/admin/apis.SysRole.Update-fm', '角色编辑', '/api/v1/role/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.752', '2021-06-17 11:48:40.732', NULL, 0, 0), +(107, 'go-admin/app/admin/apis.SysRole.Update2DataScope-fm', '角色数据权限修改', '/api/v1/roledatascope', 'BUS', 'PUT', '2021-05-13 19:59:05.803', '2021-06-17 11:48:40.732', NULL, 0, 0), +(108, 'go-admin/app/admin/apis.SysConfig.Update-fm', '参数编辑', '/api/v1/config/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.848', '2021-06-17 11:48:40.732', NULL, 0, 0), +(109, 'go-admin/app/admin/apis.SysMenu.Update-fm', '编辑菜单', '/api/v1/menu/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.891', '2021-06-17 11:48:40.732', NULL, 0, 0), +(110, 'go-admin/app/admin/apis.SysPost.Update-fm', '岗位编辑', '/api/v1/post/:id', 'BUS', 'PUT', '2021-05-13 19:59:05.934', '2021-06-17 11:48:40.732', NULL, 0, 0), +(111, 'go-admin/app/admin/apis.SysUser.UpdatePwd-fm', '*用户修改密码', '/api/v1/user/pwd', 'SYS', 'PUT', '2021-05-13 19:59:05.987', '2021-06-13 20:53:51.724', NULL, 0, 0), +(112, 'go-admin/common/actions.DeleteAction.func1', '分类删除', '/api/v1/syscategory', 'BUS', 'DELETE', '2021-05-13 19:59:06.030', '2021-06-13 20:53:52.237', NULL, 0, 0), +(113, 'go-admin/common/actions.DeleteAction.func1', '内容删除', '/api/v1/syscontent', 'BUS', 'DELETE', '2021-05-13 19:59:06.076', '2021-06-13 20:53:52.278', NULL, 0, 0), +(114, 'go-admin/app/admin/apis.SysLoginLog.Delete-fm', '登录日志删除', '/api/v1/sys-login-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.118', '2021-06-17 11:48:40.732', NULL, 0, 0), +(115, 'go-admin/app/admin/apis.SysOperaLog.Delete-fm', '操作日志删除', '/api/v1/sys-opera-log', 'BUS', 'DELETE', '2021-05-13 19:59:06.162', '2021-06-17 11:48:40.732', NULL, 0, 0), +(116, 'go-admin/common/actions.DeleteAction.func1', 'job删除', '/api/v1/sysjob', 'BUS', 'DELETE', '2021-05-13 19:59:06.206', '2021-06-13 20:53:52.323', NULL, 0, 0), +(117, 'go-admin/app/other/apis.SysChinaAreaData.Delete-fm', '行政区删除', '/api/v1/sys-area-data', 'BUS', 'DELETE', '2021-05-13 19:59:06.249', '2021-06-13 20:53:52.061', NULL, 0, 0), +(120, 'go-admin/app/admin/apis.SysDictData.Delete-fm', '字典数据删除', '/api/v1/dict/data', 'BUS', 'DELETE', '2021-05-13 19:59:06.387', '2021-06-17 11:48:40.732', NULL, 0, 0), +(121, 'go-admin/app/admin/apis.SysDictType.Delete-fm', '字典类型删除', '/api/v1/dict/type', 'BUS', 'DELETE', '2021-05-13 19:59:06.432', '2021-06-17 11:48:40.732', NULL, 0, 0), +(122, 'go-admin/app/admin/apis.SysDept.Delete-fm', '部门删除', '/api/v1/dept/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.475', '2021-06-17 11:48:40.732', NULL, 0, 0), +(123, 'go-admin/app/other/apis.SysFileDir.Delete-fm', '文件夹删除', '/api/v1/file-dir/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.520', '2021-06-13 20:53:52.539', NULL, 0, 0), +(124, 'go-admin/app/other/apis.SysFileInfo.Delete-fm', '文件删除', '/api/v1/file-info/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.566', '2021-06-13 20:53:52.580', NULL, 0, 0), +(125, 'go-admin/app/admin/apis.SysConfig.Delete-fm', '参数删除', '/api/v1/config', 'BUS', 'DELETE', '2021-05-13 19:59:06.612', '2021-06-17 11:48:40.732', NULL, 0, 0), +(126, 'go-admin/app/admin/apis.SysMenu.Delete-fm', '删除菜单', '/api/v1/menu', 'BUS', 'DELETE', '2021-05-13 19:59:06.654', '2021-06-17 11:48:40.732', NULL, 0, 0), +(127, 'go-admin/app/admin/apis.SysPost.Delete-fm', '岗位删除', '/api/v1/post/:id', 'BUS', 'DELETE', '2021-05-13 19:59:06.702', '2021-06-17 11:48:40.732', NULL, 0, 0), +(128, 'go-admin/app/admin/apis.SysRole.Delete-fm', '角色删除', '/api/v1/role', 'BUS', 'DELETE', '2021-05-13 19:59:06.746', '2021-06-17 11:48:40.732', NULL, 0, 0), +(131, 'github.com/go-admin-team/go-admin-core/tools/transfer.Handler.func1', '系统指标', '/api/v1/metrics', 'SYS', 'GET', '2021-05-17 22:13:55.933', '2021-06-13 20:53:49.614', NULL, 0, 0), +(132, 'go-admin/app/other/router.registerMonitorRouter.func1', '健康状态', '/api/v1/health', 'SYS', 'GET', '2021-05-17 22:13:56.285', '2021-06-13 20:53:49.951', NULL, 0, 0), +(133, 'go-admin/app/admin/apis.HelloWorld', '项目默认接口', '/', 'SYS', 'GET', '2021-05-24 10:30:44.553', '2021-06-13 20:53:47.406', NULL, 0, 0), +(134, 'go-admin/app/other/apis.ServerMonitor.ServerInfo-fm', '服务器基本状态', '/api/v1/server-monitor', 'SYS', 'GET', '2021-05-24 10:30:44.937', '2021-06-13 20:53:48.255', NULL, 0, 0), +(135, 'go-admin/app/admin/apis.SysApi.GetPage-fm', '接口列表', '/api/v1/sys-api', 'BUS', 'GET', '2021-05-24 11:37:53.303', '2021-06-17 11:48:40.732', NULL, 0, 0), +(136, 'go-admin/app/admin/apis.SysApi.Get-fm', '接口通过id获取', '/api/v1/sys-api/:id', 'BUS', 'GET', '2021-05-24 11:37:53.359', '2021-06-17 11:48:40.732', NULL, 0, 0), +(137, 'go-admin/app/admin/apis.SysLoginLog.GetPage-fm', '登录日志列表', '/api/v1/sys-login-log', 'BUS', 'GET', '2021-05-24 11:47:30.397', '2021-06-17 11:48:40.732', NULL, 0, 0), +(138, 'go-admin/app/other/apis.File.UploadFile-fm', '文件上传', '/api/v1/public/uploadFile', 'SYS', 'POST', '2021-05-25 19:16:18.493', '2021-06-13 20:53:50.866', NULL, 0, 0), +(139, 'go-admin/app/admin/apis.SysConfig.Update2Set-fm', '参数信息修改【参数配置】', '/api/v1/set-config', 'BUS', 'PUT', '2021-05-27 09:45:14.853', '2021-06-17 11:48:40.732', NULL, 0, 0), +(140, 'go-admin/app/admin/apis.SysConfig.Get2Set-fm', '参数获取全部【配置使用】', '/api/v1/set-config', 'BUS', 'GET', '2021-05-27 11:54:14.384', '2021-06-17 11:48:40.732', NULL, 0, 0), +(141, 'go-admin/app/admin/apis.SysUser.GetPage-fm', '管理员列表', '/api/v1/sys-user', 'BUS', 'GET', '2021-06-13 19:24:57.111', '2021-06-17 20:31:14.318', NULL, 0, 0), +(142, 'go-admin/app/admin/apis.SysUser.Get-fm', '管理员通过id获取', '/api/v1/sys-user/:id', 'BUS', 'GET', '2021-06-13 19:24:57.188', '2021-06-17 20:31:14.318', NULL, 0, 0), +(143, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTablesInfo-fm', '', '/api/v1/sys/tables/info', '', 'GET', '2021-06-13 19:24:57.437', '2021-06-13 20:53:48.047', NULL, 0, 0), +(144, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'GET', '2021-06-13 19:24:57.510', '2021-06-13 20:53:48.088', NULL, 0, 0), +(145, 'go-admin/app/admin/apis/tools.(*SysTable).GetSysTableList-fm', '', '/api/v1/sys/tables/page', '', 'GET', '2021-06-13 19:24:57.582', '2021-06-13 20:53:48.128', NULL, 0, 0), +(146, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'GET', '2021-06-13 19:24:59.641', '2021-06-13 20:53:50.081', NULL, 0, 0), +(147, 'github.com/swaggo/gin-swagger.CustomWrapHandler.func1', '', '/swagger/*any', '', 'GET', '2021-06-13 19:24:59.713', '2021-06-13 20:53:50.123', NULL, 0, 0), +(148, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'GET', '2021-06-13 19:24:59.914', '2021-06-13 20:53:50.295', NULL, 0, 0), +(149, 'go-admin/app/admin/apis/tools.(*SysTable).InsertSysTable-fm', '', '/api/v1/sys/tables/info', '', 'POST', '2021-06-13 19:25:00.163', '2021-06-13 20:53:50.539', NULL, 0, 0), +(150, 'go-admin/app/admin/apis.SysUser.Insert-fm', '管理员创建', '/api/v1/sys-user', 'BUS', 'POST', '2021-06-13 19:25:00.233', '2021-06-17 20:31:14.318', NULL, 0, 0), +(151, 'go-admin/app/admin/apis.SysUser.Update-fm', '管理员编辑', '/api/v1/sys-user', 'BUS', 'PUT', '2021-06-13 19:25:00.986', '2021-06-17 20:31:14.318', NULL, 0, 0), +(152, 'go-admin/app/admin/apis/tools.(*SysTable).UpdateSysTable-fm', '', '/api/v1/sys/tables/info', '', 'PUT', '2021-06-13 19:25:01.149', '2021-06-13 20:53:51.375', NULL, 0, 0), +(153, 'go-admin/app/admin/apis.SysRole.Update2Status-fm', '', '/api/v1/role-status', '', 'PUT', '2021-06-13 19:25:01.446', '2021-06-13 20:53:51.636', NULL, 0, 0), +(154, 'go-admin/app/admin/apis.SysUser.ResetPwd-fm', '', '/api/v1/user/pwd/reset', '', 'PUT', '2021-06-13 19:25:01.601', '2021-06-13 20:53:51.764', NULL, 0, 0), +(155, 'go-admin/app/admin/apis.SysUser.UpdateStatus-fm', '', '/api/v1/user/status', '', 'PUT', '2021-06-13 19:25:01.671', '2021-06-13 20:53:51.806', NULL, 0, 0), +(156, 'go-admin/app/admin/apis.SysUser.Delete-fm', '管理员删除', '/api/v1/sys-user', 'BUS', 'DELETE', '2021-06-13 19:25:02.043', '2021-06-17 20:31:14.318', NULL, 0, 0), +(157, 'go-admin/app/admin/apis/tools.(*SysTable).DeleteSysTables-fm', '', '/api/v1/sys/tables/info/:tableId', '', 'DELETE', '2021-06-13 19:25:02.283', '2021-06-13 20:53:52.367', NULL, 0, 0), +(158, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/static/*filepath', '', 'HEAD', '2021-06-13 19:25:02.734', '2021-06-13 20:53:52.791', NULL, 0, 0), +(159, 'github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1', '', '/form-generator/*filepath', '', 'HEAD', '2021-06-13 19:25:02.808', '2021-06-13 20:53:52.838', NULL, 0, 0); +SET IDENTITY_INSERT sys_api OFF; + +INSERT INTO sys_config VALUES +(1, '皮肤样式', 'sys_index_skinName', 'skin-green', 'Y', '0', '主框架页-默认皮肤样式名称:蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 13:50:13.123', NULL), +(2, '初始密码', 'sys_user_initPassword', '123456', 'Y', '0', '用户管理-账号初始密码:123456', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL), +(3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL), +(4, '系统名称', 'sys_app_name', 'go-admin管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2021-05-28 10:08:25.248', NULL), +(5, '系统logo', 'sys_app_logo', 'https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); + +SET IDENTITY_INSERT sys_dept ON; +INSERT INTO sys_dept (dept_id, parent_id, dept_path, dept_name, sort, leader, phone, email, status, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(1, 0, '/0/1/', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:06:44.960', NULL), +(7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', NULL), +(8, 1, '/0/1/8/', '运维部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:41:39.747', NULL), +(9, 1, '/0/1/9/', '客服部', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:05.993', NULL), +(10, 1, '/0/1/10/', '人力资源', 3, 'aituo', '13782218188', 'atuo@aituo.com', '1', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:07:08.503', NULL); +SET IDENTITY_INSERT sys_dept OFF; + +INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, + status, "default", remark, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(1, 0, '正常', '2', 'sys_normal_disable', '', '', '', '2', '', '系统正常', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.168', NULL); +INSERT INTO sys_dict_data VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', '2', '', '系统停用', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', '2', '', '性别男', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (4, 0, '女', '1', 'sys_user_sex', '', '', '', '2', '', '性别女', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (5, 0, '未知', '2', 'sys_user_sex', '', '', '', '2', '', '性别未知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (6, 0, '显示', '0', 'sys_show_hide', '', '', '', '2', '', '显示菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (7, 0, '隐藏', '1', 'sys_show_hide', '', '', '', '2', '', '隐藏菜单', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (8, 0, '是', 'Y', 'sys_yes_no', '', '', '', '2', '', '系统默认是', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (9, 0, '否', 'N', 'sys_yes_no', '', '', '', '2', '', '系统默认否', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (10, 0, '正常', '2', 'sys_job_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (11, 0, '停用', '1', 'sys_job_status', '', '', '', '2', '', '停用状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (12, 0, '默认', 'DEFAULT', 'sys_job_group', '', '', '', '2', '', '默认分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (13, 0, '系统', 'SYSTEM', 'sys_job_group', '', '', '', '2', '', '系统分组', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (14, 0, '通知', '1', 'sys_notice_type', '', '', '', '2', '', '通知', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (15, 0, '公告', '2', 'sys_notice_type', '', '', '', '2', '', '公告', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (16, 0, '正常', '2', 'sys_common_status', '', '', '', '2', '', '正常状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (17, 0, '关闭', '1', 'sys_common_status', '', '', '', '2', '', '关闭状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (18, 0, '新增', '1', 'sys_oper_type', '', '', '', '2', '', '新增操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (19, 0, '修改', '2', 'sys_oper_type', '', '', '', '2', '', '修改操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (20, 0, '删除', '3', 'sys_oper_type', '', '', '', '2', '', '删除操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (21, 0, '授权', '4', 'sys_oper_type', '', '', '', '2', '', '授权操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (22, 0, '导出', '5', 'sys_oper_type', '', '', '', '2', '', '导出操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (23, 0, '导入', '6', 'sys_oper_type', '', '', '', '2', '', '导入操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (24, 0, '强退', '7', 'sys_oper_type', '', '', '', '2', '', '强退操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (25, 0, '生成代码', '8', 'sys_oper_type', '', '', '', '2', '', '生成操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (26, 0, '清空数据', '9', 'sys_oper_type', '', '', '', '2', '', '清空操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (27, 0, '成功', '0', 'sys_notice_status', '', '', '', '2', '', '成功状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (28, 0, '失败', '1', 'sys_notice_status', '', '', '', '2', '', '失败状态', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (29, 0, '登录', '10', 'sys_oper_type', '', '', '', '2', '', '登录操作', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (30, 0, '退出', '11', 'sys_oper_type', '', '', '', '2', '', '', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', '2', '', '获取验证码', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_data VALUES (32, 0, '正常', '1', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); +INSERT INTO sys_dict_data VALUES (33, 1, '禁用', '2', 'sys_content_status', '', '', '', '1', '', '', 1, 1, '2021-05-13 19:56:40.845', '2021-05-13 19:56:40.845', NULL); + + +INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, remark, create_by, update_by, created_at, updated_at, + deleted_at)VALUES (1, '系统开关', 'sys_normal_disable', '2', '系统开关列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (2, '用户性别', 'sys_user_sex', '2', '用户性别列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (3, '菜单状态', 'sys_show_hide', '2', '菜单状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (4, '系统是否', 'sys_yes_no', '2', '系统是否列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (5, '任务状态', 'sys_job_status', '2', '任务状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (6, '任务分组', 'sys_job_group', '2', '任务分组列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (7, '通知类型', 'sys_notice_type', '2', '通知类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (8, '系统状态', 'sys_common_status', '2', '登录状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (9, '操作类型', 'sys_oper_type', '2', '操作类型列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (10, '通知状态', 'sys_notice_status', '2', '通知状态列表', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:37.914', NULL); +INSERT INTO sys_dict_type VALUES (11, '内容状态', 'sys_content_status', '2', '', 1, 1, '2021-05-13 19:56:40.813', '2021-05-13 19:56:40.813', NULL); + + +INSERT INTO sys_job (job_id, job_name, job_group, job_type, cron_expression, invoke_target, args, misfire_policy, concurrent, status, entry_id, created_at, updated_at, deleted_at, create_by, update_by)VALUES +(1, '接口测试', 'DEFAULT', 1, '0/5 * * * * ', 'http://localhost:8000', '', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-06-14 20:59:55.417', NULL, 1, 1), +(2, '函数测试', 'DEFAULT', 2, '0/5 * * * * ', 'ExamplesOne', '参数', 1, 1, 1, 0, '2021-05-13 19:56:37.914', '2021-05-31 23:55:37.221', NULL, 1, 1); + +SET IDENTITY_INSERT sys_menu ON; +INSERT INTO sys_menu (menu_id, menu_name, title, icon, path, paths, menu_type, "action", permission, parent_id, no_cache, breadcrumb, component, sort, visible, is_frame, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(2, 'Admin', '系统管理', 'api-server', '/admin', '/0/2', 'M', '无', '', 0, 1, '', 'Layout', 10, '0', '1', 0, 1, '2021-05-20 21:58:45.679', '2021-06-17 11:48:40.703', NULL), +(3, 'SysUserManage', '用户管理', 'user', '/admin/sys-user', '/0/2/3', 'C', '无', 'admin:sysUser:list', 2, 0, '', '/admin/sys-user/index', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(43, '', '新增管理员', 'app-group-fill', '', '/0/2/3/43', 'F', 'POST', 'admin:sysUser:add', 3, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(44, '', '查询管理员', 'app-group-fill', '', '/0/2/3/44', 'F', 'GET', 'admin:sysUser:query', 3, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(45, '', '修改管理员', 'app-group-fill', '', '/0/2/3/45', 'F', 'PUT', 'admin:sysUser:edit', 3, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(46, '', '删除管理员', 'app-group-fill', '', '/0/2/3/46', 'F', 'DELETE', 'admin:sysUser:remove', 3, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 20:31:14.305', NULL), +(51, 'SysMenuManage', '菜单管理', 'tree-table', '/admin/sys-menu', '/0/2/51', 'C', '无', 'admin:sysMenu:list', 2, 1, '', '/admin/sys-menu/index', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(52, 'SysRoleManage', '角色管理', 'peoples', '/admin/sys-role', '/0/2/52', 'C', '无', 'admin:sysRole:list', 2, 1, '', '/admin/sys-role/index', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(56, 'SysDeptManage', '部门管理', 'tree', '/admin/sys-dept', '/0/2/56', 'C', '无', 'admin:sysDept:list', 2, 0, '', '/admin/sys-dept/index', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(57, 'SysPostManage', '岗位管理', 'pass', '/admin/sys-post', '/0/2/57', 'C', '无', 'admin:sysPost:list', 2, 0, '', '/admin/sys-post/index', 50, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(58, 'Dict', '字典管理', 'education', '/admin/dict', '/0/2/58', 'C', '无', 'admin:sysDictType:list', 2, 0, '', '/admin/dict/index', 60, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(59, 'SysDictDataManage', '字典数据', 'education', '/admin/dict/data/:dictId', '/0/2/59', 'C', '无', 'admin:sysDictData:list', 2, 0, '', '/admin/dict/data', 100, '1', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(60, 'Tools', '开发工具', 'dev-tools', '/dev-tools', '/0/60', 'M', '无', '', 0, 0, '', 'Layout', 40, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL), +(61, 'Swagger', '系统接口', 'guide', '/dev-tools/swagger', '/0/60/61', 'C', '无', '', 60, 0, '', '/dev-tools/swagger/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-05 22:15:03.465', NULL), +(62, 'SysConfigManage', '参数管理', 'swagger', '/admin/sys-config', '/0/2/62', 'C', '无', 'admin:sysConfig:list', 2, 0, '', '/admin/sys-config/index', 70, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(211, 'Log', '日志管理', 'log', '/log', '/0/2/211', 'M', '', '', 2, 0, '', '/log/index', 80, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(212, 'SysLoginLogManage', '登录日志', 'logininfor', '/admin/sys-login-log', '/0/2/211/212', 'C', '', 'admin:sysLoginLog:list', 211, 0, '', '/admin/sys-login-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(216, 'OperLog', '操作日志', 'skill', '/admin/sys-oper-log', '/0/2/211/216', 'C', '', 'admin:sysOperLog:list', 211, 0, '', '/admin/sys-oper-log/index', 1, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(220, '', '新增菜单', 'app-group-fill', '', '/0/2/51/220', 'F', '', 'admin:sysMenu:add', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(221, '', '修改菜单', 'app-group-fill', '', '/0/2/51/221', 'F', '', 'admin:sysMenu:edit', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(222, '', '查询菜单', 'app-group-fill', '', '/0/2/51/222', 'F', '', 'admin:sysMenu:query', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(223, '', '删除菜单', 'app-group-fill', '', '/0/2/51/223', 'F', '', 'admin:sysMenu:remove', 51, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(224, '', '新增角色', 'app-group-fill', '', '/0/2/52/224', 'F', '', 'admin:sysRole:add', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(225, '', '查询角色', 'app-group-fill', '', '/0/2/52/225', 'F', '', 'admin:sysRole:query', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(226, '', '修改角色', 'app-group-fill', '', '/0/2/52/226', 'F', '', 'admin:sysRole:update', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(227, '', '删除角色', 'app-group-fill', '', '/0/2/52/227', 'F', '', 'admin:sysRole:remove', 52, 0, '', '', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(228, '', '查询部门', 'app-group-fill', '', '/0/2/56/228', 'F', '', 'admin:sysDept:query', 56, 0, '', '', 40, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(229, '', '新增部门', 'app-group-fill', '', '/0/2/56/229', 'F', '', 'admin:sysDept:add', 56, 0, '', '', 10, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(230, '', '修改部门', 'app-group-fill', '', '/0/2/56/230', 'F', '', 'admin:sysDept:edit', 56, 0, '', '', 30, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(231, '', '删除部门', 'app-group-fill', '', '/0/2/56/231', 'F', '', 'admin:sysDept:remove', 56, 0, '', '', 20, '0', '1', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(232, '', '查询岗位', 'app-group-fill', '', '/0/2/57/232', 'F', '', 'admin:sysPost:query', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(233, '', '新增岗位', 'app-group-fill', '', '/0/2/57/233', 'F', '', 'admin:sysPost:add', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(234, '', '修改岗位', 'app-group-fill', '', '/0/2/57/234', 'F', '', 'admin:sysPost:edit', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(235, '', '删除岗位', 'app-group-fill', '', '/0/2/57/235', 'F', '', 'admin:sysPost:remove', 57, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(236, '', '查询字典', 'app-group-fill', '', '/0/2/58/236', 'F', '', 'admin:sysDictType:query', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(237, '', '新增类型', 'app-group-fill', '', '/0/2/58/237', 'F', '', 'admin:sysDictType:add', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(238, '', '修改类型', 'app-group-fill', '', '/0/2/58/238', 'F', '', 'admin:sysDictType:edit', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(239, '', '删除类型', 'app-group-fill', '', '/0/2/58/239', 'F', '', 'system:sysdicttype:remove', 58, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(240, '', '查询数据', 'app-group-fill', '', '/0/2/59/240', 'F', '', 'admin:sysDictData:query', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(241, '', '新增数据', 'app-group-fill', '', '/0/2/59/241', 'F', '', 'admin:sysDictData:add', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(242, '', '修改数据', 'app-group-fill', '', '/0/2/59/242', 'F', '', 'admin:sysDictData:edit', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(243, '', '删除数据', 'app-group-fill', '', '/0/2/59/243', 'F', '', 'admin:sysDictData:remove', 59, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(244, '', '查询参数', 'app-group-fill', '', '/0/2/62/244', 'F', '', 'admin:sysConfig:query', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(245, '', '新增参数', 'app-group-fill', '', '/0/2/62/245', 'F', '', 'admin:sysConfig:add', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(246, '', '修改参数', 'app-group-fill', '', '/0/2/62/246', 'F', '', 'admin:sysConfig:edit', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(247, '', '删除参数', 'app-group-fill', '', '/0/2/62/247', 'F', '', 'admin:sysConfig:remove', 62, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(248, '', '查询登录日志', 'app-group-fill', '', '/0/2/211/212/248', 'F', '', 'admin:sysLoginLog:query', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(249, '', '删除登录日志', 'app-group-fill', '', '/0/2/211/212/249', 'F', '', 'admin:sysLoginLog:remove', 212, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(250, '', '查询操作日志', 'app-group-fill', '', '/0/2/211/216/250', 'F', '', 'admin:sysOperLog:query', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(251, '', '删除操作日志', 'app-group-fill', '', '/0/2/211/216/251', 'F', '', 'admin:sysOperLog:remove', 216, 0, '', '', 0, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-17 11:48:40.703', NULL), +(261, 'Gen', '代码生成', 'code', '/dev-tools/gen', '/0/60/261', 'C', '', '', 60, 0, '', '/dev-tools/gen/index', 2, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL), +(262, 'EditTable', '代码生成修改', 'build', '/dev-tools/editTable', '/0/60/262', 'C', '', '', 60, 0, '', '/dev-tools/gen/editTable', 100, '1', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL), +(264, 'Build', '表单构建', 'build', '/dev-tools/build', '/0/60/264', 'C', '', '', 60, 0, '', '/dev-tools/build/index', 1, '0', '1', 1, 1, '2020-04-11 15:52:48.000', '2021-06-16 21:26:12.446', NULL), +(269, 'ServerMonitor', '服务监控', 'druid', '/sys-tools/monitor', '/0/60/269', 'C', '', 'sysTools:serverMonitor:list', 537, 0, '', '/sys-tools/monitor', 0, '0', '1', 1, 1, '2020-04-14 00:28:19.000', '2021-06-16 21:26:12.446', NULL), +(459, 'Schedule', '定时任务', 'time-range', '/schedule', '/0/459', 'M', '无', '', 0, 0, '', 'Layout', 20, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(460, 'ScheduleManage', 'Schedule', 'job', '/schedule/manage', '/0/459/460', 'C', '无', 'job:sysJob:list', 459, 0, '', '/schedule/index', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(461, 'sys_job', '分页获取定时任务', 'app-group-fill', '', '/0/459/460/461', 'F', '无', 'job:sysJob:query', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(462, 'sys_job', '创建定时任务', 'app-group-fill', '', '/0/459/460/462', 'F', '无', 'job:sysJob:add', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(463, 'sys_job', '修改定时任务', 'app-group-fill', '', '/0/459/460/463', 'F', '无', 'job:sysJob:edit', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(464, 'sys_job', '删除定时任务', 'app-group-fill', '', '/0/459/460/464', 'F', '无', 'job:sysJob:remove', 460, 0, '', '', 0, '0', '1', 1, 1, '2020-08-03 09:17:37.000', '2021-06-05 22:15:03.465', NULL), +(471, 'JobLog', '日志', 'bug', '/schedule/log', '/0/459/471', 'C', '', '', 459, 0, '', '/schedule/log', 0, '1', '1', 1, 1, '2020-08-05 21:24:46.000', '2021-06-05 22:15:03.465', NULL), +(528, 'SysApiManage', '接口管理', 'api-doc', '/admin/sys-api', '/0/527/528', 'C', '无', 'admin:sysApi:list', 2, 0, '', '/admin/sys-api/index', 0, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(529, '', '查询接口', 'app-group-fill', '', '/0/527/528/529', 'F', '无', 'admin:sysApi:query', 528, 0, '', '', 40, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(531, '', '修改接口', 'app-group-fill', '', '/0/527/528/531', 'F', '无', 'admin:sysApi:edit', 528, 0, '', '', 30, '0', '0', 0, 1, '2021-05-20 22:08:44.526', '2021-06-17 11:48:40.703', NULL), +(537, 'SysTools', '系统工具', 'system-tools', '/sys-tools', '', 'M', '', '', 0, 0, '', 'Layout', 30, '0', '1', 1, 1, '2021-05-21 11:13:32.166', '2021-06-16 21:26:12.446', NULL), +(540, 'SysConfigSet', '参数设置', 'system-tools', '/admin/sys-config/set', '', 'C', '', 'admin:sysConfigSet:list', 2, 0, '', '/admin/sys-config/set', 0, '0', '1', 1, 1, '2021-05-25 16:06:52.560', '2021-06-17 11:48:40.703', NULL), +(542, '', '修改', 'upload', '', '', 'F', '', 'admin:sysConfigSet:update', 540, 0, '', '', 0, '0', '1', 1, 1, '2021-06-13 11:45:48.670', '2021-06-17 11:48:40.703', NULL); +SET IDENTITY_INSERT sys_menu OFF; +INSERT INTO sys_menu_api_rule (sys_menu_menu_id, sys_api_id)VALUES (216, 6); +(250, 6), +(58, 21), +(236, 21), +(238, 23), +(59, 24), +(240, 24), +(242, 25), +(58, 26), +(236, 26), +(56, 27), +(228, 27), +(230, 28), +(226, 29), +(51, 39), +(51, 135), +(222, 39), +(221, 41), +(52, 44), +(225, 44), +(226, 45), +(226, 46), +(226, 47), +(62, 53), +(244, 53), +(246, 54), +(57, 59), +(232, 59), +(234, 60), +(241, 80), +(237, 81), +(229, 82), +(245, 87), +(220, 88), +(233, 89), +(224, 90), +(531, 92), +(242, 101), +(238, 102), +(230, 103), +(226, 106), +(226, 107), +(246, 108), +(221, 109), +(234, 110), +(249, 114), +(251, 115), +(243, 120), +(239, 121), +(231, 122), +(247, 125), +(223, 126), +(235, 127), +(227, 128), +(528, 135), +(529, 135), +(531, 136), +(212, 137), +(248, 137), +(542, 139), +(540, 140), +(3, 141), +(44, 141), +(45, 142), +(43, 150), +(45, 151), +(46, 156); +INSERT INTO sys_post (post_id, post_name, post_code, sort, status, remark, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(1, '首席执行官', 'CEO', 0, '2','首席执行官', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL), +(2, '首席技术执行官', 'CTO', 2, '2','首席技术执行官', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL), +(3, '首席运营官', 'COO', 3, '2','测试工程师', 1, 1,'2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_role (role_id, role_name, status, role_key, role_sort, flag, remark, admin, data_scope, create_by, update_by, created_at, updated_at, deleted_at)VALUES +(1, '系统管理员', '2', 'admin', 1, '', '', 1, '', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); +INSERT INTO sys_user VALUES (1, 'admin', '$2a$10$/Glr4g9Svr6O0kvjsRJCXu3f0W8/dsP3XZyVNi1019ratWpSPMyw.', 'zhangwj', '13818888888', 1, '', '', '1', '1@qq.com', 1, 1, '', '2', 1, 1, '2021-05-13 19:56:37.914', '2021-05-13 19:56:40.205', NULL); +-- 数据完成 ; \ No newline at end of file diff --git a/config/settings.yml b/config/settings.yml index ca7186159..8e7ed8708 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -27,7 +27,8 @@ settings: # token 过期时间 单位:秒 timeout: 3600 database: - # 数据库类型 mysql,sqlite3, postgres + # 数据库类型 mysql, sqlite3, postgres, sqlserver + # sqlserver: sqlserver://用户名:密码@地址?database=数据库名 driver: mysql # 数据库连接字符串 mysql 缺省信息 charset=utf8&parseTime=True&loc=Local&timeout=1000ms source: user:password@tcp(127.0.0.1:3306)/dbname?charset=utf8&parseTime=True&loc=Local&timeout=1000ms @@ -70,4 +71,4 @@ settings: # blockingTimeout: 5 # reclaimInterval: 1 locker: - redis: + redis: \ No newline at end of file diff --git a/go.mod b/go.mod index 32f540c77..c28d385e2 100644 --- a/go.mod +++ b/go.mod @@ -29,5 +29,6 @@ require ( gorm.io/driver/mysql v1.0.4-0.20201206014609-ae5fd10184f6 gorm.io/driver/postgres v1.0.6-0.20201208020313-1ed927cfab53 gorm.io/driver/sqlite v1.1.5-0.20201206014648-c84401fbe3ba + gorm.io/driver/sqlserver v1.0.4 gorm.io/gorm v1.21.11 -) +) \ No newline at end of file From 98b60f056475257a0c6c45fe2059751b0982d948 Mon Sep 17 00:00:00 2001 From: NPM Mirror Bot Date: Sat, 12 Feb 2022 05:56:42 +0000 Subject: [PATCH 043/238] update https://registry.npm.taobao.org to https://registry.npmmirror.com --- README.Zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 9447895f4..2c6717cbd 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -217,7 +217,7 @@ env GOOS=linux GOARCH=amd64 go build main.go npm install # 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 -npm install --registry=https://registry.npm.taobao.org +npm install --registry=https://registry.npmmirror.com # 启动服务 npm run dev From f114424079b7e55ad5ad61af150a95acaf459cb4 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 13 Feb 2022 00:23:20 +0800 Subject: [PATCH 044/238] =?UTF-8?q?fix=F0=9F=90=9B:=20fix=20monitor=20maco?= =?UTF-8?q?s=20env=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/other/apis/sys_server_monitor.go | 125 +++++++++++++++++++++------ go-admin-db.db | Bin 335872 -> 335872 bytes go.mod | 5 +- 3 files changed, 100 insertions(+), 30 deletions(-) diff --git a/app/other/apis/sys_server_monitor.go b/app/other/apis/sys_server_monitor.go index a80540528..a7a4172e9 100644 --- a/app/other/apis/sys_server_monitor.go +++ b/app/other/apis/sys_server_monitor.go @@ -2,18 +2,21 @@ package apis import ( "fmt" - "github.com/shirou/gopsutil/host" + "github.com/shirou/gopsutil/v3/net" + "regexp" "runtime" "strconv" + "strings" "time" "github.com/gin-gonic/gin" "github.com/go-admin-team/go-admin-core/sdk/api" "github.com/go-admin-team/go-admin-core/sdk/pkg" _ "github.com/go-admin-team/go-admin-core/sdk/pkg/response" - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/disk" - "github.com/shirou/gopsutil/mem" + "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v3/disk" + "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v3/mem" ) const ( @@ -23,11 +26,28 @@ const ( GB = 1024 * MB ) +var ( + Version string + expectDiskFsTypes = []string{ + "apfs", "ext4", "ext3", "ext2", "f2fs", "reiserfs", "jfs", "btrfs", + "fuseblk", "zfs", "simfs", "ntfs", "fat32", "exfat", "xfs", "fuse.rclone", + } + excludeNetInterfaces = []string{ + "lo", "tun", "docker", "veth", "br-", "vmbr", "vnet", "kube", + } + getMacDiskNo = regexp.MustCompile(`\/dev\/disk(\d)s.*`) +) + +var ( + netInSpeed, netOutSpeed, netInTransfer, netOutTransfer, lastUpdateNetStats uint64 + cachedBootTime time.Time +) + type ServerMonitor struct { api.Api } -//获取相差时间 +// GetHourDiffer 获取相差时间 func GetHourDiffer(startTime, endTime string) int64 { var hour int64 t1, err := time.ParseInLocation("2006-01-02 15:04:05", startTime, time.Local) @@ -64,33 +84,28 @@ func (e ServerMonitor) ServerInfo(c *gin.Context) { osDic["hostName"] = sysInfo.Hostname osDic["time"] = time.Now().Format("2006-01-02 15:04:05") - dis, _ := disk.Usage("/") - diskTotalGB := int(dis.Total) / GB - diskFreeGB := int(dis.Free) / GB - diskDic := make(map[string]interface{}, 0) - diskDic["total"] = diskTotalGB - diskDic["free"] = diskFreeGB - mem, _ := mem.VirtualMemory() - memUsedMB := int(mem.Used) / GB - memTotalMB := int(mem.Total) / GB - memFreeMB := int(mem.Free) / GB - memUsedPercent := int(mem.UsedPercent) memDic := make(map[string]interface{}, 0) - memDic["total"] = memTotalMB - memDic["used"] = memUsedMB - memDic["free"] = memFreeMB - memDic["usage"] = memUsedPercent + memDic["used"] = mem.Used / MB + memDic["total"] = mem.Total / MB + + fmt.Println("mem", int(mem.Total/mem.Used*100)) + memDic["percent"] = pkg.Round(mem.UsedPercent, 2) + + swapDic := make(map[string]interface{}, 0) + swapDic["used"] = mem.SwapTotal - mem.SwapFree + swapDic["total"] = mem.SwapTotal cpuDic := make(map[string]interface{}, 0) cpuDic["cpuInfo"], _ = cpu.Info() percent, _ := cpu.Percent(0, false) - cpuDic["Percent"] = pkg.Round(percent[0], 2) + cpuDic["percent"] = pkg.Round(percent[0], 2) cpuDic["cpuNum"], _ = cpu.Counts(false) //服务器磁盘信息 disklist := make([]disk.UsageStat, 0) //所有分区 + var diskTotal, diskUsed, diskUsedPercent float64 diskInfo, err := disk.Partitions(true) if err == nil { for _, p := range diskInfo { @@ -101,16 +116,72 @@ func (e ServerMonitor) ServerInfo(c *gin.Context) { diskDetail.Used = diskDetail.Used / 1024 / 1024 diskDetail.Free = diskDetail.Free / 1024 / 1024 disklist = append(disklist, *diskDetail) + } } } + d, _ := disk.Usage("/") + + diskTotal = float64(d.Total / GB) + diskUsed = float64(d.Used / GB) + diskUsedPercent, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", d.UsedPercent), 64) + + diskDic := make(map[string]interface{}, 0) + diskDic["total"] = diskTotal + diskDic["used"] = diskUsed + diskDic["percent"] = diskUsedPercent + + bootTime, _ := host.BootTime() + cachedBootTime = time.Unix(int64(bootTime), 0) + + TrackNetworkSpeed() + netDic := make(map[string]interface{}, 0) + netDic["in"] = pkg.Round(float64(netInSpeed/KB), 2) + netDic["out"] = pkg.Round(float64(netOutSpeed/KB), 2) e.Custom(gin.H{ - "code": 200, - "os": osDic, - "mem": memDic, - "cpu": cpuDic, - "disk": diskDic, - "diskList": disklist, + "code": 200, + "os": osDic, + "mem": memDic, + "cpu": cpuDic, + "disk": diskDic, + "net": netDic, + "swap": swapDic, + "location": "Aliyun", + "bootTime": GetHourDiffer(cachedBootTime.Format("2006-01-02 15:04:05"), time.Now().Format("2006-01-02 15:04:05")), }) } + +func TrackNetworkSpeed() { + var innerNetInTransfer, innerNetOutTransfer uint64 + nc, err := net.IOCounters(true) + if err == nil { + for _, v := range nc { + if isListContainsStr(excludeNetInterfaces, v.Name) { + continue + } + innerNetInTransfer += v.BytesRecv + innerNetOutTransfer += v.BytesSent + } + now := uint64(time.Now().Unix()) + diff := now - lastUpdateNetStats + if diff > 0 { + netInSpeed = (innerNetInTransfer - netInTransfer) / diff + fmt.Println("netInSpeed", netInSpeed) + netOutSpeed = (innerNetOutTransfer - netOutTransfer) / diff + fmt.Println("netOutSpeed", netOutSpeed) + } + netInTransfer = innerNetInTransfer + netOutTransfer = innerNetOutTransfer + lastUpdateNetStats = now + } +} + +func isListContainsStr(list []string, str string) bool { + for i := 0; i < len(list); i++ { + if strings.Contains(str, list[i]) { + return true + } + } + return false +} diff --git a/go-admin-db.db b/go-admin-db.db index 5152f46f01355ce66606ca35ebb7339afcce872c..ca8e07201def51a5fcf3b6866d6711da66da7a2c 100644 GIT binary patch delta 2143 zcmah~eQZ?47N41WX7Aq5+1-Aw6j`KDw6yFlR<>1Wp+y^7p{@1BK7wArT4E ztKuW_hpi=!F9u)h13#eJ!dfOi;$?;#mnS_HDo$!K6|KVI$I`6~b)9L(Eh4c$s`Fck1J%6x%z6+Kgq|1ZtT??f6HQ z8b1weNP2WTyTpEA-?1TMP^5O_K6YL1!f+%UluIieCVfStbd{yjE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 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index 22da11c8d..9755dc672 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.0.8" + Version = "2.0.9" ) var ( From cca84c3c2117947da9751942090e898105901d48 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 21 Feb 2022 17:56:12 +0800 Subject: [PATCH 046/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20License?= =?UTF-8?q?=20Copyright?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 2e5981c4f..36b35f4c3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 wenjianzhang +Copyright (c) 2020 go-admin-team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 8754ff81471ccd9a32ac2b26e8c360598d953b35 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 21 Feb 2022 18:04:18 +0800 Subject: [PATCH 047/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20upgrade=20os?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/file_store/oss.go | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/common/file_store/oss.go b/common/file_store/oss.go index fb7a2a454..c35627b9f 100644 --- a/common/file_store/oss.go +++ b/common/file_store/oss.go @@ -6,50 +6,43 @@ import ( ) type ALiYunOSS struct { - Client interface{} - Endpoint string - AccessKeyId string - AccessKeySecret string - BucketName string + Client interface{} + BucketName string } -func (e *ALiYunOSS) Setup() error { - // TODO: 如果需要使用阿里云OSS请在此处填写对应信息 - e.AccessKeyId = "" - e.AccessKeySecret = "" - e.Endpoint = "" - e.BucketName = "" - - client, err := oss.New(e.Endpoint, e.AccessKeyId, e.AccessKeySecret) +//Setup 装载 +//endpoint sss +func (e *ALiYunOSS) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error { + client, err := oss.New(endpoint, accessKeyID, accessKeySecret) if err != nil { log.Println("Error:", err) return err } e.Client = client + e.BucketName = BucketName + return nil } // UpLoad 文件上传 -func (e *ALiYunOSS) UpLoad(yourObjectName string, localFile string) error { - err := e.Setup() - if err != nil { - log.Println("Error:", err) - return err - } +func (e *ALiYunOSS) UpLoad(yourObjectName string, localFile interface{}) error { // 获取存储空间。 bucket, err := e.Client.(*oss.Client).Bucket(e.BucketName) if err != nil { log.Println("Error:", err) return err } - // 设置分片大小为100 KB,指定分片上传并发数为3,并开启断点续传上传。 // 其中与objectKey是同一概念,表示断点续传上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。 // "LocalFile"为filePath,100*1024为partSize。 - err = bucket.UploadFile(yourObjectName, localFile, 100*1024, oss.Routines(3), oss.Checkpoint(true, "")) + err = bucket.UploadFile(yourObjectName, localFile.(string), 100*1024, oss.Routines(3), oss.Checkpoint(true, "")) if err != nil { log.Println("Error:", err) return err } return nil } + +func (e *ALiYunOSS) GetTempToken() (string, error) { + return "", nil +} From dfaa2ff51e4aa566fc8054a8caee2265484d6b33 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 21 Feb 2022 18:04:46 +0800 Subject: [PATCH 048/238] =?UTF-8?q?test=E2=9C=85:=20=20added=20oss=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/file_store/oss_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 common/file_store/oss_test.go diff --git a/common/file_store/oss_test.go b/common/file_store/oss_test.go new file mode 100644 index 000000000..f04dd225b --- /dev/null +++ b/common/file_store/oss_test.go @@ -0,0 +1,16 @@ +package file_store + +import ( + "testing" +) + +func TestOSSUpload(t *testing.T) { + // 打括号内填写自己的测试信息即可 + e := OXS{} + var oxs = e.Setup(AliYunOSS) + err := oxs.UpLoad("test.png", "./test.png") + if err != nil { + t.Error(err) + } + t.Log("ok") +} From cdb5faf043c64cf71e45bada2494daab10f4830b Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 21 Feb 2022 18:06:11 +0800 Subject: [PATCH 049/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20upgrade=20OX?= =?UTF-8?q?S=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/file_store/interface.go | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/common/file_store/interface.go b/common/file_store/interface.go index 5ba5c4277..acecbe908 100644 --- a/common/file_store/interface.go +++ b/common/file_store/interface.go @@ -1,6 +1,27 @@ package file_store +// DriverType 驱动类型 +type DriverType string + +const ( + // HuaweiOBS 华为云OBS + HuaweiOBS DriverType = "HuaweiOBS" + // AliYunOSS 阿里云OSS + AliYunOSS DriverType = "AliYunOSS" + // QiNiuKodo 七牛云kodo + QiNiuKodo DriverType = "QiNiuKodo" +) + +type ClientOption map[string]interface{} + +// TODO: FileStoreType名称待定 + +// FileStoreType OXS type FileStoreType interface { - Setup() error - UpLoad(yourObjectName string, localFile string) error + // Setup 装载 endpoint sss + Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error + // UpLoad 上传 + UpLoad(yourObjectName string, localFile interface{}) error + // GetTempToken 获取临时Token + GetTempToken() (string, error) } From f998d20a862a0d1e188f2ac72026dd71b37ac12f Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 21 Feb 2022 18:07:37 +0800 Subject: [PATCH 050/238] =?UTF-8?q?feat=E2=9C=A8:=20=20added=20obs,kodo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/file_store/initialize.go | 48 +++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/common/file_store/initialize.go b/common/file_store/initialize.go index 2190b2174..fabce9fbd 100644 --- a/common/file_store/initialize.go +++ b/common/file_store/initialize.go @@ -1,13 +1,45 @@ package file_store -type FileStore struct { +import "fmt" + +type OXS struct { + // Endpoint 访问域名 + Endpoint string + // AccessKeyID AK + AccessKeyID string + // AccessKeySecret AKS + AccessKeySecret string + // BucketName 桶名称 + BucketName string } -// Setup 配置数据库 -func (e *FileStore) Setup(driver string) { - //fileStoreType := driver - //if fileStoreType == "ALiYunOSS" { - // var store = new(ALiYunOSS) - // store.Setup() - //} +// Setup 配置文件存储driver +func (e *OXS) Setup(driver DriverType, options ...ClientOption) FileStoreType { + fileStoreType := driver + var fileStore FileStoreType + switch fileStoreType { + case AliYunOSS: + fileStore = new(ALiYunOSS) + err := fileStore.Setup(e.Endpoint, e.AccessKeyID, e.AccessKeySecret, e.BucketName) + if err != nil { + fmt.Println(err) + } + return fileStore + case HuaweiOBS: + fileStore = new(HuaWeiOBS) + err := fileStore.Setup(e.Endpoint, e.AccessKeyID, e.AccessKeySecret, e.BucketName) + if err != nil { + fmt.Println(err) + } + return fileStore + case QiNiuKodo: + fileStore = new(QiNiuKODO) + err := fileStore.Setup(e.Endpoint, e.AccessKeyID, e.AccessKeySecret, e.BucketName) + if err != nil { + fmt.Println(err) + } + return fileStore + } + + return nil } From 4876fc0aa1a17bc272b7d4cb4cf05903151a709e Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 5 Mar 2022 11:00:52 +0800 Subject: [PATCH 051/238] =?UTF-8?q?fix=F0=9F=90=9B:=20Fix=20password=20res?= =?UTF-8?q?et=20caused=20by=20modifying=20user=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/sys_user.go | 46 +++++++++++++++++++++++------------ app/admin/service/sys_user.go | 9 +++---- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/app/admin/apis/sys_user.go b/app/admin/apis/sys_user.go index 16fcff1a5..5f669f753 100644 --- a/app/admin/apis/sys_user.go +++ b/app/admin/apis/sys_user.go @@ -2,6 +2,7 @@ package apis import ( "github.com/gin-gonic/gin/binding" + "github.com/go-admin-team/go-admin-core/sdk/config" "go-admin/app/admin/models" "net/http" @@ -30,7 +31,7 @@ type SysUser struct { // @Security Bearer func (e SysUser) GetPage(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserGetPageReq{} + req := dto.SysUserGetPageReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req). @@ -67,7 +68,7 @@ func (e SysUser) GetPage(c *gin.Context) { // @Security Bearer func (e SysUser) Get(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserById{} + req := dto.SysUserById{} err := e.MakeContext(c). MakeOrm(). Bind(&req, nil). @@ -101,7 +102,7 @@ func (e SysUser) Get(c *gin.Context) { // @Security Bearer func (e SysUser) Insert(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserInsertReq{} + req := dto.SysUserInsertReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req, binding.JSON). @@ -136,7 +137,7 @@ func (e SysUser) Insert(c *gin.Context) { // @Security Bearer func (e SysUser) Update(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserUpdateReq{} + req := dto.SysUserUpdateReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req). @@ -171,7 +172,7 @@ func (e SysUser) Update(c *gin.Context) { // @Security Bearer func (e SysUser) Delete(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserById{} + req := dto.SysUserById{} err := e.MakeContext(c). MakeOrm(). Bind(&req, binding.JSON). @@ -208,7 +209,7 @@ func (e SysUser) Delete(c *gin.Context) { // @Security Bearer func (e SysUser) InsetAvatar(c *gin.Context) { s := service.SysUser{} - req :=dto.UpdateSysUserAvatarReq{} + req := dto.UpdateSysUserAvatarReq{} err := e.MakeContext(c). MakeOrm(). MakeService(&s.Service). @@ -257,7 +258,7 @@ func (e SysUser) InsetAvatar(c *gin.Context) { // @Security Bearer func (e SysUser) UpdateStatus(c *gin.Context) { s := service.SysUser{} - req :=dto.UpdateSysUserStatusReq{} + req := dto.UpdateSysUserStatusReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req, binding.JSON, nil). @@ -294,7 +295,7 @@ func (e SysUser) UpdateStatus(c *gin.Context) { // @Security Bearer func (e SysUser) ResetPwd(c *gin.Context) { s := service.SysUser{} - req :=dto.ResetSysUserPwdReq{} + req := dto.ResetSysUserPwdReq{} err := e.MakeContext(c). MakeOrm(). Bind(&req, binding.JSON). @@ -311,16 +312,23 @@ func (e SysUser) ResetPwd(c *gin.Context) { //数据权限检查 p := actions.GetPermissionFromContext(c) + if req.UserId == 1 && config.ApplicationConfig.Mode == "demo" { + req.Password = "123456" + } err = s.ResetPwd(&req, p) if err != nil { e.Logger.Error(err) return } - e.OK(req.GetId(), "更新成功") + if req.UserId == 1 && config.ApplicationConfig.Mode == "demo" { + e.OK(req.GetId(), "admin:现在使用的预览环境,休想改掉我!否则会影响其他朋友体验的哦!可以创建其他用户体验该功能!") + } else { + e.OK(req.GetId(), "更新成功") + } } // UpdatePwd -// @Summary 重置密码 +// @Summary 修改密码 // @Description 获取JSON // @Tags 用户 // @Accept application/json @@ -331,7 +339,7 @@ func (e SysUser) ResetPwd(c *gin.Context) { // @Security Bearer func (e SysUser) UpdatePwd(c *gin.Context) { s := service.SysUser{} - req :=dto.PassWord{} + req := dto.PassWord{} err := e.MakeContext(c). MakeOrm(). Bind(&req). @@ -345,14 +353,20 @@ func (e SysUser) UpdatePwd(c *gin.Context) { // 数据权限检查 p := actions.GetPermissionFromContext(c) - + if user.GetUserId(c) == 1 && config.ApplicationConfig.Mode == "demo" { + req.NewPassword = "123456" + } err = s.UpdatePwd(user.GetUserId(c), req.OldPassword, req.NewPassword, p) if err != nil { e.Logger.Error(err) e.Error(http.StatusForbidden, err, "密码修改失败") return } - e.OK(nil, "密码修改成功") + if user.GetUserId(c) == 1 && config.ApplicationConfig.Mode == "demo" { + e.OK(nil, "admin:现在使用的预览环境,休想改掉我!否则会影响其他朋友体验的哦!可以创建其他用户体验该功能!") + } else { + e.OK(nil, "密码修改成功") + } } // GetProfile @@ -364,7 +378,7 @@ func (e SysUser) UpdatePwd(c *gin.Context) { // @Security Bearer func (e SysUser) GetProfile(c *gin.Context) { s := service.SysUser{} - req :=dto.SysUserById{} + req := dto.SysUserById{} err := e.MakeContext(c). MakeOrm(). MakeService(&s.Service). @@ -401,7 +415,7 @@ func (e SysUser) GetProfile(c *gin.Context) { // @Router /api/v1/getinfo [get] // @Security Bearer func (e SysUser) GetInfo(c *gin.Context) { - req :=dto.SysUserById{} + req := dto.SysUserById{} s := service.SysUser{} r := service.SysRole{} err := e.MakeContext(c). @@ -450,4 +464,4 @@ func (e SysUser) GetInfo(c *gin.Context) { mp["name"] = sysUser.NickName mp["code"] = 200 e.OK(mp, "") -} \ No newline at end of file +} diff --git a/app/admin/service/sys_user.go b/app/admin/service/sys_user.go index 24a6e28bf..e09f9d109 100644 --- a/app/admin/service/sys_user.go +++ b/app/admin/service/sys_user.go @@ -127,8 +127,7 @@ func (e *SysUser) UpdateAvatar(c *dto.UpdateSysUserAvatarReq, p *actions.DataPer return errors.New("无权更新该数据") } - c.Generate(&model) - err = e.Orm.Save(&model).Error + err = e.Orm.Table(model.TableName()).Where("user_id =? ", c.UserId).Updates(c).Error if err != nil { e.Log.Errorf("Service UpdateSysUser error: %s", err) return err @@ -151,8 +150,7 @@ func (e *SysUser) UpdateStatus(c *dto.UpdateSysUserStatusReq, p *actions.DataPer return errors.New("无权更新该数据") } - c.Generate(&model) - err = e.Orm.Save(&model).Error + err = e.Orm.Table(model.TableName()).Where("user_id =? ", c.UserId).Updates(c).Error if err != nil { e.Log.Errorf("Service UpdateSysUser error: %s", err) return err @@ -174,8 +172,7 @@ func (e *SysUser) ResetPwd(c *dto.ResetSysUserPwdReq, p *actions.DataPermission) if db.RowsAffected == 0 { return errors.New("无权更新该数据") } - c.Generate(&model) - err = e.Orm.Save(&model).Error + err = e.Orm.Table(model.TableName()).Where("user_id =? ", c.UserId).Updates(c).Error if err != nil { e.Log.Errorf("At Service ResetSysUserPwd error: %s", err) return err From 24adca55e44d42c39b6b81e7c2872b65c236b707 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 5 Mar 2022 11:44:23 +0800 Subject: [PATCH 052/238] =?UTF-8?q?feat=E2=9C=A8:=20added=20file=20update?= =?UTF-8?q?=20sdk=EF=BC=9Bkodo=E3=80=81obs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/file_store/kodo.go | 111 +++++++++++++++++++++++++++++++++ common/file_store/kodo_test.go | 23 +++++++ common/file_store/obs.go | 52 +++++++++++++++ common/file_store/obs_test.go | 15 +++++ go.mod | 4 +- 5 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 common/file_store/kodo.go create mode 100644 common/file_store/kodo_test.go create mode 100644 common/file_store/obs.go create mode 100644 common/file_store/obs_test.go diff --git a/common/file_store/kodo.go b/common/file_store/kodo.go new file mode 100644 index 000000000..db896e270 --- /dev/null +++ b/common/file_store/kodo.go @@ -0,0 +1,111 @@ +package file_store + +import ( + "context" + "fmt" + "github.com/qiniu/go-sdk/v7/auth/qbox" + "github.com/qiniu/go-sdk/v7/storage" +) + +type Zone string + +const ( + // HuaDong 华东 + HuaDong Zone = "HuaDong" + // HuaBei 华北 + HuaBei Zone = "HuaBei" + // HuaNan 华南 + HuaNan Zone = "HuaNan" + // BeiMei 北美 + BeiMei Zone = "BeiMei" + // XinJiaPo 新加坡 + XinJiaPo Zone = "XinJiaPo" +) + +type QiNiuKODO struct { + Client interface{} + BucketName string + cfg storage.Config + options []ClientOption +} + +func (e *QiNiuKODO) getToken() string { + putPolicy := storage.PutPolicy{ + Scope: e.BucketName, + } + if len(e.options) > 0 && e.options[0]["Expires"] != nil { + putPolicy.Expires = e.options[0]["Expires"].(uint64) + } + upToken := putPolicy.UploadToken(e.Client.(*qbox.Mac)) + return upToken +} + +//Setup 装载 +//endpoint sss +func (e *QiNiuKODO) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error { + + mac := qbox.NewMac(accessKeyID, accessKeySecret) + // 获取存储空间。 + cfg := storage.Config{} + // 空间对应的机房 + e.setZoneORDefault(cfg, options...) + // 是否使用https域名 + cfg.UseHTTPS = true + // 上传是否使用CDN上传加速 + cfg.UseCdnDomains = false + + e.Client = mac + e.BucketName = BucketName + e.cfg = cfg + e.options = options + return nil +} + +// setZoneORDefault 设置Zone或者默认华东 +func (e *QiNiuKODO) setZoneORDefault(cfg storage.Config, options ...ClientOption) { + if len(options) > 0 && options[0]["Zone"] != nil { + if _, ok := options[0]["Zone"].(Zone); !ok { + cfg.Zone = &storage.ZoneHuadong + } + switch options[0]["Zone"].(Zone) { + case HuaDong: + cfg.Zone = &storage.ZoneHuadong + case HuaBei: + cfg.Zone = &storage.ZoneHuabei + case HuaNan: + cfg.Zone = &storage.ZoneHuanan + case BeiMei: + cfg.Zone = &storage.ZoneBeimei + case XinJiaPo: + cfg.Zone = &storage.ZoneXinjiapo + default: + cfg.Zone = &storage.ZoneHuadong + } + } +} + +// UpLoad 文件上传 +func (e *QiNiuKODO) UpLoad(yourObjectName string, localFile interface{}) error { + + // 构建表单上传的对象 + formUploader := storage.NewFormUploader(&e.cfg) + ret := storage.PutRet{} + // 可选配置 + putExtra := storage.PutExtra{ + Params: map[string]string{ + "x:name": "github logo", + }, + } + err := formUploader.PutFile(context.Background(), &ret, e.getToken(), yourObjectName, localFile.(string), &putExtra) + if err != nil { + fmt.Println(err) + return err + } + fmt.Println(ret.Key, ret.Hash) + return nil +} + +func (e *QiNiuKODO) GetTempToken() (string, error) { + token := e.getToken() + return token, nil +} diff --git a/common/file_store/kodo_test.go b/common/file_store/kodo_test.go new file mode 100644 index 000000000..a8767ae7c --- /dev/null +++ b/common/file_store/kodo_test.go @@ -0,0 +1,23 @@ +package file_store + +import ( + "testing" +) + +func TestKODOUpload(t *testing.T) { + e := OXS{"", "", "", ""} + var oxs = e.Setup(QiNiuKodo, map[string]interface{}{"Zone": "华东"}) + err := oxs.UpLoad("test.png", "./test.png") + if err != nil { + t.Error(err) + } + t.Log("ok") +} + +func TestKODOGetTempToken(t *testing.T) { + e := OXS{"", "", "", ""} + var oxs = e.Setup(QiNiuKodo, map[string]interface{}{"Zone": "华东"}) + token, _ := oxs.GetTempToken() + t.Log(token) + t.Log("ok") +} diff --git a/common/file_store/obs.go b/common/file_store/obs.go new file mode 100644 index 000000000..e9377291f --- /dev/null +++ b/common/file_store/obs.go @@ -0,0 +1,52 @@ +package file_store + +import ( + "fmt" + "github.com/huaweicloud/huaweicloud-sdk-go-obs/obs" + "log" +) + +type HuaWeiOBS struct { + Client interface{} + BucketName string +} + +func (e *HuaWeiOBS) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error { + // 创建ObsClient结构体 + client, err := obs.New(accessKeyID, accessKeySecret, endpoint) + if err != nil { + log.Println("Error:", err) + return err + } + e.Client = client + e.BucketName = BucketName + return nil +} + +// UpLoad 文件上传 +// yourObjectName 文件路径名称,与objectKey是同一概念,表示断点续传上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg +func (e *HuaWeiOBS) UpLoad(yourObjectName string, localFile interface{}) error { + // 获取存储空间。 + input := &obs.PutFileInput{} + input.Bucket = e.BucketName + input.Key = yourObjectName + input.SourceFile = localFile.(string) + output, err := e.Client.(*obs.ObsClient).PutFile(input) + + if err == nil { + fmt.Printf("RequestId:%s\n", output.RequestId) + fmt.Printf("ETag:%s, StorageClass:%s\n", output.ETag, output.StorageClass) + } else { + if obsError, ok := err.(obs.ObsError); ok { + fmt.Println(obsError.Code) + fmt.Println(obsError.Message) + } else { + fmt.Println(err) + } + } + return nil +} + +func (e *HuaWeiOBS) GetTempToken() (string, error) { + return "", nil +} diff --git a/common/file_store/obs_test.go b/common/file_store/obs_test.go new file mode 100644 index 000000000..096075085 --- /dev/null +++ b/common/file_store/obs_test.go @@ -0,0 +1,15 @@ +package file_store + +import ( + "testing" +) + +func TestOBSUpload(t *testing.T) { + e := OXS{"", "", "", ""} + var oxs = e.Setup(HuaweiOBS) + err := oxs.UpLoad("test.png", "./test.png") + if err != nil { + t.Error(err) + } + t.Log("ok") +} diff --git a/go.mod b/go.mod index a8a33c669..28fc04856 100644 --- a/go.mod +++ b/go.mod @@ -13,9 +13,11 @@ require ( github.com/go-admin-team/go-admin-core v1.3.8 github.com/go-admin-team/go-admin-core/sdk v1.3.9 github.com/google/uuid v1.2.0 + github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 github.com/prometheus/client_golang v1.11.0 + github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 github.com/shirou/gopsutil/v3 v3.22.1 github.com/spf13/cast v1.3.1 @@ -23,7 +25,7 @@ require ( github.com/swaggo/gin-swagger v1.2.0 github.com/swaggo/swag v1.6.7 github.com/unrolled/secure v1.0.8 - golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect gorm.io/driver/mysql v1.0.4-0.20201206014609-ae5fd10184f6 gorm.io/driver/postgres v1.0.6-0.20201208020313-1ed927cfab53 From 81bc15d77c38f50399c806fa414bcbb90b995050 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 5 Mar 2022 11:49:56 +0800 Subject: [PATCH 053/238] =?UTF-8?q?config=F0=9F=94=A7:=20=20go-admin=20ver?= =?UTF-8?q?sion=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index 9755dc672..f593fa607 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.0.9" + Version = "2.0.10" ) var ( From b030be8f80a470fa4b2f65b94ed62f44dfbcd140 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sat, 12 Mar 2022 13:00:19 +0800 Subject: [PATCH 054/238] =?UTF-8?q?fix=F0=9F=90=9B:=20Fix=20password=20res?= =?UTF-8?q?et?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_user.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/admin/service/sys_user.go b/app/admin/service/sys_user.go index e09f9d109..cdfe30d97 100644 --- a/app/admin/service/sys_user.go +++ b/app/admin/service/sys_user.go @@ -172,7 +172,8 @@ func (e *SysUser) ResetPwd(c *dto.ResetSysUserPwdReq, p *actions.DataPermission) if db.RowsAffected == 0 { return errors.New("无权更新该数据") } - err = e.Orm.Table(model.TableName()).Where("user_id =? ", c.UserId).Updates(c).Error + c.Generate(&model) + err = e.Orm.Omit("username", "nick_name", "phone", "role_id", "avatar", "sex").Save(&model).Error if err != nil { e.Log.Errorf("At Service ResetSysUserPwd error: %s", err) return err From 638bab3c9d6732e937e86bc19f01a4bb6f4b7365 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 31 Mar 2022 14:01:15 +0800 Subject: [PATCH 055/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 427fa1346..c151f080c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-admin - + [![Build Status](https://github.com/wenjianzhang/go-admin/workflows/build/badge.svg)](https://github.com/go-admin-team/go-admin) From c41672c21ac98c58230e0d4d3bbc02d4608af40c Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 31 Mar 2022 15:08:49 +0800 Subject: [PATCH 056/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 7d38d5ec1..1d3a47747 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -1,6 +1,6 @@ # go-admin - + [![Build Status](https://github.com/wenjianzhang/go-admin/workflows/build/badge.svg)](https://github.com/go-admin-team/go-admin) From eb33515e29158820c072dd523019250713775d66 Mon Sep 17 00:00:00 2001 From: kaiyuan Date: Fri, 8 Apr 2022 10:32:07 +0800 Subject: [PATCH 057/238] throw error if migrate failed --- cmd/migrate/migration/models/initdb.go | 11 ++++++++--- cmd/migrate/migration/version/1599190683659_tables.go | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/migrate/migration/models/initdb.go b/cmd/migrate/migration/models/initdb.go index 644ba4993..a93450315 100644 --- a/cmd/migrate/migration/models/initdb.go +++ b/cmd/migrate/migration/models/initdb.go @@ -3,10 +3,11 @@ package models import ( "fmt" "go-admin/common/global" - "gorm.io/gorm" "io/ioutil" "log" "strings" + + "gorm.io/gorm" ) func InitDb(db *gorm.DB) (err error) { @@ -16,9 +17,13 @@ func InitDb(db *gorm.DB) (err error) { err = ExecSql(db, filePath) } else if global.Driver == "mysql" { filePath = "config/db-begin-mysql.sql" - err = ExecSql(db, filePath) + if err = ExecSql(db, filePath); err != nil { + return err + } filePath = "config/db.sql" - err = ExecSql(db, filePath) + if err = ExecSql(db, filePath); err != nil { + return err + } filePath = "config/db-end-mysql.sql" err = ExecSql(db, filePath) } else { diff --git a/cmd/migrate/migration/version/1599190683659_tables.go b/cmd/migrate/migration/version/1599190683659_tables.go index 09a8e0e07..647807884 100644 --- a/cmd/migrate/migration/version/1599190683659_tables.go +++ b/cmd/migrate/migration/version/1599190683659_tables.go @@ -3,11 +3,11 @@ package version import ( "runtime" - "gorm.io/gorm" - "go-admin/cmd/migrate/migration" "go-admin/cmd/migrate/migration/models" common "go-admin/common/models" + + "gorm.io/gorm" ) func init() { @@ -41,7 +41,7 @@ func _1599190683659Tables(db *gorm.DB, version string) error { return err } if err := models.InitDb(tx); err != nil { - + return err } return tx.Create(&common.Migration{ Version: version, From 6ed2fcbf6c5ff0d8aeccb275f937ec7bbdd53170 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Fri, 27 May 2022 22:47:57 +0800 Subject: [PATCH 058/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E6=B7=BB=E5=8A=A0ro?= =?UTF-8?q?leKey=E9=AA=8C=E8=AF=81(#649)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/sys_role.go | 2 +- app/admin/service/sys_role.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/admin/apis/sys_role.go b/app/admin/apis/sys_role.go index f83e3657a..507132e93 100644 --- a/app/admin/apis/sys_role.go +++ b/app/admin/apis/sys_role.go @@ -125,7 +125,7 @@ func (e SysRole) Insert(c *gin.Context) { err = s.Insert(&req, cb) if err != nil { e.Logger.Error(err) - e.Error(500, err, "创建失败") + e.Error(500, err, "创建失败,"+err.Error()) return } _, err = global.LoadPolicy(c) diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index c1f1853c1..6c514045d 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -83,6 +83,18 @@ func (e *SysRole) Insert(c *dto.SysRoleInsertReq, cb *casbin.SyncedEnforcer) err } }() } + var count int64 + err = tx.Model(&data).Where("role_key = ?", c.RoleKey).Count(&count).Error + if err != nil { + e.Log.Errorf("db error:%s", err) + return err + } + + if count > 0 { + err = errors.New("roleKey已存在,需更换在提交!") + e.Log.Errorf("db error:%s", err) + return err + } err = tx.Create(&data).Error if err != nil { From cd0792e3d23ba7e4ae5e4a9daf61d8bd16a34ef8 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 28 May 2022 00:14:12 +0800 Subject: [PATCH 059/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0readme(#623)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 1d3a47747..1e1f3e6f5 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -182,6 +182,13 @@ $ ./go-admin server -c config/settings.yml $ go-admin.exe server -c config/settings.yml ``` +#### sys_api 表的数据如何添加 + +在项目启动时,使用`-a true` 系统会自动添加缺少的接口数据 +```bash +./go-admin server -c config/settings.yml -a true +``` + #### 使用docker 编译启动 ```shell From 88030e301a8ba736cd63e5c4f3b6786091b7f0fb Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 28 May 2022 00:17:35 +0800 Subject: [PATCH 060/238] =?UTF-8?q?patch=F0=9F=9A=91:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index f593fa607..1204cfc6b 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.0.10" + Version = "2.0.11" ) var ( From 717903a2b67a172610bcc6d40246a77898d08df4 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sat, 28 May 2022 00:34:08 +0800 Subject: [PATCH 061/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E4=B8=AD=E7=9A=84job=E8=83=BD=E5=A4=9F?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E9=97=AE=E9=A2=98(#638)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/apis/sys_job.go | 2 +- app/jobs/service/sys_job.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/jobs/apis/sys_job.go b/app/jobs/apis/sys_job.go index 581740025..296138dde 100644 --- a/app/jobs/apis/sys_job.go +++ b/app/jobs/apis/sys_job.go @@ -62,7 +62,7 @@ func (e SysJob) StartJobForService(c *gin.Context) { err = s.StartJob(&v) if err != nil { log.Errorf("GetCrontabKey error, %s", err.Error()) - e.Error(500, err, "") + e.Error(500, err, err.Error()) return } e.OK(nil, s.Msg) diff --git a/app/jobs/service/sys_job.go b/app/jobs/service/sys_job.go index 4e566d004..9d7268ea6 100644 --- a/app/jobs/service/sys_job.go +++ b/app/jobs/service/sys_job.go @@ -1,6 +1,7 @@ package service import ( + "github.com/pkg/errors" "time" "github.com/go-admin-team/go-admin-core/sdk/service" @@ -52,6 +53,12 @@ func (e *SysJob) StartJob(c *dto.GeneralGetDto) error { e.Log.Errorf("db error: %s", err) return err } + + if data.Status == 1 { + err = errors.New("当前Job是关闭状态不能被启动,请先启用。") + return err + } + if data.JobType == 1 { var j = &jobs.HttpJob{} j.InvokeTarget = data.InvokeTarget From 937b62e64132e24be24822a6cf0c4989d6f09635 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 29 May 2022 12:58:53 +0800 Subject: [PATCH 062/238] =?UTF-8?q?=E6=B7=BB=E5=8A=A0errors=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 28fc04856..0632556bb 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 + github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 From 8f70a1dca47592b2ae3299ee3ba487900b97d3f9 Mon Sep 17 00:00:00 2001 From: Han Zhang Date: Fri, 3 Jun 2022 20:38:54 +0800 Subject: [PATCH 063/238] =?UTF-8?q?fix=F0=9F=90=9B:=20Fix=20Dockerfile=20t?= =?UTF-8?q?o=20load=20config=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix🐛: Fix Dockerfile to load config file --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 430e91ef7..c5e33a5c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,8 @@ FROM alpine COPY --from=builder /go/release/go-admin / +COPY --from=builder /go/release/config/settings.yml /config/settings.yml + COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime EXPOSE 8000 From 45c8737601ef5dfe8b302f8f813fc9d6c9076620 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 5 Jun 2022 11:12:13 +0800 Subject: [PATCH 064/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E5=BC=95?= =?UTF-8?q?=E5=85=A5github.com/pkg/errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 28fc04856..0632556bb 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 + github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 From a19622f6ac388fdaa30028baa471c4b89c256234 Mon Sep 17 00:00:00 2001 From: wxxiong6 <6983441+wxxiong6@users.noreply.github.com> Date: Mon, 13 Jun 2022 23:36:12 +0800 Subject: [PATCH 065/238] fix UpdatePwd error fix UpdatePwd error --- app/admin/apis/sys_user.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/admin/apis/sys_user.go b/app/admin/apis/sys_user.go index 5f669f753..0bfb61079 100644 --- a/app/admin/apis/sys_user.go +++ b/app/admin/apis/sys_user.go @@ -356,6 +356,12 @@ func (e SysUser) UpdatePwd(c *gin.Context) { if user.GetUserId(c) == 1 && config.ApplicationConfig.Mode == "demo" { req.NewPassword = "123456" } + + var hash []byte + if hash, err = bcrypt.GenerateFromPassword([]byte(req.NewPassword), bcrypt.DefaultCost); err != nil { + req.NewPassword = string(hash) + } + err = s.UpdatePwd(user.GetUserId(c), req.OldPassword, req.NewPassword, p) if err != nil { e.Logger.Error(err) From 0d6b347d7e1ad52ac723065d704869c3376428c3 Mon Sep 17 00:00:00 2001 From: zhouxixi-dev Date: Thu, 23 Jun 2022 15:47:55 +0800 Subject: [PATCH 066/238] =?UTF-8?q?bugfix:=20https://github.com/go-admin-t?= =?UTF-8?q?eam/go-admin/issues/539=20=E4=BF=AE=E5=A4=8D=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E3=80=81=E4=BF=AE=E6=94=B9=E6=97=B6=EF=BC=8C?= =?UTF-8?q?sys=5Fcasbin=5Frule=E8=A1=A8drop=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E9=87=8D=E6=96=B0create=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/sys_role.go | 25 +++++++------------------ app/admin/service/sys_role.go | 21 +++++++++++++++++---- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/app/admin/apis/sys_role.go b/app/admin/apis/sys_role.go index 507132e93..1a1e75b0a 100644 --- a/app/admin/apis/sys_role.go +++ b/app/admin/apis/sys_role.go @@ -2,10 +2,11 @@ package apis import ( "fmt" + "net/http" + "github.com/gin-gonic/gin/binding" "github.com/go-admin-team/go-admin-core/sdk" "go-admin/app/admin/models" - "net/http" "github.com/gin-gonic/gin" "github.com/go-admin-team/go-admin-core/sdk/api" @@ -14,7 +15,6 @@ import ( "go-admin/app/admin/service" "go-admin/app/admin/service/dto" - "go-admin/common/global" ) type SysRole struct { @@ -128,11 +128,7 @@ func (e SysRole) Insert(c *gin.Context) { e.Error(500, err, "创建失败,"+err.Error()) return } - _, err = global.LoadPolicy(c) - if err != nil { - e.Error(500, err, "") - return - } + e.OK(req.GetId(), "创建成功") } @@ -168,11 +164,7 @@ func (e SysRole) Update(c *gin.Context) { e.Logger.Error(err) return } - _, err = global.LoadPolicy(c) - if err != nil { - e.Error(500, err, "") - return - } + e.OK(req.GetId(), "更新成功") } @@ -198,17 +190,14 @@ func (e SysRole) Delete(c *gin.Context) { return } - err = s.Remove(&req) + cb := sdk.Runtime.GetCasbinKey(c.Request.Host) + err = s.Remove(&req, cb) if err != nil { e.Logger.Error(err) e.Error(500, err, "") return } - _, err = global.LoadPolicy(c) - if err != nil { - e.Error(500, err, fmt.Sprintf("删除角色 %v 失败,失败信息 %s", req.GetId(), err.Error())) - return - } + e.OK(req.GetId(), fmt.Sprintf("删除角色角色 %v 状态成功!", req.GetId())) } diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index 6c514045d..b87d20b9b 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -2,6 +2,7 @@ package service import ( "errors" + "github.com/go-admin-team/go-admin-core/sdk/config" "gorm.io/gorm/clause" @@ -102,12 +103,21 @@ func (e *SysRole) Insert(c *dto.SysRoleInsertReq, cb *casbin.SyncedEnforcer) err return err } + mp := make(map[string]interface{}, 0) + polices := make([][]string, 0) for _, menu := range dataMenu { for _, api := range menu.SysApi { - _, err = cb.AddNamedPolicy("p", data.RoleKey, api.Path, api.Action) + if mp[data.RoleKey+"-"+api.Path+"-"+api.Action] != "" { + mp[data.RoleKey+"-"+api.Path+"-"+api.Action] = "" + polices = append(polices, []string{data.RoleKey, api.Path, api.Action}) + } } } - _ = cb.SavePolicy() + _, err = cb.AddNamedPolicies("p", polices) + if err != nil { + return err + } + //if len(c.MenuIds) > 0 { // s := SysRoleMenu{} // s.Orm = e.Orm @@ -176,12 +186,12 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err if err != nil { return err } - _ = cb.SavePolicy() + return nil } // Remove 删除SysRole -func (e *SysRole) Remove(c *dto.SysRoleDeleteReq) error { +func (e *SysRole) Remove(c *dto.SysRoleDeleteReq, cb *casbin.SyncedEnforcer) error { var err error tx := e.Orm if config.DatabaseConfig.Driver != "sqlite3" { @@ -205,6 +215,9 @@ func (e *SysRole) Remove(c *dto.SysRoleDeleteReq) error { if db.RowsAffected == 0 { return errors.New("无权更新该数据") } + + _, _ = cb.RemoveFilteredPolicy(0, model.RoleKey) + return nil } From 953d3b4135956aa51583fe94a3f95bc1b5ca6b84 Mon Sep 17 00:00:00 2001 From: lwnmengjing Date: Tue, 12 Jul 2022 10:55:05 +0800 Subject: [PATCH 067/238] :bug: fix: delete pkg error package --- app/jobs/service/sys_job.go | 2 +- go.mod | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/jobs/service/sys_job.go b/app/jobs/service/sys_job.go index 9d7268ea6..a1ab81081 100644 --- a/app/jobs/service/sys_job.go +++ b/app/jobs/service/sys_job.go @@ -1,7 +1,7 @@ package service import ( - "github.com/pkg/errors" + "errors" "time" "github.com/go-admin-team/go-admin-core/sdk/service" diff --git a/go.mod b/go.mod index 0632556bb..810802f57 100644 --- a/go.mod +++ b/go.mod @@ -16,12 +16,10 @@ require ( github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 - github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 github.com/shirou/gopsutil/v3 v3.22.1 - github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.0.0 github.com/swaggo/gin-swagger v1.2.0 github.com/swaggo/swag v1.6.7 From b268d03e30dd07741ab90c758ee40eed3cd8f5ad Mon Sep 17 00:00:00 2001 From: lwnmengjing Date: Tue, 12 Jul 2022 11:54:24 +0800 Subject: [PATCH 068/238] :green_heart: update workflow --- .github/workflows/dev-lwx.yml | 60 ----------------------------------- .github/workflows/go.yml | 34 ++++++++++---------- Makefile | 6 ++-- 3 files changed, 21 insertions(+), 79 deletions(-) delete mode 100644 .github/workflows/dev-lwx.yml diff --git a/.github/workflows/dev-lwx.yml b/.github/workflows/dev-lwx.yml deleted file mode 100644 index b62a4c6b8..000000000 --- a/.github/workflows/dev-lwx.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: build - -on: - push: - branches: [ dev-lwx ] - pull_request: - branches: [ dev-lwx ] - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.15 - uses: actions/setup-go@v1 - with: - go-version: 1.15 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - name: Build - run: | - CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin . - mv go-admin ./scripts - - - uses: Azure/docker-login@v1 - with: - login-server: registry.cn-shanghai.aliyuncs.com - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - run: | - docker build ./scripts -t registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }} - docker push registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }} - - uses: Azure/k8s-set-context@v1 - with: - kubeconfig: ${{ secrets.KUBE_CONFIG }} - - - uses: Azure/k8s-create-secret@v1 - with: - namespace: 'go-admin' - container-registry-url: registry.cn-shanghai.aliyuncs.com - container-registry-username: ${{ secrets.REGISTRY_USERNAME }} - container-registry-password: ${{ secrets.REGISTRY_PASSWORD }} - secret-name: aliyuncs-k8s-secret - - - uses: Azure/k8s-deploy@v1 - with: - namespace: 'go-admin' - manifests: 'scripts/k8s/deploy.yml' - images: 'registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }}' - imagepullsecrets: 'aliyuncs-k8s-secret' - kubectl-version: 'latest' diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bf741c087..123e1ebf1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,29 +16,23 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.14 - uses: actions/setup-go@v1 + - name: Set up Go 1.15 + uses: actions/setup-go@v3 with: - go-version: 1.14 + go-version: 1.15 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi + run: go mod tidy - name: Build - run: | - ref=${{ github.ref }} - CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin . + run: make build - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v2 + if: startsWith(${{github.ref}}, 'refs/tags/') with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -46,12 +40,20 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + if: startsWith(${{github.ref}}, 'refs/tags/') + uses: docker/metadata-action@v4 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=auto + tags: | + type=schedule + type=ref,event=tag + type=sha,prefix=,format=long,enable=true,priority=100 - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v3 + if: startsWith(${{github.ref}}, 'refs/tags/') with: context: . file: scripts/Dockerfile diff --git a/Makefile b/Makefile index 24509c977..135c7e70e 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,11 @@ PROJECT:=go-admin .PHONY: build build: - CGO_ENABLED=0 go build -o go-admin main.go + CGO_ENABLED=0 go build -ldflags="-w -s" -a -installsuffix -o go-admin . build-linux: - env GOOS=linux GOARCH=amd64 go build + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -a -installsuffix -o go-admin . build-sqlite: - go build -tags sqlite3 -o go-admin main.go + go build -tags sqlite3 -ldflags="-w -s" -a -installsuffix -o go-admin . #.PHONY: test #test: # go test -v ./... -cover From 866714d75e393311291a2525b815106d05226a85 Mon Sep 17 00:00:00 2001 From: siliconhe <920504994@qq.com> Date: Sun, 17 Jul 2022 21:14:26 +0800 Subject: [PATCH 069/238] update doc url of cgo-issue --- README.Zh-cn.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 1e1f3e6f5..ff2b8c95e 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -158,7 +158,7 @@ D:\Code\go-admin>go build cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` -[解决cgo问题进入](https://doc.go-admin.dev/guide/other/faq.html#_5-cgo-exec-missing-cc-exec-missing-cc-file-does-not-exist) +[解决cgo问题进入](https://doc.go-admin.dev/zh-CN/guide/faq#cgo-%E7%9A%84%E9%97%AE%E9%A2%98) ::: diff --git a/README.md b/README.md index c151f080c..efabf3087 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ D:\Code\go-admin>go build cgo: exec gcc: exec: "gcc": executable file not found in %PATH% ``` -[Solve the cgo problem and enter](https://doc.go-admin.dev/guide/other/faq.html#_5-cgo-exec-missing-cc-exec-missing-cc-file-does-not-exist) +[Solve the cgo problem and enter](https://doc.go-admin.dev/guide/faq#cgo-%E7%9A%84%E9%97%AE%E9%A2%98) ::: From f4695361746f4339d50918dc831886d3d978a38e Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Wed, 27 Jul 2022 21:49:24 +0800 Subject: [PATCH 070/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0bcrypt=E5=8C=85=E7=9A=84=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/sys_user.go | 5 +++-- app/admin/service/sys_user.go | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/admin/apis/sys_user.go b/app/admin/apis/sys_user.go index 0bfb61079..ed932ff34 100644 --- a/app/admin/apis/sys_user.go +++ b/app/admin/apis/sys_user.go @@ -4,6 +4,7 @@ import ( "github.com/gin-gonic/gin/binding" "github.com/go-admin-team/go-admin-core/sdk/config" "go-admin/app/admin/models" + "golang.org/x/crypto/bcrypt" "net/http" "github.com/gin-gonic/gin" @@ -356,12 +357,12 @@ func (e SysUser) UpdatePwd(c *gin.Context) { if user.GetUserId(c) == 1 && config.ApplicationConfig.Mode == "demo" { req.NewPassword = "123456" } - + var hash []byte if hash, err = bcrypt.GenerateFromPassword([]byte(req.NewPassword), bcrypt.DefaultCost); err != nil { req.NewPassword = string(hash) } - + err = s.UpdatePwd(user.GetUserId(c), req.OldPassword, req.NewPassword, p) if err != nil { e.Logger.Error(err) diff --git a/app/admin/service/sys_user.go b/app/admin/service/sys_user.go index cdfe30d97..2a03c034a 100644 --- a/app/admin/service/sys_user.go +++ b/app/admin/service/sys_user.go @@ -233,7 +233,9 @@ func (e *SysUser) UpdatePwd(id int, oldPassword, newPassword string, p *actions. return err } c.Password = newPassword - db := e.Orm.Model(c).Where("user_id = ?", id).Select("Password", "Salt").Updates(c) + db := e.Orm.Model(c).Where("user_id = ?", id). + Select("Password", "Salt"). + Updates(c) if err = db.Error; err != nil { e.Log.Errorf("db error: %s", err) return err From 012202478905438be61b0ae3958d4f31df4d340c Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Wed, 27 Jul 2022 21:55:59 +0800 Subject: [PATCH 071/238] =?UTF-8?q?feat=E2=9C=A8:=20=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index 1204cfc6b..510aedbd0 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.0.11" + Version = "2.0.12" ) var ( From b31e1c0d58d3b40f9f317f7e0df3d9f7cd76d5cd Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Wed, 27 Jul 2022 22:27:38 +0800 Subject: [PATCH 072/238] =?UTF-8?q?feat=E2=9C=A8:=20=20=E5=8D=87=E7=BA=A7g?= =?UTF-8?q?o1.18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 102 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 22321ed96..022df7ab4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module go-admin -go 1.15 +go 1.18 require ( github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 @@ -16,7 +16,6 @@ require ( github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 - github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 @@ -26,10 +25,110 @@ require ( github.com/swaggo/swag v1.6.7 github.com/unrolled/secure v1.0.8 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect gorm.io/driver/mysql v1.0.4-0.20201206014609-ae5fd10184f6 gorm.io/driver/postgres v1.0.6-0.20201208020313-1ed927cfab53 gorm.io/driver/sqlite v1.1.5-0.20201206014648-c84401fbe3ba gorm.io/driver/sqlserver v1.0.4 gorm.io/gorm v1.21.11 ) + +require ( + github.com/BurntSushi/toml v0.3.1 // indirect + github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect + github.com/KyleBanks/depth v1.2.1 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bsm/redislock v0.5.0 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/chanxuehong/rand v0.0.0-20201110082127-2f19a1bdd973 // indirect + github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd // indirect + github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc // indirect + github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect + github.com/fatih/color v1.9.0 // indirect + github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/git-chglog/git-chglog v0.0.0-20190611050339-63a4e637021f // indirect + github.com/go-admin-team/go-admin-core/plugins/logger/zap v0.0.0-20210610020726-2db73adb505d // indirect + github.com/go-admin-team/gorm-adapter/v3 v3.2.1-0.20210902112335-4148cb356a24 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-openapi/jsonpointer v0.19.3 // indirect + github.com/go-openapi/jsonreference v0.19.3 // indirect + github.com/go-openapi/spec v0.19.4 // indirect + github.com/go-openapi/swag v0.19.5 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.8.0 // indirect + github.com/go-redis/redis/v7 v7.4.0 // indirect + github.com/go-sql-driver/mysql v1.5.0 // indirect + github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/golang/protobuf v1.4.3 // indirect + github.com/golang/snappy v0.0.1 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/henrylee2cn/ameda v1.4.10 // indirect + github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 // indirect + github.com/imdario/mergo v0.3.9 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.8.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.0.6 // indirect + github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect + github.com/jackc/pgtype v1.6.2 // indirect + github.com/jackc/pgx/v4 v4.10.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.2 // indirect + github.com/json-iterator/go v1.1.11 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect + github.com/mattn/go-colorable v0.1.7 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/mattn/go-sqlite3 v1.14.5 // indirect + github.com/mattn/goveralls v0.0.2 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/mojocn/base64Captcha v1.3.1 // indirect + github.com/nsqio/go-nsq v1.0.8 // indirect + github.com/nyaruka/phonenumbers v1.0.55 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.26.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/robinjoseph08/redisqueue/v2 v2.1.0 // indirect + github.com/shamsher31/goimgext v1.0.0 // indirect + github.com/shirou/gopsutil v2.19.12+incompatible // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/pflag v1.0.3 // indirect + github.com/tklauser/go-sysconf v0.3.9 // indirect + github.com/tklauser/numcpus v0.3.0 // indirect + github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df // indirect + github.com/ugorji/go/codec v1.1.7 // indirect + github.com/urfave/cli v1.22.1 // indirect + github.com/yusufpapurcu/wmi v1.2.2 // indirect + go.uber.org/atomic v1.6.0 // indirect + go.uber.org/multierr v1.5.0 // indirect + go.uber.org/zap v1.15.0 // indirect + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect + golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect + golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect + golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect + golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/protobuf v1.26.0-rc.1 // indirect + gopkg.in/AlecAivazis/survey.v1 v1.8.5 // indirect + gopkg.in/kyokomi/emoji.v1 v1.5.1 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect + gorm.io/plugin/dbresolver v1.1.0 // indirect +) From 0f1b9369dfb2dc22208297cb5e47e6190c6d2c15 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Fri, 29 Jul 2022 18:43:38 +0800 Subject: [PATCH 073/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=94=99=E8=AF=AF=E4=B8=AD=E9=97=B4=E4=BB=B6?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/middleware/customerror.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/middleware/customerror.go b/common/middleware/customerror.go index a16dccbb2..3cfa0191c 100644 --- a/common/middleware/customerror.go +++ b/common/middleware/customerror.go @@ -41,6 +41,11 @@ func CustomError(c *gin.Context) { "code": statusCode, "msg": p[2], }) + } else { + c.JSON(http.StatusOK, gin.H{ + "code": 500, + "msg": "未知异常,请联系管理员!", + }) } default: panic(err) From 83b219458f95c29909449bfa9ce256506bced517 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Fri, 29 Jul 2022 18:44:22 +0800 Subject: [PATCH 074/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E4=B8=ADpaths=E6=9C=AA=E8=AE=BE=E7=BD=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_menu.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index e2d8a35e8..26162f8a0 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -4,6 +4,7 @@ import ( "errors" "github.com/go-admin-team/go-admin-core/sdk/pkg" "gorm.io/gorm" + "strings" "go-admin/app/admin/models" "go-admin/app/admin/service/dto" @@ -92,6 +93,11 @@ func (e *SysMenu) Insert(c *dto.SysMenuInsertReq) *SysMenu { _ = e.AddError(err) } c.MenuId = data.MenuId + err = e.initPaths(&data) + if err != nil { + e.Log.Errorf("db error:%s", err) + _ = e.AddError(err) + } return e } @@ -127,6 +133,7 @@ func (e *SysMenu) Update(c *dto.SysMenuUpdateReq) *SysMenu { var alist = make([]models.SysApi, 0) var model = models.SysMenu{} tx.Preload("SysApi").First(&model, c.GetId()) + oldPath := model.Paths tx.Where("id in ?", c.Apis).Find(&alist) err = tx.Model(&model).Association("SysApi").Delete(model.SysApi) if err != nil { @@ -146,6 +153,12 @@ func (e *SysMenu) Update(c *dto.SysMenuUpdateReq) *SysMenu { _ = e.AddError(errors.New("无权更新该数据")) return e } + var menuList []models.SysMenu + tx.Where("paths like ?", oldPath+"%").Find(&menuList) + for _, v := range menuList { + v.Paths = strings.Replace(v.Paths, oldPath, model.Paths, 1) + tx.Model(&v).Update("paths", v.Paths) + } return e } @@ -331,7 +344,7 @@ func (e *SysMenu) getByRoleName(roleName string) ([]models.SysMenu, error) { MenuList = data } else { role.RoleKey = roleName - buttons := make([]models.SysMenu,0) + buttons := make([]models.SysMenu, 0) err = e.Orm.Debug().Model(&role).Where("role_key = ? ", roleName).Preload("SysMenu", func(db *gorm.DB) *gorm.DB { return db.Where(" menu_type in ('F')").Order("sort") }).Find(&role).Error From f43cd117e3942589b9c1c24004bf84e986567b75 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Fri, 29 Jul 2022 18:47:12 +0800 Subject: [PATCH 075/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=88=9B=E5=BB=BA=E5=92=8C=E6=9B=B4=E6=96=B0=E5=90=8E?= =?UTF-8?q?=E9=87=8D=E6=96=B0load=20policy=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/sys_role.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/admin/apis/sys_role.go b/app/admin/apis/sys_role.go index 1a1e75b0a..d7ee1e7f3 100644 --- a/app/admin/apis/sys_role.go +++ b/app/admin/apis/sys_role.go @@ -2,6 +2,7 @@ package apis import ( "fmt" + "go-admin/common/global" "net/http" "github.com/gin-gonic/gin/binding" @@ -128,7 +129,12 @@ func (e SysRole) Insert(c *gin.Context) { e.Error(500, err, "创建失败,"+err.Error()) return } - + _, err = global.LoadPolicy(c) + if err != nil { + e.Logger.Error(err) + e.Error(500, err, "创建失败,"+err.Error()) + return + } e.OK(req.GetId(), "创建成功") } @@ -165,6 +171,13 @@ func (e SysRole) Update(c *gin.Context) { return } + _, err = global.LoadPolicy(c) + if err != nil { + e.Logger.Error(err) + e.Error(500, err, "更新失败,"+err.Error()) + return + } + e.OK(req.GetId(), "更新成功") } From 260eedfcc66a505dbf1e6400567084dd05e1ce8a Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Fri, 29 Jul 2022 18:50:46 +0800 Subject: [PATCH 076/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=A4=B1=E6=95=88=E6=96=87=E6=A1=A3=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index ff2b8c95e..e38d420b8 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -13,10 +13,6 @@ [在线文档](https://doc.go-admin.dev) -[github在线文档](https://wenjianzhang.github.io) - -[gitee在线文档](http://mydearzwj.gitee.io/go-admin-doc/) - [前端项目](https://github.com/go-admin-team/go-admin-ui) [视频教程](https://space.bilibili.com/565616721/channel/detail?cid=125737) From 255c72d3f161bae77deb3a46a9c3e1e5e68e85fb Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Fri, 29 Jul 2022 18:51:55 +0800 Subject: [PATCH 077/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20update=20ver?= =?UTF-8?q?sion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index 510aedbd0..6f40ad99e 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.0.12" + Version = "2.1.0" ) var ( From ef41e07550973631ca30b21ae71e1eb48b1e900e Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Thu, 4 Aug 2022 17:24:07 +0800 Subject: [PATCH 078/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 8 ++++++++ README.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 1e1f3e6f5..0185faa20 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -100,6 +100,14 @@ ## 📦 本地开发 +### 环境要求 + +go 1.17 + +node版本: v14.16.0 + +npm版本: 6.14.11 + ### 开发目录创建 ```bash diff --git a/README.md b/README.md index c151f080c..c41e35eab 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,14 @@ At the same time, a series of tutorials including videos and documents are provi ## 📦 Local development +### Environmental requirements + +go 1.17 + +nodejs: v14.16.0 + +npm: 6.14.11 + ### Development directory creation ```bash From 86f94a2cb92780a62c2380b10baafa8f0e930dcd Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Thu, 4 Aug 2022 17:24:53 +0800 Subject: [PATCH 079/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20errors=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0go=20mod?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 28fc04856..0632556bb 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 + github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 From c53c4fd9f860e8e61ebdb4f958423188182afe30 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 7 Aug 2022 20:42:24 +0800 Subject: [PATCH 080/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20update=20rea?= =?UTF-8?q?dme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index e38d420b8..d77e28e3e 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -247,12 +247,32 @@ npm run dev -## 💎 主要成员 - - - - - +## 💎 贡献者 + + + + + + + + + + + + + + + + + + + + + + + + + ## JetBrains 开源证书支持 From 98c495abb140543c73c2d7e3e80410f6498e3a18 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 7 Aug 2022 20:43:34 +0800 Subject: [PATCH 081/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20update=20rea?= =?UTF-8?q?dme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index efabf3087..9e5e4253b 100644 --- a/README.md +++ b/README.md @@ -233,12 +233,33 @@ npm run dev -## 💎 Members - - - - - +## 💎 Contributors + + + + + + + + + + + + + + + + + + + + + + + + + + From 86187e4c79bda201ae9cba0259f8602495af1169 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 7 Aug 2022 21:49:24 +0800 Subject: [PATCH 082/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=8E=B7=E5=8F=96=E8=8F=9C=E5=8D=95=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?menurole=EF=BC=8C=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=20(#676)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_menu.go | 67 +++++++++++++++-------------------- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index 26162f8a0..1bdb37462 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -1,8 +1,8 @@ package service import ( - "errors" "github.com/go-admin-team/go-admin-core/sdk/pkg" + "github.com/pkg/errors" "gorm.io/gorm" "strings" @@ -334,55 +334,46 @@ func (e *SysMenu) SetMenuRole(roleName string) (m []models.SysMenu, err error) { } func (e *SysMenu) getByRoleName(roleName string) ([]models.SysMenu, error) { - var MenuList []models.SysMenu var role models.SysRole var err error if roleName == "admin" { var data []models.SysMenu - err = e.Orm.Where(" menu_type in ('M','C')").Order("sort").Find(&data).Error - MenuList = data + err = e.Orm.Where(" menu_type in ('M','C') and deleted_at is null and created_at>'2021-08-13'"). + Order("sort"). + Find(&data). + Error + err = errors.WithStack(err) + return data, err } else { role.RoleKey = roleName - buttons := make([]models.SysMenu, 0) - err = e.Orm.Debug().Model(&role).Where("role_key = ? ", roleName).Preload("SysMenu", func(db *gorm.DB) *gorm.DB { - return db.Where(" menu_type in ('F')").Order("sort") - }).Find(&role).Error - if role.SysMenu != nil { - buttons = *role.SysMenu - } - mIds := make([]int, 0) - for _, menu := range buttons { - if menu.ParentId != 0 { - mIds = append(mIds, menu.ParentId) - } - } - var dataC []models.SysMenu - err = e.Orm.Where(" menu_type in ('C') and menu_id in ?", mIds).Order("sort").Find(&dataC).Error - if err != nil { - return nil, err - } - for _, datum := range dataC { - MenuList = append(MenuList, datum) - } - cIds := make([]int, 0) + err = e.Orm. + Model(&role). + Where("role_key = ? ", roleName). + Preload("SysMenu", func(db *gorm.DB) *gorm.DB { + return db.Where(" menu_type in ('F','C')").Order("sort") + }). + Find(&role).Error + MenuList := *role.SysMenu + mIds := make([]string, 0) + mp := make(map[string]string, 0) for _, menu := range MenuList { - if menu.ParentId != 0 { - cIds = append(cIds, menu.ParentId) + ids := strings.Split(menu.Paths, "/") + for _, id := range ids { + if mp[id] == "" { + mp[id] = id + mIds = append(mIds, id) + } } } - var dataM []models.SysMenu - err = e.Orm.Where(" menu_type in ('M') and menu_id in ?", cIds).Order("sort").Find(&dataM).Error + var data []models.SysMenu + err = e.Orm.Where(" menu_id in ? and menu_type in ('M','C')", mIds). + Order("sort"). + Find(&data). + Error if err != nil { return nil, err } - for _, datum := range dataM { - MenuList = append(MenuList, datum) - } + return data, err } - - if err != nil { - e.Log.Errorf("db error:%s", err) - } - return MenuList, err } From 8a3c50ea1ac860f30a9d4e7c98d42b3858a53098 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 7 Aug 2022 21:52:02 +0800 Subject: [PATCH 083/238] =?UTF-8?q?config=F0=9F=94=A7:=20=20=20=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9actions=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 123e1ebf1..fb65e63ff 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,10 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.15 + - name: Set up Go 1.18 uses: actions/setup-go@v3 with: - go-version: 1.15 + go-version: 1.18 id: go - name: Check out code into the Go module directory From 087ba38c243cbcaebedd7bf0d86721a49345ed86 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 8 Aug 2022 09:22:36 +0800 Subject: [PATCH 084/238] =?UTF-8?q?config=F0=9F=94=A7:=20=20=20=20update?= =?UTF-8?q?=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 2 ++ README.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index d77e28e3e..34dae53d3 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -254,6 +254,7 @@ npm run dev + @@ -274,6 +275,7 @@ npm run dev + ## JetBrains 开源证书支持 `go-admin` 项目一直以来都是在 JetBrains 公司旗下的 GoLand 集成开发环境中进行开发,基于 **free JetBrains Open Source license(s)** 正版免费授权,在此表达我的谢意。 diff --git a/README.md b/README.md index 9e5e4253b..d3c5fff28 100644 --- a/README.md +++ b/README.md @@ -235,12 +235,12 @@ npm run dev ## 💎 Contributors - + From 50a3b39666121a0c3d1023302427911c9289e228 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 8 Aug 2022 09:26:14 +0800 Subject: [PATCH 085/238] =?UTF-8?q?config=F0=9F=94=A7:=20Modify=20the=20cl?= =?UTF-8?q?ient=20IP=20acquisition=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/middleware/customerror.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/middleware/customerror.go b/common/middleware/customerror.go index 3cfa0191c..121a2e7a4 100644 --- a/common/middleware/customerror.go +++ b/common/middleware/customerror.go @@ -2,7 +2,6 @@ package middleware import ( "fmt" - "go-admin/common" "net/http" "strconv" "strings" @@ -34,7 +33,7 @@ func CustomError(c *gin.Context) { c.Request.URL, statusCode, c.Request.RequestURI, - common.GetClientIP(c), + c.ClientIP(), p[2], ) c.JSON(http.StatusOK, gin.H{ From bccbd67450454ffa4c7985579dbbc232c8b7253f Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 8 Aug 2022 09:42:31 +0800 Subject: [PATCH 086/238] =?UTF-8?q?config=F0=9F=94=A7:=20update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 28 ++++++++++++++++++++-------- README.md | 28 ++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 34dae53d3..4126e0655 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -17,6 +17,14 @@ [视频教程](https://space.bilibili.com/565616721/channel/detail?cid=125737) +## 🎬 在线体验 + +vue体验:[https://www.go-admin.dev](https://www.go-admin.dev/#/login) +> ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 + +antd体验:[https://preview.go-admin.dev](https://preview.go-admin.dev/) +> ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 + ## ✨ 特性 - 遵循 RESTful API 设计规范 @@ -96,6 +104,14 @@ ## 📦 本地开发 +### 环境要求 + +go 1.18 + +node版本: v14.16.0 + +npm版本: 6.14.11 + ### 开发目录创建 ```bash @@ -226,12 +242,6 @@ npm install --registry=https://registry.npm.taobao.org npm run dev ``` -## 🎬 在线体验 - -> admin / 123456 - -演示地址:[http://www.go-admin.dev](http://www.go-admin.dev/#/login) - ## 📨 互动 @@ -284,7 +294,8 @@ npm run dev ## 🤝 特别感谢 -1. [chengxiao](https://github.com/chengxiao) +1. [ant-design](https://github.com/ant-design/ant-design) +2. [ant-design-pro](https://github.com/ant-design/ant-design-pro) 2. [gin](https://github.com/gin-gonic/gin) 2. [casbin](https://github.com/casbin/casbin) 2. [spf13/viper](https://github.com/spf13/viper) @@ -295,6 +306,7 @@ npm run dev 2. [ruoyi-vue](https://gitee.com/y_project/RuoYi-Vue) 2. [form-generator](https://github.com/JakHuang/form-generator) + ## 🤟 打赏 > 如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励 :tropical_drink: @@ -309,4 +321,4 @@ npm run dev [MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md) -Copyright (c) 2020 wenjianzhang +Copyright (c) 2022 wenjianzhang diff --git a/README.md b/README.md index d3c5fff28..596e5d4c9 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,14 @@ The front-end and back-end separation authority management system based on Gin + [Video tutorial](https://space.bilibili.com/565616721/channel/detail?cid=125737) +## 🎬 Online Demo + +vue demo:[https://www.go-admin.dev](https://www.go-admin.dev/#/login) +> 账号 / 密码: admin / 123456 + +antd demo:[https://preview.go-admin.dev](https://preview.go-admin.dev/) +> 账号 / 密码: admin / 123456 +> ## ✨ Feature - Follow RESTful API design specifications @@ -94,6 +102,14 @@ At the same time, a series of tutorials including videos and documents are provi ## 📦 Local development +### Environmental requirements + +go 1.18 + +nodejs: v14.16.0 + +npm: 6.14.11 + ### Development directory creation ```bash @@ -214,12 +230,6 @@ npm install # or cnpm install npm run dev ``` -## 🎬 Online Demo -> admin / 123456 - -演示地址:[http://www.go-admin.dev](http://www.go-admin.dev/#/login) - - ## 📨 Interactive
@@ -271,7 +281,9 @@ The `go-admin` project has always been developed in the GoLand integrated develo ## 🤝 Thanks -1. [chengxiao](https://github.com/chengxiao) + +1. [ant-design](https://github.com/ant-design/ant-design) +2. [ant-design-pro](https://github.com/ant-design/ant-design-pro) 2. [gin](https://github.com/gin-gonic/gin) 2. [casbin](https://github.com/casbin/casbin) 2. [spf13/viper](https://github.com/spf13/viper) @@ -295,4 +307,4 @@ The `go-admin` project has always been developed in the GoLand integrated develo [MIT](https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md) -Copyright (c) 2020 wenjianzhang +Copyright (c) 2022 wenjianzhang From 09bfdc3d395733c90c4f2d6ad37dd061cf30e8f5 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 8 Aug 2022 10:15:29 +0800 Subject: [PATCH 087/238] =?UTF-8?q?config=F0=9F=94=A7:=20set=20DB=20CHARSE?= =?UTF-8?q?T=20utf8mb4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/migrate/migration/version/1599190683659_tables.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/migrate/migration/version/1599190683659_tables.go b/cmd/migrate/migration/version/1599190683659_tables.go index 647807884..5862dae31 100644 --- a/cmd/migrate/migration/version/1599190683659_tables.go +++ b/cmd/migrate/migration/version/1599190683659_tables.go @@ -17,7 +17,7 @@ func init() { func _1599190683659Tables(db *gorm.DB, version string) error { return db.Transaction(func(tx *gorm.DB) error { - err := tx.Debug().Migrator().AutoMigrate( + err := tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4").Migrator().AutoMigrate( new(models.CasbinRule), new(models.SysDept), new(models.SysConfig), From 1bea64bb6d1e87eb04199f76aaf108b0ddde808a Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 8 Aug 2022 10:16:43 +0800 Subject: [PATCH 088/238] =?UTF-8?q?config=F0=9F=94=A7:=20set=20DB=20CHARSE?= =?UTF-8?q?T=20utf8mb4(#674)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/migrate/migration/version/1599190683659_tables.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/migrate/migration/version/1599190683659_tables.go b/cmd/migrate/migration/version/1599190683659_tables.go index 5862dae31..64aa97063 100644 --- a/cmd/migrate/migration/version/1599190683659_tables.go +++ b/cmd/migrate/migration/version/1599190683659_tables.go @@ -17,7 +17,7 @@ func init() { func _1599190683659Tables(db *gorm.DB, version string) error { return db.Transaction(func(tx *gorm.DB) error { - err := tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4").Migrator().AutoMigrate( + err := tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ").Migrator().AutoMigrate( new(models.CasbinRule), new(models.SysDept), new(models.SysConfig), From 9a596397ca63c03d4bf84f1e9bf9ceedf6de4111 Mon Sep 17 00:00:00 2001 From: Vingurzhou Date: Mon, 8 Aug 2022 11:28:55 +0800 Subject: [PATCH 089/238] Update 1599190683659_tables.go --- cmd/migrate/migration/version/1599190683659_tables.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/migrate/migration/version/1599190683659_tables.go b/cmd/migrate/migration/version/1599190683659_tables.go index 64aa97063..5862dae31 100644 --- a/cmd/migrate/migration/version/1599190683659_tables.go +++ b/cmd/migrate/migration/version/1599190683659_tables.go @@ -17,7 +17,7 @@ func init() { func _1599190683659Tables(db *gorm.DB, version string) error { return db.Transaction(func(tx *gorm.DB) error { - err := tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ").Migrator().AutoMigrate( + err := tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4").Migrator().AutoMigrate( new(models.CasbinRule), new(models.SysDept), new(models.SysConfig), From 8bfee8af1667cf53f04f992f050d6554a914fc2d Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 8 Aug 2022 16:28:26 +0800 Subject: [PATCH 090/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=8F=9C=E5=8D=95paths=E9=BB=98=E8=AE=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../version/1653638869132_migrate.go | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cmd/migrate/migration/version/1653638869132_migrate.go diff --git a/cmd/migrate/migration/version/1653638869132_migrate.go b/cmd/migrate/migration/version/1653638869132_migrate.go new file mode 100644 index 000000000..59a8fa049 --- /dev/null +++ b/cmd/migrate/migration/version/1653638869132_migrate.go @@ -0,0 +1,48 @@ +package version + +import ( + "go-admin/cmd/migrate/migration/models" + common "go-admin/common/models" + "gorm.io/gorm" + "runtime" + "strconv" + + "go-admin/cmd/migrate/migration" +) + +func init() { + _, fileName, _, _ := runtime.Caller(0) + migration.Migrate.SetVersion(migration.GetFilename(fileName), _1653638869132Test) +} + +func _1653638869132Test(db *gorm.DB, version string) error { + return db.Transaction(func(tx *gorm.DB) error { + var list []models.SysMenu + err := tx.Model(&models.SysMenu{}).Order("parent_id,menu_id").Find(&list).Error + if err != nil { + return err + } + for _, v := range list { + if v.ParentId == 0 { + v.Paths = "/0/" + strconv.Itoa(v.MenuId) + } else { + var e models.SysMenu + err = tx.Model(&models.SysMenu{}).Where("menu_id=?", v.ParentId).First(&e).Error + if err != nil { + if err == gorm.ErrRecordNotFound { + continue + } + return err + } + v.Paths = e.Paths + "/" + strconv.Itoa(v.MenuId) + } + err = tx.Model(&v).Update("paths", v.Paths).Error + if err != nil { + return err + } + } + return tx.Create(&common.Migration{ + Version: version, + }).Error + }) +} From ef6b85faeca829e1b7dfcc8a41b332c2a92e7761 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 8 Aug 2022 18:02:50 +0800 Subject: [PATCH 091/238] =?UTF-8?q?config=F0=9F=94=A7:=20Modify=20the=20in?= =?UTF-8?q?struction=20createapp=20to=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/app/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/app/server.go b/cmd/app/server.go index 8eaae50eb..013ac3843 100644 --- a/cmd/app/server.go +++ b/cmd/app/server.go @@ -13,10 +13,10 @@ import ( var ( appName string StartCmd = &cobra.Command{ - Use: "createapp", + Use: "app", Short: "Create a new app", Long: "Use when you need to create a new app", - Example: "go-admin createapp -n admin", + Example: "go-admin app -n admin", Run: func(cmd *cobra.Command, args []string) { run() }, @@ -87,4 +87,4 @@ func genFile() error { err = t2.Execute(&b2, nil) pkg.FileCreate(b2, appPath+"/router/router.go") return nil -} \ No newline at end of file +} From 7e571b038fc59793df649450dde58a840041eac0 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 9 Aug 2022 10:18:21 +0800 Subject: [PATCH 092/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20fix=20rolemenu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_menu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index 1bdb37462..beb9ccd27 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -339,7 +339,7 @@ func (e *SysMenu) getByRoleName(roleName string) ([]models.SysMenu, error) { if roleName == "admin" { var data []models.SysMenu - err = e.Orm.Where(" menu_type in ('M','C') and deleted_at is null and created_at>'2021-08-13'"). + err = e.Orm.Where(" menu_type in ('M','C') and deleted_at is null"). Order("sort"). Find(&data). Error From f94b4378526e9d3d0e0264bdaf5e71c7eca10f56 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 9 Aug 2022 12:59:31 +0800 Subject: [PATCH 093/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20fix=20github.com/?= =?UTF-8?q?alibaba/sentinel-golang=20middleware?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/middleware/sentinel.go | 11 +++++++++-- go.mod | 11 +++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/common/middleware/sentinel.go b/common/middleware/sentinel.go index c4ea95a14..55f1d77d7 100644 --- a/common/middleware/sentinel.go +++ b/common/middleware/sentinel.go @@ -1,8 +1,8 @@ package middleware import ( - sentinelPlugin "github.com/alibaba/sentinel-golang/adapter/gin" "github.com/alibaba/sentinel-golang/core/system" + sentinel "github.com/alibaba/sentinel-golang/pkg/adapters/gin" "github.com/gin-gonic/gin" log "github.com/go-admin-team/go-admin-core/logger" @@ -19,5 +19,12 @@ func Sentinel() gin.HandlerFunc { }); err != nil { log.Fatalf("Unexpected error: %+v", err) } - return sentinelPlugin.SentinelMiddleware() + return sentinel.SentinelMiddleware( + sentinel.WithBlockFallback(func(ctx *gin.Context) { + ctx.AbortWithStatusJSON(200, map[string]interface{}{ + "msg": "too many request; the quota used up", + "code": 500, + }) + }), + ) } diff --git a/go.mod b/go.mod index 022df7ab4..465da014e 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,8 @@ go 1.18 require ( github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 - github.com/alibaba/sentinel-golang v0.6.1 + github.com/alibaba/sentinel-golang v1.0.4 + github.com/alibaba/sentinel-golang/pkg/adapters/gin v0.0.0-20220808015021-c5f1f1d055c5 github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5 github.com/bitly/go-simplejson v0.5.0 github.com/bytedance/go-tagexpr/v2 v2.7.12 @@ -16,6 +17,7 @@ require ( github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 + github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 @@ -38,12 +40,13 @@ require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect + github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bsm/redislock v0.5.0 // indirect github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/chanxuehong/rand v0.0.0-20201110082127-2f19a1bdd973 // indirect github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect github.com/fatih/color v1.9.0 // indirect @@ -98,14 +101,14 @@ require ( github.com/mojocn/base64Captcha v1.3.1 // indirect github.com/nsqio/go-nsq v1.0.8 // indirect github.com/nyaruka/phonenumbers v1.0.55 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/robinjoseph08/redisqueue/v2 v2.1.0 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/shamsher31/goimgext v1.0.0 // indirect - github.com/shirou/gopsutil v2.19.12+incompatible // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.3 // indirect github.com/tklauser/go-sysconf v0.3.9 // indirect From d40a0c083753a24889701cbbccb42bc50f9a99b9 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 9 Aug 2022 13:00:32 +0800 Subject: [PATCH 094/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20fix=20github.com/?= =?UTF-8?q?alibaba/sentinel-golang=20middleware(#679)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/middleware/sentinel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/middleware/sentinel.go b/common/middleware/sentinel.go index 55f1d77d7..603559ac4 100644 --- a/common/middleware/sentinel.go +++ b/common/middleware/sentinel.go @@ -22,7 +22,7 @@ func Sentinel() gin.HandlerFunc { return sentinel.SentinelMiddleware( sentinel.WithBlockFallback(func(ctx *gin.Context) { ctx.AbortWithStatusJSON(200, map[string]interface{}{ - "msg": "too many request; the quota used up", + "msg": "too many request; the quota used up!", "code": 500, }) }), From 096663ac918142e2921d7912bb7e07451b4e6080 Mon Sep 17 00:00:00 2001 From: zhangzhenlun <@zhangzhenlun> Date: Tue, 9 Aug 2022 14:10:22 +0800 Subject: [PATCH 095/238] =?UTF-8?q?fix=F0=9F=90=9B:=20fix=20rolemenu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/models/sys_menu.go | 6 +++ app/admin/service/sys_menu.go | 82 ++++++++++++++++++++++------------- 2 files changed, 59 insertions(+), 29 deletions(-) diff --git a/app/admin/models/sys_menu.go b/app/admin/models/sys_menu.go index cd520e35c..c8c02786e 100644 --- a/app/admin/models/sys_menu.go +++ b/app/admin/models/sys_menu.go @@ -30,6 +30,12 @@ type SysMenu struct { models.ModelTime } +type SysMenuSlice []SysMenu + +func (x SysMenuSlice) Len() int { return len(x) } +func (x SysMenuSlice) Less(i, j int) bool { return x[i].MenuId < x[j].MenuId } +func (x SysMenuSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + func (SysMenu) TableName() string { return "sys_menu" } diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index beb9ccd27..6779c740a 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -1,10 +1,13 @@ package service import ( + "fmt" + "sort" + "strings" + "github.com/go-admin-team/go-admin-core/sdk/pkg" "github.com/pkg/errors" "gorm.io/gorm" - "strings" "go-admin/app/admin/models" "go-admin/app/admin/service/dto" @@ -319,6 +322,40 @@ func menuCall(menuList *[]models.SysMenu, menu models.SysMenu) models.SysMenu { return menu } +func menuDistinct(menuList []models.SysMenu) (result []models.SysMenu) { + distinctMap := make(map[int]struct{}, len(menuList)) + for _, menu := range menuList { + if _, ok := distinctMap[menu.MenuId]; !ok { + distinctMap[menu.MenuId] = struct{}{} + result = append(result, menu) + } + } + return result +} + +func recursiveSetMenu(orm *gorm.DB, mIds []int, menus *[]models.SysMenu) error { + if len(mIds) == 0 || menus == nil { + return nil + } + var subMenus []models.SysMenu + err := orm.Where(fmt.Sprintf(" menu_type in ('%s', '%s', '%s') and menu_id in ?", + cModels.Directory, cModels.Menu, cModels.Button), mIds).Order("sort").Find(&subMenus).Error + if err != nil { + return err + } + + subIds := make([]int, 0) + for _, menu := range subMenus { + if menu.ParentId != 0 { + subIds = append(subIds, menu.ParentId) + } + if menu.MenuType != cModels.Button { + *menus = append(*menus, menu) + } + } + return recursiveSetMenu(orm, subIds, menus) +} + // SetMenuRole 获取左侧菜单树使用 func (e *SysMenu) SetMenuRole(roleName string) (m []models.SysMenu, err error) { menus, err := e.getByRoleName(roleName) @@ -336,44 +373,31 @@ func (e *SysMenu) SetMenuRole(roleName string) (m []models.SysMenu, err error) { func (e *SysMenu) getByRoleName(roleName string) ([]models.SysMenu, error) { var role models.SysRole var err error + data := make([]models.SysMenu, 0) if roleName == "admin" { - var data []models.SysMenu err = e.Orm.Where(" menu_type in ('M','C') and deleted_at is null"). Order("sort"). Find(&data). Error err = errors.WithStack(err) - return data, err } else { role.RoleKey = roleName - err = e.Orm. - Model(&role). - Where("role_key = ? ", roleName). - Preload("SysMenu", func(db *gorm.DB) *gorm.DB { - return db.Where(" menu_type in ('F','C')").Order("sort") - }). - Find(&role).Error - MenuList := *role.SysMenu - mIds := make([]string, 0) - mp := make(map[string]string, 0) - for _, menu := range MenuList { - ids := strings.Split(menu.Paths, "/") - for _, id := range ids { - if mp[id] == "" { - mp[id] = id - mIds = append(mIds, id) - } + err = e.Orm.Model(&role).Where("role_key = ? ", roleName).Preload("SysMenu").First(&role).Error + + if role.SysMenu != nil { + mIds := make([]int, 0) + for _, menu := range *role.SysMenu { + mIds = append(mIds, menu.MenuId) } + if err := recursiveSetMenu(e.Orm, mIds, &data); err != nil { + return nil, err + } + + data = menuDistinct(data) } - var data []models.SysMenu - err = e.Orm.Where(" menu_id in ? and menu_type in ('M','C')", mIds). - Order("sort"). - Find(&data). - Error - if err != nil { - return nil, err - } - return data, err } + + sort.Sort(models.SysMenuSlice(data)) + return data, err } From a6ffac657ea78041a7bf323b36daef2f3966bb05 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 9 Aug 2022 15:20:45 +0800 Subject: [PATCH 096/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20Add=20MySQL=20jud?= =?UTF-8?q?gment=20in=20data=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/migrate/migration/version/1599190683659_tables.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/migrate/migration/version/1599190683659_tables.go b/cmd/migrate/migration/version/1599190683659_tables.go index 5862dae31..bc4bda7d6 100644 --- a/cmd/migrate/migration/version/1599190683659_tables.go +++ b/cmd/migrate/migration/version/1599190683659_tables.go @@ -1,6 +1,7 @@ package version import ( + "github.com/go-admin-team/go-admin-core/sdk/config" "runtime" "go-admin/cmd/migrate/migration" @@ -17,7 +18,10 @@ func init() { func _1599190683659Tables(db *gorm.DB, version string) error { return db.Transaction(func(tx *gorm.DB) error { - err := tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4").Migrator().AutoMigrate( + if config.DatabaseConfig.Driver == "mysql" { + tx = tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4") + } + err := tx.Migrator().AutoMigrate( new(models.CasbinRule), new(models.SysDept), new(models.SysConfig), From 289fbba8e0ae14624afdfe249f4358a5beacbc79 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 9 Aug 2022 18:17:06 +0800 Subject: [PATCH 097/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=20update=20c?= =?UTF-8?q?asbin=20gorm=20adapter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/models/casbin_rule.go | 15 ++++++++------- cmd/migrate/migration/models/casbin_rule.go | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/admin/models/casbin_rule.go b/app/admin/models/casbin_rule.go index 014e2fd18..078df3d08 100644 --- a/app/admin/models/casbin_rule.go +++ b/app/admin/models/casbin_rule.go @@ -2,13 +2,14 @@ package models //sys_casbin_rule type CasbinRule struct { - PType string `json:"p_type" gorm:"size:100;"` - V0 string `json:"v0" gorm:"size:100;"` - V1 string `json:"v1" gorm:"size:100;"` - V2 string `json:"v2" gorm:"size:100;"` - V3 string `json:"v3" gorm:"size:100;"` - V4 string `json:"v4" gorm:"size:100;"` - V5 string `json:"v5" gorm:"size:100;"` + ID uint `gorm:"primaryKey;autoIncrement"` + Ptype string `gorm:"size:512;uniqueIndex:unique_index"` + V0 string `gorm:"size:512;uniqueIndex:unique_index"` + V1 string `gorm:"size:512;uniqueIndex:unique_index"` + V2 string `gorm:"size:512;uniqueIndex:unique_index"` + V3 string `gorm:"size:512;uniqueIndex:unique_index"` + V4 string `gorm:"size:512;uniqueIndex:unique_index"` + V5 string `gorm:"size:512;uniqueIndex:unique_index"` } func (CasbinRule) TableName() string { diff --git a/cmd/migrate/migration/models/casbin_rule.go b/cmd/migrate/migration/models/casbin_rule.go index 014e2fd18..078df3d08 100644 --- a/cmd/migrate/migration/models/casbin_rule.go +++ b/cmd/migrate/migration/models/casbin_rule.go @@ -2,13 +2,14 @@ package models //sys_casbin_rule type CasbinRule struct { - PType string `json:"p_type" gorm:"size:100;"` - V0 string `json:"v0" gorm:"size:100;"` - V1 string `json:"v1" gorm:"size:100;"` - V2 string `json:"v2" gorm:"size:100;"` - V3 string `json:"v3" gorm:"size:100;"` - V4 string `json:"v4" gorm:"size:100;"` - V5 string `json:"v5" gorm:"size:100;"` + ID uint `gorm:"primaryKey;autoIncrement"` + Ptype string `gorm:"size:512;uniqueIndex:unique_index"` + V0 string `gorm:"size:512;uniqueIndex:unique_index"` + V1 string `gorm:"size:512;uniqueIndex:unique_index"` + V2 string `gorm:"size:512;uniqueIndex:unique_index"` + V3 string `gorm:"size:512;uniqueIndex:unique_index"` + V4 string `gorm:"size:512;uniqueIndex:unique_index"` + V5 string `gorm:"size:512;uniqueIndex:unique_index"` } func (CasbinRule) TableName() string { From 852cfa66e848f2feae71d29699e54dafab55a41a Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 9 Aug 2022 18:17:42 +0800 Subject: [PATCH 098/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=20remove=20c?= =?UTF-8?q?asbin=20sys=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/database/initialize.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/database/initialize.go b/common/database/initialize.go index 501f523b5..22e6d6170 100644 --- a/common/database/initialize.go +++ b/common/database/initialize.go @@ -58,7 +58,7 @@ func setupSimpleDatabase(host string, c *toolsConfig.Database) { log.Info(pkg.Green(c.Driver + " connect success !")) } - e := mycasbin.Setup(db, "sys_") + e := mycasbin.Setup(db, "") sdk.Runtime.SetDb(host, db) sdk.Runtime.SetCasbin(host, e) From b97bde11b2206fa8d75ace84127b7ebc749c0d1c Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 9 Aug 2022 18:19:02 +0800 Subject: [PATCH 099/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=20upgrade=20?= =?UTF-8?q?gorm,casbin,gin,uuid=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 68 ++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index 465da014e..f7de68684 100644 --- a/go.mod +++ b/go.mod @@ -9,11 +9,11 @@ require ( github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5 github.com/bitly/go-simplejson v0.5.0 github.com/bytedance/go-tagexpr/v2 v2.7.12 - github.com/casbin/casbin/v2 v2.25.1 - github.com/gin-gonic/gin v1.7.3 - github.com/go-admin-team/go-admin-core v1.3.8 - github.com/go-admin-team/go-admin-core/sdk v1.3.9 - github.com/google/uuid v1.2.0 + github.com/casbin/casbin/v2 v2.51.2 + github.com/gin-gonic/gin v1.7.7 + github.com/go-admin-team/go-admin-core v1.4.1-0.20220809101213-21187928f7d9 + github.com/go-admin-team/go-admin-core/sdk v1.4.1-0.20220809101213-21187928f7d9 + github.com/google/uuid v1.3.0 github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 @@ -26,12 +26,12 @@ require ( github.com/swaggo/gin-swagger v1.2.0 github.com/swaggo/swag v1.6.7 github.com/unrolled/secure v1.0.8 - golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 - gorm.io/driver/mysql v1.0.4-0.20201206014609-ae5fd10184f6 - gorm.io/driver/postgres v1.0.6-0.20201208020313-1ed927cfab53 - gorm.io/driver/sqlite v1.1.5-0.20201206014648-c84401fbe3ba - gorm.io/driver/sqlserver v1.0.4 - gorm.io/gorm v1.21.11 + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 + gorm.io/driver/mysql v1.3.5 + gorm.io/driver/postgres v1.3.8 + gorm.io/driver/sqlite v1.3.6 + gorm.io/driver/sqlserver v1.3.2 + gorm.io/gorm v1.23.8 ) require ( @@ -43,19 +43,20 @@ require ( github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bsm/redislock v0.5.0 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/casbin/redis-watcher/v2 v2.0.0-20220614104201-0e70bf2be930 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chanxuehong/rand v0.0.0-20201110082127-2f19a1bdd973 // indirect github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect - github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc // indirect - github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect + github.com/denisenkom/go-mssqldb v0.12.0 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.9.0 // indirect - github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/git-chglog/git-chglog v0.0.0-20190611050339-63a4e637021f // indirect github.com/go-admin-team/go-admin-core/plugins/logger/zap v0.0.0-20210610020726-2db73adb505d // indirect - github.com/go-admin-team/gorm-adapter/v3 v3.2.1-0.20210902112335-4148cb356a24 // indirect + github.com/go-admin-team/gorm-adapter/v3 v3.7.8-0.20220809100335-eaf9f67b3d21 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.19.3 // indirect github.com/go-openapi/jsonreference v0.19.3 // indirect @@ -65,8 +66,11 @@ require ( github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-playground/validator/v10 v10.8.0 // indirect github.com/go-redis/redis/v7 v7.4.0 // indirect - github.com/go-sql-driver/mysql v1.5.0 // indirect - github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect + github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/golang-jwt/jwt/v4 v4.4.2 // indirect + github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect + github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/protobuf v1.4.3 // indirect github.com/golang/snappy v0.0.1 // indirect @@ -76,23 +80,23 @@ require ( github.com/imdario/mergo v0.3.9 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect - github.com/jackc/pgconn v1.8.0 // indirect + github.com/jackc/pgconn v1.12.1 // indirect github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgproto3/v2 v2.0.6 // indirect + github.com/jackc/pgproto3/v2 v2.3.0 // indirect github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect - github.com/jackc/pgtype v1.6.2 // indirect - github.com/jackc/pgx/v4 v4.10.0 // indirect + github.com/jackc/pgtype v1.11.0 // indirect + github.com/jackc/pgx/v4 v4.16.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect - github.com/jinzhu/now v1.1.2 // indirect + github.com/jinzhu/now v1.1.5 // indirect github.com/json-iterator/go v1.1.11 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect github.com/mattn/go-colorable v0.1.7 // indirect - github.com/mattn/go-isatty v0.0.12 // indirect - github.com/mattn/go-sqlite3 v1.14.5 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-sqlite3 v1.14.12 // indirect github.com/mattn/goveralls v0.0.2 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect @@ -122,16 +126,20 @@ require ( go.uber.org/zap v1.15.0 // indirect golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect - golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/protobuf v1.26.0-rc.1 // indirect gopkg.in/AlecAivazis/survey.v1 v1.8.5 // indirect gopkg.in/kyokomi/emoji.v1 v1.5.1 // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect - gorm.io/plugin/dbresolver v1.1.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gorm.io/plugin/dbresolver v1.2.2 // indirect ) + +//replace ( +// github.com/go-admin-team/go-admin-core v1.4.0 => ../../go-admin-core +// github.com/go-admin-team/go-admin-core/sdk v1.4.0 => ../../go-admin-core/sdk +//) From 869394c898cf381a4a0e452a4aae91efaba75e2b Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 9 Aug 2022 18:21:00 +0800 Subject: [PATCH 100/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=20Remove=20c?= =?UTF-8?q?aspin=20table=20from=20data=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/migrate/migration/version/1599190683659_tables.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/migrate/migration/version/1599190683659_tables.go b/cmd/migrate/migration/version/1599190683659_tables.go index bc4bda7d6..df2dafa8b 100644 --- a/cmd/migrate/migration/version/1599190683659_tables.go +++ b/cmd/migrate/migration/version/1599190683659_tables.go @@ -22,7 +22,6 @@ func _1599190683659Tables(db *gorm.DB, version string) error { tx = tx.Set("gorm:table_options", "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4") } err := tx.Migrator().AutoMigrate( - new(models.CasbinRule), new(models.SysDept), new(models.SysConfig), new(models.SysTables), From d34a33b6910f2271354c0cd49a31cfdee69d2bb0 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 9 Aug 2022 18:21:40 +0800 Subject: [PATCH 101/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20update=20sqli?= =?UTF-8?q?te3=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go-admin-db.db | Bin 335872 -> 348160 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/go-admin-db.db b/go-admin-db.db index ca8e07201def51a5fcf3b6866d6711da66da7a2c..abb003c43de07c7dd575050f0041485aab103338 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sF8m?SY!j+5GaOHv}TsdzJSBB(p<($b# z5ZEp;hGelJBnzdGbdiuO5JNH_8vrk3@z^Z!#O~mUTVjdr*hTRK4W76s`fNVqbs-K_ z3C8WlB*P);wA3z1`-X<@=C;oJ zR73ZpJ$d%Q?!f}{6qsiF!ZDvTz9r_hE(oo7I}YMyxV1WTlXwtTRO6dCjW4+}`|)0E zW-AZk3AnvVU!QNoYK*4pXMiIIVSUVg6Hh5^oNr7@Pe*@lk81#O*Zn6jIjkoA~TBDORuY-hAV{ZRENuPH|B3zi{Et@%ghYI&EO51D6? zNqc`rA}hL1YS_i=uuTkaLiS`=e_EoDlao`XP-Qyo@MR`SWqJB^mN`NySmOwp$8ibC zoBJJ!LV8Y47T{pnQyg$Y&~fiwBl&FP8kywsxZI^KPpLC>^!C6zM@gw>=#Nhnl$<;z zkH!~aSTtdriR&L3AsM32TgK!Yg zdV#kOc-?FUD$l=gzI~FDisUDqEKDQI``H^3e zwQTZcl;F_ljs;OnUM%M9FUcAmgS8~~%q^0Lrn8<~q&++?eMeQIke43s0$yBqenj`{ zUy^PebIb##HljM=vp}3JfVMIJu+HSwVX{QGLbRejg;}qVR`!c4 z#65m+ls;3Ukd%|;%7mc8B$mtJpjKZcP3(3zGT0snX9oMpRo&1pu96-dk^2C`*e4|l z@j3RquufkjQIwnHnQ=$hw5-R$N1*b`Ih^D~yoF<8;>B7}lk6hXJdZ_!{Y2pp>!&-M#TUm@Y zHt!T!5z-(r_ZeM7n9s#Cz-Pl5QWnx6YMY`OV(GK9XGnd-$i^sSl#!OR5hH|MIvb+7 z`@prs`hW(qPa!q8et#()^1r$kP!X?NP`m9%(S48T Date: Tue, 9 Aug 2022 20:46:37 +0800 Subject: [PATCH 102/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 596e5d4c9..747af12f7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-admin - + [![Build Status](https://github.com/wenjianzhang/go-admin/workflows/build/badge.svg)](https://github.com/go-admin-team/go-admin) From f4c0134d9c610387e029d358dc5b9b4e948bda38 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 9 Aug 2022 21:20:49 +0800 Subject: [PATCH 103/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20Update=20Readme.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 747af12f7..5e8d960d8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-admin - + [![Build Status](https://github.com/wenjianzhang/go-admin/workflows/build/badge.svg)](https://github.com/go-admin-team/go-admin) From 0de5ba77aafe176128366f7e036c97c5c18ff13d Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 9 Aug 2022 21:22:27 +0800 Subject: [PATCH 104/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20Update=20README.?= =?UTF-8?q?Zh-cn.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 4126e0655..84f29f965 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -1,6 +1,6 @@ # go-admin - + [![Build Status](https://github.com/wenjianzhang/go-admin/workflows/build/badge.svg)](https://github.com/go-admin-team/go-admin) From 19153170bb4175a191e9252dfc5bd0ce1789ffd0 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 9 Aug 2022 23:23:18 +0800 Subject: [PATCH 105/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20Update=20README.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5e8d960d8..da4e7784f 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,7 @@ npm run dev + From 9d1e1f6482811fe3c3f7a6099cd7fe0d19c0e5e2 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 9 Aug 2022 23:24:35 +0800 Subject: [PATCH 106/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20Update=20README.?= =?UTF-8?q?Zh-cn.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 84f29f965..2f9049b5f 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -284,6 +284,7 @@ npm run dev + ## JetBrains 开源证书支持 From 7a074d93cdbe63026595dd29f87f0c31a4201b73 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Wed, 10 Aug 2022 00:18:15 +0800 Subject: [PATCH 107/238] =?UTF-8?q?config=F0=9F=94=A7:=20Modify=20the=20sy?= =?UTF-8?q?stem=20default=20logo=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/db.sql b/config/db.sql index 9ec63b4c9..ab88a4823 100644 --- a/config/db.sql +++ b/config/db.sql @@ -125,7 +125,7 @@ INSERT INTO sys_config VALUES (1, '皮肤样式', 'sys_index_skinName', 'skin-gr INSERT INTO sys_config VALUES (2, '初始密码', 'sys_user_initPassword', '123456', 'Y', '0', '用户管理-账号初始密码:123456', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); INSERT INTO sys_config VALUES (3, '侧栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '0', '主框架页-侧边栏主题:深色主题theme-dark,浅色主题theme-light', 1, 1, '2021-05-13 19:56:37.913', '2021-05-13 19:56:37.913', NULL); INSERT INTO sys_config VALUES (4, '系统名称', 'sys_app_name', 'go-admin管理系统', 'Y', '1', '', 1, 0, '2021-03-17 08:52:06.067', '2021-05-28 10:08:25.248', NULL); -INSERT INTO sys_config VALUES (5, '系统logo', 'sys_app_logo', 'https://gitee.com/mydearzwj/image/raw/master/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); +INSERT INTO sys_config VALUES (5, '系统logo', 'sys_app_logo', 'https://doc-image.zhangwj.com/img/go-admin.png', 'Y', '1', '', 1, 0, '2021-03-17 08:53:19.462', '2021-03-17 08:53:19.462', NULL); INSERT INTO sys_dept VALUES (1, 0, '/0/1/', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-05 17:06:44.960', NULL); INSERT INTO sys_dept VALUES (7, 1, '/0/1/7/', '研发部', 1, 'aituo', '13782218188', 'atuo@aituo.com', '2', 1, 1, '2021-05-13 19:56:37.913', '2021-06-16 21:35:00.109', NULL); From 4f458591e860c5f6a28e5fec783ea87b4b8ce0c9 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 10 Aug 2022 00:47:42 +0800 Subject: [PATCH 108/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20Update=20README.?= =?UTF-8?q?md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index da4e7784f..e0fa80dc7 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,8 @@ npm run dev - + + From dc625997c4547559d2a73a37f8f1301b1bc255ad Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 10 Aug 2022 01:00:34 +0800 Subject: [PATCH 109/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20Update=20README.?= =?UTF-8?q?Zh-cn.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 2f9049b5f..20fb27f7c 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -284,7 +284,8 @@ npm run dev - + + ## JetBrains 开源证书支持 From e8b9db1df57785e3ecdcd86086b1a753c48e440e Mon Sep 17 00:00:00 2001 From: zhaoyidong Date: Sat, 13 Aug 2022 17:37:55 +0800 Subject: [PATCH 110/238] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E4=BB=B6=E9=87=8D=E5=A4=8D=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit go-admin app -n 创建目录,重复初始化会导致获取不到body中的参数 --- template/router.template | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/template/router.template b/template/router.template index 010bb03ee..247ca32ab 100644 --- a/template/router.template +++ b/template/router.template @@ -34,9 +34,6 @@ func InitRouter() { os.Exit(-1) } - r.Use(common.Sentinel()). - Use(common.RequestId(pkg.TrafficKey)) - common.InitMiddleware(r) // the jwt middleware authMiddleware, err := common.AuthInit() if err != nil { @@ -75,4 +72,4 @@ func checkRoleRouter(r *gin.Engine, authMiddleware *jwtauth.GinJWTMiddleware) { for _, f := range routerCheckRole { f(v, authMiddleware) } -} \ No newline at end of file +} From ea9e3d2fe18d8c093094d8914a9838e0d1d7b631 Mon Sep 17 00:00:00 2001 From: wanghaima Date: Sun, 14 Aug 2022 23:32:58 +0800 Subject: [PATCH 111/238] =?UTF-8?q?=E7=BC=96=E5=86=99dockerfile=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E8=84=9A=E6=9C=AC=20=E7=BC=96=E8=BE=91shell=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- Dockerfile | 29 +++++++++++++++-------------- Dockerfilebak | 28 ++++++++++++++++++++++++++++ Makefile | 40 +++++++++++++++++++++++++++++++++++++++- docker-compose.yml | 19 +++++++++++++++++++ restart.sh | 9 +++++++++ stop.sh | 4 ++++ 7 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 Dockerfilebak create mode 100644 docker-compose.yml create mode 100644 restart.sh create mode 100644 stop.sh diff --git a/.gitignore b/.gitignore index ce6fd6bd2..4f654db94 100644 --- a/.gitignore +++ b/.gitignore @@ -4,11 +4,11 @@ static/uploadfile main.exe go-admin +go-admin.exe temp/ !temp vendor config/settings.dev.yml -go-admin common/middleware/demo.go config/settings.dev.*.yml config/settings.dev.*.yml.log diff --git a/Dockerfile b/Dockerfile index c5e33a5c0..c7e29261d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,29 @@ FROM golang:alpine as builder -MAINTAINER lwnmengjing +MAINTAINER haimait -ENV GOPROXY https://goproxy.cn/ +WORKDIR /work -WORKDIR /go/release -#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories -RUN apk update && apk add tzdata +RUN go env -w GOPROXY=https://goproxy.cn,direct && go env -w CGO_ENABLED=0 +COPY go.mod go.sum ./ +RUN go mod download -COPY go.mod ./go.mod -RUN go mod tidy COPY . . -RUN pwd && ls +RUN go build -o go-admin main.go -RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin . -FROM alpine +FROM alpine:latest +# change timezone +RUN apk add --no-cache tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone -COPY --from=builder /go/release/go-admin / +WORKDIR /go-admin-api -COPY --from=builder /go/release/config/settings.yml /config/settings.yml +COPY --from=builder /work/go-admin ./ +COPY --from=builder /work/config ./config +COPY --from=builder /work/static ./static +COPY --from=builder /work/temp ./temp -COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime EXPOSE 8000 -CMD ["/go-admin","server","-c", "/config/settings.yml"] \ No newline at end of file +CMD ["./go-admin","server","-c", "config/settings.dev.yml"] diff --git a/Dockerfilebak b/Dockerfilebak new file mode 100644 index 000000000..c5e33a5c0 --- /dev/null +++ b/Dockerfilebak @@ -0,0 +1,28 @@ +FROM golang:alpine as builder + +MAINTAINER lwnmengjing + +ENV GOPROXY https://goproxy.cn/ + +WORKDIR /go/release +#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories +RUN apk update && apk add tzdata + +COPY go.mod ./go.mod +RUN go mod tidy +COPY . . +RUN pwd && ls + +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin . + +FROM alpine + +COPY --from=builder /go/release/go-admin / + +COPY --from=builder /go/release/config/settings.yml /config/settings.yml + +COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime + +EXPOSE 8000 + +CMD ["/go-admin","server","-c", "/config/settings.yml"] \ No newline at end of file diff --git a/Makefile b/Makefile index 135c7e70e..812402bbe 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,40 @@ PROJECT:=go-admin .PHONY: build build: CGO_ENABLED=0 go build -ldflags="-w -s" -a -installsuffix -o go-admin . + +# make build-linux build-linux: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -a -installsuffix -o go-admin . + @docker build -t go-admin:latest . + @echo "build successful" + build-sqlite: go build -tags sqlite3 -ldflags="-w -s" -a -installsuffix -o go-admin . + +# make run +run: + # delete go-admin-api container + @if [ $(shell docker ps -aq --filter name=go-admin --filter publish=8000) ]; then docker rm -f go-admin; fi + + # 启动方法一 run go-admin-api container docker-compose 启动方式 + # 进入到项目根目录 执行 make run 命令 + @docker-compose up -d + + # 启动方式二 docker run 这里注意-v挂载的宿主机的地址改为部署时的实际决对路径 + #@docker run --name=go-admin -p 8000:8000 -v /home/code/go/src/go-admin/go-admin/config:/go-admin-api/config -v /home/code/go/src/go-admin/go-admin-api/static:/go-admin/static -v /home/code/go/src/go-admin/go-admin/temp:/go-admin-api/temp -d --restart=always go-admin:latest + + @echo "go-admin service is running..." + + # delete Tag= 的镜像 + @docker image prune -f + @docker ps -a | grep "go-admin" + +stop: + # delete go-admin-api container + @if [ $(shell docker ps -aq --filter name=go-admin --filter publish=8000) ]; then docker-compose down; fi + #@if [ $(shell docker ps -aq --filter name=go-admin --filter publish=8000) ]; then docker rm -f go-admin; fi + #@echo "go-admin stop success" + + #.PHONY: test #test: # go test -v ./... -cover @@ -14,3 +44,11 @@ build-sqlite: #.PHONY: docker #docker: # docker build . -t go-admin:latest + +# make deploy +deploy: + + #@git checkout master + #@git pull origin master + make build-linux + make run \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..41d94dee4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +version: '3.8' +services: + go-admin-api: + container_name: go-admin + image: go-admin:latest + privileged: true + restart: always + ports: + - 8000:8000 + volumes: + - ./config/:/go-admin-api/config/ + - ./static/:/go-admin-api/static/ + - ./temp/:/go-admin-api/temp/ + networks: + - myweb +networks: + myweb: + driver: bridge + diff --git a/restart.sh b/restart.sh new file mode 100644 index 000000000..53ea7b588 --- /dev/null +++ b/restart.sh @@ -0,0 +1,9 @@ +#!/bin/bash +echo "go build" +go mod tidy +go build -o go-admin main.go +echo "kill go-admin service" +killall go-admin # kill go-admin service +nohup ./go-admin server -c=config/settings.dev.yml >> access.log 2>&1 & #后台启动服务将日志写入access.log文件 +echo "run go-admin success" +ps -aux | grep go-admin \ No newline at end of file diff --git a/stop.sh b/stop.sh new file mode 100644 index 000000000..6dd9dc438 --- /dev/null +++ b/stop.sh @@ -0,0 +1,4 @@ +#!/bin/bash +killall go-admin # kill go-admin service +echo "stop go-admin success" +ps -aux | grep go-admin \ No newline at end of file From 62d9084ee8bf0f95e9cdad3233092a0bd24231e0 Mon Sep 17 00:00:00 2001 From: zhaoyidong Date: Tue, 16 Aug 2022 11:41:28 +0800 Subject: [PATCH 112/238] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E6=9D=BFget?= =?UTF-8?q?=20update=20delete=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/no_actions/apis.go.template | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/template/v4/no_actions/apis.go.template b/template/v4/no_actions/apis.go.template index 08c092682..8e85d8c9d 100644 --- a/template/v4/no_actions/apis.go.template +++ b/template/v4/no_actions/apis.go.template @@ -65,7 +65,7 @@ func (e {{.ClassName}}) GetPage(c *gin.Context) { // @Summary 获取{{.TableComment}} // @Description 获取{{.TableComment}} // @Tags {{.TableComment}} -// @Param id path string false "id" +// @Param id path int false "id" // @Success 200 {object} response.Response{data=models.{{.ClassName}}} "{"code": 200, "data": [...]}" // @Router /api/v1/{{.ModuleName}}/{id} [get] // @Security Bearer @@ -135,6 +135,7 @@ func (e {{.ClassName}}) Insert(c *gin.Context) { // @Tags {{.TableComment}} // @Accept application/json // @Product application/json +// @Param id path int true "id" // @Param data body dto.{{.ClassName}}UpdateReq true "body" // @Success 200 {object} response.Response "{"code": 200, "message": "修改成功"}" // @Router /api/v1/{{.ModuleName}}/{id} [put] @@ -167,7 +168,7 @@ func (e {{.ClassName}}) Update(c *gin.Context) { // @Summary 删除{{.TableComment}} // @Description 删除{{.TableComment}} // @Tags {{.TableComment}} -// @Param ids body []int false "ids" +// @Param data body dto.{{.ClassName}}DeleteReq true "body" // @Success 200 {object} response.Response "{"code": 200, "message": "删除成功"}" // @Router /api/v1/{{.ModuleName}} [delete] // @Security Bearer @@ -194,4 +195,4 @@ func (e {{.ClassName}}) Delete(c *gin.Context) { return } e.OK( req.GetId(), "删除成功") -} \ No newline at end of file +} From 7655d0fd38f37841bb84b5fe5a7ca9dc1fffee2c Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Thu, 18 Aug 2022 06:57:02 +0800 Subject: [PATCH 113/238] =?UTF-8?q?fix=F0=9F=90=9B:=20Repair=20document=20?= =?UTF-8?q?address=20(#692)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/cobra.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cobra.go b/cmd/cobra.go index 6c69d355e..d6030a979 100644 --- a/cmd/cobra.go +++ b/cmd/cobra.go @@ -36,7 +36,7 @@ var rootCmd = &cobra.Command{ func tip() { usageStr := `欢迎使用 ` + pkg.Green(`go-admin `+global.Version) + ` 可以使用 ` + pkg.Red(`-h`) + ` 查看命令` - usageStr1 := `也可以参考 https://doc.go-admin.dev/guide/ksks.html 里边的【启动】章节` + usageStr1 := `也可以参考 https://doc.go-admin.dev/guide/ksks 的相关内容` fmt.Printf("%s\n", usageStr) fmt.Printf("%s\n", usageStr1) } From bb65e762192dc2869d86cb85c980dec8e4ecec1a Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Thu, 18 Aug 2022 07:19:24 +0800 Subject: [PATCH 114/238] =?UTF-8?q?fix=F0=9F=90=9B:=20Repair=20role=20crea?= =?UTF-8?q?tion=20prompt=20empty=20slice=20found=20(#687)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_role.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index b87d20b9b..8eeade1b5 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -113,21 +113,16 @@ func (e *SysRole) Insert(c *dto.SysRoleInsertReq, cb *casbin.SyncedEnforcer) err } } } + + if len(polices) <= 0 { + return nil + } + _, err = cb.AddNamedPolicies("p", polices) if err != nil { return err } - //if len(c.MenuIds) > 0 { - // s := SysRoleMenu{} - // s.Orm = e.Orm - // s.Log = e.Log - // err = s.ReloadRule(tx, c.RoleId, c.MenuIds) - // if err != nil { - // e.Log.Errorf("reload casbin rule error, %", err.Error()) - // return err - // } - //} return nil } @@ -182,11 +177,13 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err } } } + if len(polices) <= 0 { + return nil + } _, err = cb.AddNamedPolicies("p", polices) if err != nil { return err } - return nil } From 66c8eb5ee8c12b59a1bd11b92063b29a81ca638d Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Thu, 18 Aug 2022 07:26:56 +0800 Subject: [PATCH 115/238] =?UTF-8?q?fix=F0=9F=90=9B:=20Fix=20create=20when?= =?UTF-8?q?=20creating=20a=20new=20create=5Fby=20Problem=20with=20by=20val?= =?UTF-8?q?ue=20of=200=20(#688)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/dto/sys_user.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/admin/service/dto/sys_user.go b/app/admin/service/dto/sys_user.go index 469844dc5..b1de09461 100644 --- a/app/admin/service/dto/sys_user.go +++ b/app/admin/service/dto/sys_user.go @@ -121,6 +121,7 @@ func (s *SysUserInsertReq) Generate(model *models.SysUser) { model.PostId = s.PostId model.Remark = s.Remark model.Status = s.Status + model.CreateBy = s.CreateBy } func (s *SysUserInsertReq) GetId() interface{} { @@ -185,4 +186,4 @@ func (s *SysUserById) GenerateM() (common.ActiveRecord, error) { type PassWord struct { NewPassword string `json:"newPassword" vd:"len($)>0"` OldPassword string `json:"oldPassword" vd:"len($)>0"` -} \ No newline at end of file +} From 8df2e8190e54812fb21c6be76c84fc53b5690799 Mon Sep 17 00:00:00 2001 From: zhaoyidong Date: Thu, 18 Aug 2022 10:02:00 +0800 Subject: [PATCH 116/238] =?UTF-8?q?=E6=8D=95=E8=8E=B7runtime.Error?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=EF=BC=8C=E5=90=A6=E5=88=99=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E4=B8=8D=E8=BF=94=E5=9B=9E=E4=BB=BB=E4=BD=95?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 报错细节不应该隐藏,方便debug。500错误应该由前端统一处理,返回用户可读信息。 --- common/middleware/customerror.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/middleware/customerror.go b/common/middleware/customerror.go index 121a2e7a4..1f9262879 100644 --- a/common/middleware/customerror.go +++ b/common/middleware/customerror.go @@ -3,6 +3,7 @@ package middleware import ( "fmt" "net/http" + "runtime" "strconv" "strings" "time" @@ -43,9 +44,14 @@ func CustomError(c *gin.Context) { } else { c.JSON(http.StatusOK, gin.H{ "code": 500, - "msg": "未知异常,请联系管理员!", + "msg": errStr, }) } + case runtime.Error: + c.JSON(http.StatusOK, gin.H{ + "code": 500, + "msg": errStr.Error(), + }) default: panic(err) } From 483ec2bf3e6cac032ba4d1f78ac4e9868feee31d Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 18 Aug 2022 13:02:42 +0800 Subject: [PATCH 117/238] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..86c88f444 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: true +contact_links: + - name: 🆕 Create new issue + url: http://new-issue.go-admin.dev + about: The issue which is not created via http://new-issue.go-admin.dev will be closed immediately. + - name: 🆕 创建一个新 Issue + url: http://new-issue.go-admin.dev + about: 不是用 http://new-issue.go-admin.dev 创建的 issue 会被机器人自动关闭。 From 0993173b1ff318a42f7b0f6dd0ddaaa99738d9dc Mon Sep 17 00:00:00 2001 From: infnan <38274826+infnan@users.noreply.github.com> Date: Thu, 18 Aug 2022 16:50:54 +0800 Subject: [PATCH 118/238] =?UTF-8?q?=E5=A4=84=E7=90=86postgre=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: infnan <38274826+infnan@users.noreply.github.com> --- app/admin/apis/sys_config.go | 4 ++-- app/admin/models/sys_config.go | 2 +- app/admin/service/dto/sys_config.go | 6 +++--- cmd/migrate/migration/models/initdb.go | 4 ++++ common/middleware/handler/login.go | 2 +- config/pg.sql | 18 ++++++++++++++---- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/app/admin/apis/sys_config.go b/app/admin/apis/sys_config.go index e4886bcea..0a95c8b4f 100644 --- a/app/admin/apis/sys_config.go +++ b/app/admin/apis/sys_config.go @@ -198,7 +198,7 @@ func (e SysConfig) Get2SysApp(c *gin.Context) { return } // 控制只读前台的数据 - req.IsFrontend = 1 + req.IsFrontend = "1" list := make([]models.SysConfig, 0) err = s.GetWithKeyList(&req, &list) if err != nil { @@ -310,4 +310,4 @@ func (e SysConfig) GetSysConfigByKEYForService(c *gin.Context) { return } e.OK(resp, s.Msg) -} \ No newline at end of file +} diff --git a/app/admin/models/sys_config.go b/app/admin/models/sys_config.go index 8bd07275f..beb656bea 100644 --- a/app/admin/models/sys_config.go +++ b/app/admin/models/sys_config.go @@ -10,7 +10,7 @@ type SysConfig struct { ConfigKey string `json:"configKey" gorm:"size:128;comment:ConfigKey"` // ConfigValue string `json:"configValue" gorm:"size:255;comment:ConfigValue"` // ConfigType string `json:"configType" gorm:"size:64;comment:ConfigType"` - IsFrontend int `json:"isFrontend" gorm:"size:64;comment:是否前台"` // + IsFrontend string `json:"isFrontend" gorm:"size:64;comment:是否前台"` // Remark string `json:"remark" gorm:"size:128;comment:Remark"` // models.ControlBy models.ModelTime diff --git a/app/admin/service/dto/sys_config.go b/app/admin/service/dto/sys_config.go index cbc03656f..06f7467fe 100644 --- a/app/admin/service/dto/sys_config.go +++ b/app/admin/service/dto/sys_config.go @@ -12,7 +12,7 @@ type SysConfigGetPageReq struct { ConfigName string `form:"configName" search:"type:contains;column:config_name;table:sys_config"` ConfigKey string `form:"configKey" search:"type:contains;column:config_key;table:sys_config"` ConfigType string `form:"configType" search:"type:exact;column:config_type;table:sys_config"` - IsFrontend int `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config"` + IsFrontend string `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config"` SysConfigOrder } @@ -29,7 +29,7 @@ func (m *SysConfigGetPageReq) GetNeedSearch() interface{} { } type SysConfigGetToSysAppReq struct { - IsFrontend int `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config"` + IsFrontend string `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config"` } func (m *SysConfigGetToSysAppReq) GetNeedSearch() interface{} { @@ -43,7 +43,7 @@ type SysConfigControl struct { ConfigKey string `uri:"configKey" json:"configKey" comment:""` ConfigValue string `json:"configValue" comment:""` ConfigType string `json:"configType" comment:""` - IsFrontend int `json:"isFrontend"` + IsFrontend string `json:"isFrontend"` Remark string `json:"remark" comment:""` common.ControlBy } diff --git a/cmd/migrate/migration/models/initdb.go b/cmd/migrate/migration/models/initdb.go index a93450315..ba7f4ca76 100644 --- a/cmd/migrate/migration/models/initdb.go +++ b/cmd/migrate/migration/models/initdb.go @@ -13,6 +13,10 @@ import ( func InitDb(db *gorm.DB) (err error) { filePath := "config/db.sql" if global.Driver == "postgres" { + filePath := "config/db.sql" + if err = ExecSql(db, filePath); err != nil { + return err + } filePath = "config/pg.sql" err = ExecSql(db, filePath) } else if global.Driver == "mysql" { diff --git a/common/middleware/handler/login.go b/common/middleware/handler/login.go index 619ac0f52..d17626c00 100644 --- a/common/middleware/handler/login.go +++ b/common/middleware/handler/login.go @@ -14,7 +14,7 @@ type Login struct { } func (u *Login) GetUser(tx *gorm.DB) (user SysUser, role SysRole, err error) { - err = tx.Table("sys_user").Where("username = ? and status = 2", u.Username).First(&user).Error + err = tx.Table("sys_user").Where("username = ? and status = '2'", u.Username).First(&user).Error if err != nil { log.Errorf("get user error, %s", err.Error()) return diff --git a/config/pg.sql b/config/pg.sql index 1c6836ea7..ba3c0c82a 100644 --- a/config/pg.sql +++ b/config/pg.sql @@ -1,11 +1,21 @@ -- 开始初始化数据 ; +create sequence if not exists sys_role_role_id_seq; +create sequence if not exists sys_user_user_id_seq; +create sequence if not exists sys_post_post_id_seq; +create sequence if not exists sys_menu_menu_id_seq; +create sequence if not exists sys_dict_type_dict_id_seq; +create sequence if not exists sys_dict_data_dict_code_seq; +create sequence if not exists sys_dept_dept_id_seq; +create sequence if not exists sys_config_config_id_seq; +create sequence if not exists sys_job_id_seq; + select setval('sys_role_role_id_seq',4); select setval('sys_user_user_id_seq',5); select setval('sys_post_post_id_seq',4); -select setval('sys_menu_menu_id_seq',268); +select setval('sys_menu_menu_id_seq',543); select setval('sys_dict_type_dict_id_seq',12); -select setval('sys_dict_data_dict_code_seq',32); +select setval('sys_dict_data_dict_code_seq',34); select setval('sys_dept_dept_id_seq',11); -select setval('sys_config_config_id_seq',4); +select setval('sys_config_config_id_seq',6); select setval('sys_job_id_seq',3); --- 数据完成 ; \ No newline at end of file +-- 数据完成 ; From 5b1405391e8d002ffea4febbac0be8b79180cbb4 Mon Sep 17 00:00:00 2001 From: zhaoyidong Date: Thu, 18 Aug 2022 18:36:50 +0800 Subject: [PATCH 119/238] =?UTF-8?q?fix=F0=9F=90=9B:=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=AD=E7=9A=84=E5=A4=9A=E4=BD=99=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/no_actions/apis.go.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/template/v4/no_actions/apis.go.template b/template/v4/no_actions/apis.go.template index 8e85d8c9d..787877611 100644 --- a/template/v4/no_actions/apis.go.template +++ b/template/v4/no_actions/apis.go.template @@ -54,7 +54,7 @@ func (e {{.ClassName}}) GetPage(c *gin.Context) { err = s.GetPage(&req, p, &list, &count) if err != nil { - e.Error(500, err, fmt.Sprintf("获取{{.TableComment}} 失败,\r\n失败信息 %s", err.Error())) + e.Error(500, err, fmt.Sprintf("获取{{.TableComment}}失败,\r\n失败信息 %s", err.Error())) return } @@ -122,7 +122,7 @@ func (e {{.ClassName}}) Insert(c *gin.Context) { err = s.Insert(&req) if err != nil { - e.Error(500, err, fmt.Sprintf("创建{{.TableComment}} 失败,\r\n失败信息 %s", err.Error())) + e.Error(500, err, fmt.Sprintf("创建{{.TableComment}}失败,\r\n失败信息 %s", err.Error())) return } @@ -158,7 +158,7 @@ func (e {{.ClassName}}) Update(c *gin.Context) { err = s.Update(&req, p) if err != nil { - e.Error(500, err, fmt.Sprintf("修改{{.TableComment}} 失败,\r\n失败信息 %s", err.Error())) + e.Error(500, err, fmt.Sprintf("修改{{.TableComment}}失败,\r\n失败信息 %s", err.Error())) return } e.OK( req.GetId(), "修改成功") From 8c8d2687087cca6fd4845526192a85df696a94b7 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 22 Aug 2022 15:51:33 +0800 Subject: [PATCH 120/238] =?UTF-8?q?docs=F0=9F=93=9D=20update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e0fa80dc7..25624e552 100644 --- a/README.md +++ b/README.md @@ -271,7 +271,10 @@ npm run dev + + + From 6b3b2125df47d0ea45ccf70dc004322382158ac8 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 22 Aug 2022 15:52:19 +0800 Subject: [PATCH 121/238] =?UTF-8?q?docs=F0=9F=93=9D:=20update=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 20fb27f7c..1bd783bd7 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -259,6 +259,7 @@ npm run dev ## 💎 贡献者 + @@ -285,7 +286,10 @@ npm run dev + + + ## JetBrains 开源证书支持 From 75582539fe726750c65a02d153c18203456b3d1c Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 23 Aug 2022 11:39:19 +0800 Subject: [PATCH 122/238] =?UTF-8?q?feat=E2=9C=A8:=20=20add=20issue-close-r?= =?UTF-8?q?equire.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue-close-require.yml | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/issue-close-require.yml diff --git a/.github/workflows/issue-close-require.yml b/.github/workflows/issue-close-require.yml new file mode 100644 index 000000000..f1fc9b60d --- /dev/null +++ b/.github/workflows/issue-close-require.yml @@ -0,0 +1,32 @@ +name: Issue Close Require + +on: + schedule: + - cron: "0 0 * * *" + +permissions: + contents: read + +jobs: + issue-close-require: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs + runs-on: ubuntu-latest + steps: + - name: need reproduce + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issues' + labels: '🤔 Need Reproduce' + inactive-day: 3 + + - name: needs more info + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issues' + labels: 'needs-more-info' + inactive-day: 3 + body: | + Since the issue was labeled with `needs-more-info`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply. + 由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。 From a97d86e8017806176f9f808dd10d8b4c933c4fd5 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 23 Aug 2022 11:40:29 +0800 Subject: [PATCH 123/238] =?UTF-8?q?feat=E2=9C=A8:=20=20add=20issue-check-i?= =?UTF-8?q?nactive.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue-check-inactive.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/issue-check-inactive.yml diff --git a/.github/workflows/issue-check-inactive.yml b/.github/workflows/issue-check-inactive.yml new file mode 100644 index 000000000..9a7973100 --- /dev/null +++ b/.github/workflows/issue-check-inactive.yml @@ -0,0 +1,22 @@ +name: Issue Check Inactive + +on: + schedule: + - cron: "0 0 */15 * *" + +permissions: + contents: read + +jobs: + issue-check-inactive: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs + runs-on: ubuntu-latest + steps: + - name: check-inactive + uses: actions-cool/issues-helper@v3 + with: + actions: 'check-inactive' + inactive-label: 'Inactive' + inactive-day: 30 From 39702abfbabf12abe9ac129c436321563c1ca9e6 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 23 Aug 2022 11:48:35 +0800 Subject: [PATCH 124/238] =?UTF-8?q?feat=E2=9C=A8:=20=20add=20issue-labeled?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue-labeled.yml | 76 +++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/issue-labeled.yml diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml new file mode 100644 index 000000000..1d90269a9 --- /dev/null +++ b/.github/workflows/issue-labeled.yml @@ -0,0 +1,76 @@ +# Origin Source +# https://github.com/ant-design/ant-design/blob/79f566b7f8abb1012ef55b0d2793bfdf5595b85d/.github/workflows/issue-reply.yml +name: Issue Labeled + +on: + issues: + types: [labeled] + +permissions: + contents: read + +jobs: + issue-labeled: + permissions: + issues: write # for actions-cool/issues-helper to update issues + pull-requests: write # for actions-cool/issues-helper to update PRs + runs-on: ubuntu-latest + steps: + - name: help wanted + if: github.event.label.name == 'help wanted' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the [Pull Request Template](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE.md) here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! + 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的[预设模板](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE.md),提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。 + ![giphy](https://user-images.githubusercontent.com/507615/62342668-4735dc00-b51a-11e9-92a7-d46fbb1cc0c7.gif) + - name: 🤔 Need Reproduce + if: github.event.label.name == '🤔 Need Reproduce' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by `Need Reproduce` will be closed if no activities in 3 days. + 你好 @${{ github.event.issue.user.login }}, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 [此处](https://u.ant.design/codesandbox-repro) 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。3 天内未跟进此 issue 将会被自动关闭。 + ![](https://gw.alipayobjects.com/zos/antfincdn/y9kwg7DVCd/reproduce.gif) + - name: Usage + if: github.event.label.name == 'Usage' || github.event.label.name == 'Question' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment,close-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please [don't ask usage questions](https://github.com/ant-design/ant-design/issues/2320) here. You can try to open a new discussion in [antd discussions](https://github.com/ant-design/ant-design/discussions), select `Q&A` to ask questions, also can ask questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) or [Segment Fault](https://segmentfault.com/t/antd), then apply tag `antd` and `react` to your question. + 你好 @${{ github.event.issue.user.login }},Ant Design Issue 板块是用于 bug 反馈与需求讨论的地方。请[勿询问如何使用的问题](https://github.com/ant-design/ant-design/issues/2320),你可以试着在 [antd discussions](https://github.com/ant-design/ant-design/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问,也可以在 [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) 或者 [Segment Fault](https://segmentfault.com/t/antd) 中提问(记得添加 `antd` 和 `react` 标签哦~)。 + - name: 3.x + if: github.event.label.name == '3.x' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment,close-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hi @${{ github.event.issue.user.login }}. Current version (3.x) is off the maintenance period. We may not accept pull request or fix bug with it anymore. This topic will be auto closed. + 你好 @${{ github.event.issue.user.login }},当前版本(3.x)已经过了维护期。我们不会再接受对其的相关 PR 与 issue。当前 topic 会被自动关闭。 + - name: invalid + if: github.event.label.name == 'Invalid' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment,close-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](http://new-issue.ant.design) to create an issue, thank you! + 你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](http://new-issue.ant.design) 来创建 issue 以方便我们定位错误。谢谢配合! + - name: rtl + if: github.event.label.name == 'rtl' + uses: actions-cool/issues-helper@v3 + with: + actions: 'add-assignees' + assignees: 'xrkffgg' From 5be468308af362241dbbae2ebc95cfbcb77629d8 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 23 Aug 2022 11:55:03 +0800 Subject: [PATCH 125/238] =?UTF-8?q?feat=E2=9C=A8:=20=20update=20issue-labe?= =?UTF-8?q?led.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue-labeled.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 1d90269a9..e8f45ca5d 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -21,7 +21,7 @@ jobs: uses: actions-cool/issues-helper@v3 with: actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.ADMIN_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the [Pull Request Template](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE.md) here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! @@ -32,7 +32,7 @@ jobs: uses: actions-cool/issues-helper@v3 with: actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.ADMIN_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}. Please provide a online reproduction by forking this link https://u.ant.design/codesandbox-repro or a minimal GitHub repository. Issues labeled by `Need Reproduce` will be closed if no activities in 3 days. @@ -43,7 +43,7 @@ jobs: uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,close-issue' - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.ADMIN_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please [don't ask usage questions](https://github.com/ant-design/ant-design/issues/2320) here. You can try to open a new discussion in [antd discussions](https://github.com/ant-design/ant-design/discussions), select `Q&A` to ask questions, also can ask questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) or [Segment Fault](https://segmentfault.com/t/antd), then apply tag `antd` and `react` to your question. @@ -53,7 +53,7 @@ jobs: uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,close-issue' - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.ADMIN_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hi @${{ github.event.issue.user.login }}. Current version (3.x) is off the maintenance period. We may not accept pull request or fix bug with it anymore. This topic will be auto closed. @@ -63,7 +63,7 @@ jobs: uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,close-issue' - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.ADMIN_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](http://new-issue.ant.design) to create an issue, thank you! From 5609e004cc2f304b83c5170d4b9bf141c9531cc1 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 24 Aug 2022 11:24:53 +0800 Subject: [PATCH 126/238] =?UTF-8?q?feat=E2=9C=A8:=20PULL=5FREQUEST=5FTEMPL?= =?UTF-8?q?ATE.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/PULL_REQUEST_TEMPLATE.md | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..48e8d022c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,66 @@ + + +[[中文版模板 / Chinese template](https://github.com/go-admin-team/go-admin/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)] + +### 🤔 This is a ... + +- [ ] New feature +- [ ] Bug fix +- [ ] Site / documentation update +- [ ] Demo update +- [ ] Component style update +- [ ] TypeScript definition update +- [ ] Bundle size optimization +- [ ] Performance optimization +- [ ] Enhancement feature +- [ ] Internationalization +- [ ] Refactoring +- [ ] Code style optimization +- [ ] Test Case +- [ ] Branch merge +- [ ] Other (about what?) + +### 🔗 Related issue link + + + +### 💡 Background and solution + + + +### 📝 Changelog + + + +| Language | Changelog | +| ---------- | --------- | +| 🇺🇸 English | | +| 🇨🇳 Chinese | | + +### ☑️ Self-Check before Merge + +⚠️ Please check all items below before review. ⚠️ + +- [ ] Doc is updated/provided or not needed +- [ ] Demo is updated/provided or not needed +- [ ] TypeScript definition is updated/provided or not needed +- [ ] Changelog is provided or not needed From af38e1694b7d2ed217ed7447b734691f9f4a5531 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 24 Aug 2022 11:26:01 +0800 Subject: [PATCH 127/238] =?UTF-8?q?feat=E2=9C=A8:=20=20pr=5Fcn.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/PULL_REQUEST_TEMPLATE/pr_cn.md | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pr_cn.md diff --git a/.github/PULL_REQUEST_TEMPLATE/pr_cn.md b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md new file mode 100644 index 000000000..ce155b685 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pr_cn.md @@ -0,0 +1,61 @@ + + +[[English Template / 英文模板](https://github.com/go-admin-team/go-admin/blob/master/.github/PULL_REQUEST_TEMPLATE.md)] + +### 🤔 这个变动的性质是? + +- [ ] 新特性提交 +- [ ] 日常 bug 修复 +- [ ] 站点、文档改进 +- [ ] 演示代码改进 +- [ ] 组件样式/交互改进 +- [ ] TypeScript 定义更新 +- [ ] 包体积优化 +- [ ] 性能优化 +- [ ] 功能增强 +- [ ] 国际化改进 +- [ ] 重构 +- [ ] 代码风格优化 +- [ ] 测试用例 +- [ ] 分支合并 +- [ ] 其他改动(是关于什么的改动?) + +### 🔗 相关 Issue + + + +### 💡 需求背景和解决方案 + + + +### 📝 更新日志 + + + +| 语言 | 更新描述 | +| ------- | -------- | +| 🇺🇸 英文 | | +| 🇨🇳 中文 | | + +### ☑️ 请求合并前的自查清单 + +⚠️ 请自检并全部**勾选全部选项**。⚠️ + +- [ ] 文档已补充或无须补充 +- [ ] 代码演示已提供或无须提供 +- [ ] TypeScript 定义已补充或无须补充 +- [ ] Changelog 已提供或无须提供 From 386d08a03f8c0a9b0a1a3507812b070e13b3c239 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 24 Aug 2022 16:27:19 +0800 Subject: [PATCH 128/238] =?UTF-8?q?=20feat=E2=9C=A8:=20update=20issue-labe?= =?UTF-8?q?led.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue-labeled.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index e8f45ca5d..ce93c035a 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -24,8 +24,8 @@ jobs: token: ${{ secrets.ADMIN_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | - Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the [Pull Request Template](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE.md) here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! - 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的[预设模板](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE.md),提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。 + Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to [send us a Pull Request](https://help.github.com/en/articles/creating-a-pull-request) for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the [Pull Request Template](https://github.com/go-admin-team/go-admin/blob/master/.github/PULL_REQUEST_TEMPLATE.md) here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! + 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎直接在此仓库 [创建一个 Pull Request](https://help.github.com/en/articles/creating-a-pull-request) 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的[预设模板](https://github.com/go-admin-team/go-admin/blob/master/.github/PULL_REQUEST_TEMPLATE.md),提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。 ![giphy](https://user-images.githubusercontent.com/507615/62342668-4735dc00-b51a-11e9-92a7-d46fbb1cc0c7.gif) - name: 🤔 Need Reproduce if: github.event.label.name == '🤔 Need Reproduce' @@ -47,7 +47,7 @@ jobs: issue-number: ${{ github.event.issue.number }} body: | Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please [don't ask usage questions](https://github.com/ant-design/ant-design/issues/2320) here. You can try to open a new discussion in [antd discussions](https://github.com/ant-design/ant-design/discussions), select `Q&A` to ask questions, also can ask questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) or [Segment Fault](https://segmentfault.com/t/antd), then apply tag `antd` and `react` to your question. - 你好 @${{ github.event.issue.user.login }},Ant Design Issue 板块是用于 bug 反馈与需求讨论的地方。请[勿询问如何使用的问题](https://github.com/ant-design/ant-design/issues/2320),你可以试着在 [antd discussions](https://github.com/ant-design/ant-design/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问,也可以在 [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) 或者 [Segment Fault](https://segmentfault.com/t/antd) 中提问(记得添加 `antd` 和 `react` 标签哦~)。 + 你好 @${{ github.event.issue.user.login }},go-admin Issue 板块是用于 bug 反馈与需求讨论的地方。请[勿询问如何使用的问题](https://github.com/go-admin-te/ant-design/issues/699),你可以试着在 [antd discussions](https://github.com/ant-design/ant-design/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问,也可以在 [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) 或者 [Segment Fault](https://segmentfault.com/t/antd) 中提问(记得添加 `antd` 和 `react` 标签哦~)。 - name: 3.x if: github.event.label.name == '3.x' uses: actions-cool/issues-helper@v3 @@ -66,8 +66,8 @@ jobs: token: ${{ secrets.ADMIN_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | - Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](http://new-issue.ant.design) to create an issue, thank you! - 你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](http://new-issue.ant.design) 来创建 issue 以方便我们定位错误。谢谢配合! + Hello @${{ github.event.issue.user.login }}, your issue has been closed because it does not conform to our issue requirements. Please use the [Issue Helper](https://new-issue.go-admin.dev) to create an issue, thank you! + 你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](https://new-issue.go-admin.dev) 来创建 issue 以方便我们定位错误。谢谢配合! - name: rtl if: github.event.label.name == 'rtl' uses: actions-cool/issues-helper@v3 From 8e8fe906fd926e7d622605eeedfaae6876ef60c7 Mon Sep 17 00:00:00 2001 From: NaturalGao <924789862@qq.com> Date: Thu, 25 Aug 2022 01:00:57 +0800 Subject: [PATCH 129/238] perf: update swag --- app/admin/router/sys_router.go | 10 +- docs/docs.go | 612 ++++++++++++++++++++++++--------- docs/swagger.json | 545 ++++++++++++++++++++++------- docs/swagger.yaml | 416 ++++++++++++++++------ go.mod | 59 ++-- 5 files changed, 1222 insertions(+), 420 deletions(-) diff --git a/app/admin/router/sys_router.go b/app/admin/router/sys_router.go index 944f89597..67132a42f 100644 --- a/app/admin/router/sys_router.go +++ b/app/admin/router/sys_router.go @@ -1,15 +1,17 @@ package router import ( - "github.com/go-admin-team/go-admin-core/sdk/config" "go-admin/app/admin/apis" "mime" + "github.com/go-admin-team/go-admin-core/sdk/config" + "github.com/gin-gonic/gin" jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" "github.com/go-admin-team/go-admin-core/sdk/pkg/ws" ginSwagger "github.com/swaggo/gin-swagger" - "github.com/swaggo/gin-swagger/swaggerFiles" + + swaggerfiles "github.com/swaggo/files" "go-admin/common/middleware" "go-admin/common/middleware/handler" @@ -54,11 +56,11 @@ func sysStaticFileRouter(r *gin.RouterGroup) { } func sysSwaggerRouter(r *gin.RouterGroup) { - r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) + r.GET("/swagger/admin/*any", ginSwagger.WrapHandler(swaggerfiles.NewHandler(), ginSwagger.InstanceName("admin"))) } func sysCheckRoleRouterInit(r *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { - wss:=r.Group("").Use(authMiddleware.MiddlewareFunc()) + wss := r.Group("").Use(authMiddleware.MiddlewareFunc()) { wss.GET("/ws/:id/:channel", ws.WebsocketManager.WsClient) wss.GET("/wslogout/:id/:channel", ws.WebsocketManager.UnWsClient) diff --git a/docs/docs.go b/docs/docs.go index 7f5bd2645..780b1d877 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,22 +1,14 @@ -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// Package docs GENERATED BY SWAG; DO NOT EDIT // This file was generated by swaggo/swag - package docs -import ( - "bytes" - "encoding/json" - "strings" - - "github.com/alecthomas/template" - "github.com/swaggo/swag" -) +import "github.com/swaggo/swag" -var doc = `{ +const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { - "description": "{{.Description}}", + "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, "license": { @@ -231,7 +223,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptControl" + "$ref": "#/definitions/dto.SysDeptInsertReq" } } ], @@ -262,7 +254,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptById" + "$ref": "#/definitions/dto.SysDeptDeleteReq" } } ], @@ -287,19 +279,13 @@ var doc = `{ "tags": [ "部门" ], - "summary": "部门列表数据", + "summary": "获取部门数据", "parameters": [ { "type": "string", "description": "deptId", "name": "deptId", "in": "path" - }, - { - "type": "string", - "description": "position", - "name": "position", - "in": "query" } ], "responses": { @@ -339,7 +325,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptControl" + "$ref": "#/definitions/dto.SysDeptUpdateReq" } } ], @@ -376,9 +362,24 @@ var doc = `{ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/response.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.SysDictDataGetAllResp" + } + } + } + } + ] } } } @@ -458,15 +459,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataControl" + "$ref": "#/definitions/dto.SysDictDataInsertReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"message\": \"添加成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -489,15 +490,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataById" + "$ref": "#/definitions/dto.SysDictDataDeleteReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"message\": \"删除成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -554,15 +555,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataControl" + "$ref": "#/definitions/dto.SysDictDataUpdateReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"message\": \"修改成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -642,15 +643,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictTypeControl" + "$ref": "#/definitions/dto.SysDictTypeInsertReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -668,18 +669,20 @@ var doc = `{ "summary": "删除字典类型", "parameters": [ { - "type": "integer", - "description": "dictId", - "name": "dictId", - "in": "path", - "required": true + "description": "body", + "name": "dictCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SysDictTypeDeleteReq" + } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -778,15 +781,15 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictTypeControl" + "$ref": "#/definitions/dto.SysDictTypeUpdateReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -858,12 +861,6 @@ var doc = `{ ], "summary": "Menu列表数据", "parameters": [ - { - "type": "string", - "description": "menuName", - "name": "menuName", - "in": "query" - }, { "type": "string", "description": "menuName", @@ -901,7 +898,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuControl" + "$ref": "#/definitions/dto.SysMenuInsertReq" } } ], @@ -932,7 +929,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuById" + "$ref": "#/definitions/dto.SysMenuDeleteReq" } } ], @@ -1003,7 +1000,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuControl" + "$ref": "#/definitions/dto.SysMenuUpdateReq" } } ], @@ -1147,9 +1144,9 @@ var doc = `{ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1178,15 +1175,9 @@ var doc = `{ ], "responses": { "200": { - "description": "{\"code\": 200, \"message\": \"删除成功\"}", - "schema": { - "type": "string" - } - }, - "500": { - "description": "{\"code\": 500, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1220,9 +1211,9 @@ var doc = `{ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1374,7 +1365,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleControl" + "$ref": "#/definitions/dto.SysRoleInsertReq" } } ], @@ -1405,7 +1396,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleById" + "$ref": "#/definitions/dto.SysRoleDeleteReq" } } ], @@ -1505,7 +1496,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleControl" + "$ref": "#/definitions/dto.SysRoleUpdateReq" } } ], @@ -1715,14 +1706,12 @@ var doc = `{ "summary": "删除接口管理", "parameters": [ { - "description": "ids", - "name": "ids", + "description": "body", + "name": "data", "in": "body", + "required": true, "schema": { - "type": "array", - "items": { - "type": "integer" - } + "$ref": "#/definitions/dto.SysApiDeleteReq" } } ], @@ -1798,7 +1787,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysApiControl" + "$ref": "#/definitions/dto.SysApiUpdateReq" } } ], @@ -2119,7 +2108,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysLoginLogById" + "$ref": "#/definitions/dto.SysLoginLogDeleteReq" } } ], @@ -2252,7 +2241,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysOperaLogById" + "$ref": "#/definitions/dto.SysOperaLogDeleteReq" } } ], @@ -2346,7 +2335,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysUserControl" + "$ref": "#/definitions/dto.SysUserInsertReq" } } ], @@ -2411,7 +2400,7 @@ var doc = `{ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysUserControl" + "$ref": "#/definitions/dto.SysUserUpdateReq" } } ], @@ -2719,7 +2708,7 @@ var doc = `{ "tags": [ "用户" ], - "summary": "重置密码", + "summary": "修改密码", "parameters": [ { "description": "body", @@ -2814,10 +2803,6 @@ var doc = `{ }, "dto.PassWord": { "type": "object", - "required": [ - "newPassword", - "oldPassword" - ], "properties": { "newPassword": { "type": "string" @@ -2829,10 +2814,6 @@ var doc = `{ }, "dto.ResetSysUserPwdReq": { "type": "object", - "required": [ - "password", - "userId" - ], "properties": { "createBy": { "type": "integer" @@ -2870,7 +2851,18 @@ var doc = `{ } } }, - "dto.SysApiControl": { + "dto.SysApiDeleteReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysApiUpdateReq": { "type": "object", "properties": { "action": { @@ -2931,7 +2923,7 @@ var doc = `{ "type": "integer" }, "isFrontend": { - "type": "integer" + "type": "string" }, "remark": { "type": "string" @@ -2941,12 +2933,9 @@ var doc = `{ } } }, - "dto.SysDeptById": { + "dto.SysDeptDeleteReq": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "ids": { "type": "array", "items": { @@ -2955,7 +2944,7 @@ var doc = `{ } } }, - "dto.SysDeptControl": { + "dto.SysDeptInsertReq": { "type": "object", "properties": { "createBy": { @@ -3002,13 +2991,57 @@ var doc = `{ } } }, - "dto.SysDictDataById": { + "dto.SysDeptUpdateReq": { "type": "object", "properties": { "createBy": { "type": "integer" }, - "id": { + "deptId": { + "description": "编码", + "type": "integer" + }, + "deptName": { + "description": "部门名称", + "type": "string" + }, + "deptPath": { + "description": "路径", + "type": "string" + }, + "email": { + "description": "邮箱", + "type": "string" + }, + "leader": { + "description": "负责人", + "type": "string" + }, + "parentId": { + "description": "上级部门", + "type": "integer" + }, + "phone": { + "description": "手机", + "type": "string" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "status": { + "description": "状态", + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictDataDeleteReq": { + "type": "object", + "properties": { + "createBy": { "type": "integer" }, "ids": { @@ -3022,7 +3055,59 @@ var doc = `{ } } }, - "dto.SysDictDataControl": { + "dto.SysDictDataGetAllResp": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "dto.SysDictDataInsertReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, + "cssClass": { + "type": "string" + }, + "default": { + "type": "string" + }, + "dictLabel": { + "type": "string" + }, + "dictSort": { + "type": "integer" + }, + "dictType": { + "type": "string" + }, + "dictValue": { + "type": "string" + }, + "isDefault": { + "type": "string" + }, + "listClass": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictDataUpdateReq": { "type": "object", "properties": { "createBy": { @@ -3066,7 +3151,24 @@ var doc = `{ } } }, - "dto.SysDictTypeControl": { + "dto.SysDictTypeDeleteReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, + "ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictTypeInsertReq": { "type": "object", "properties": { "createBy": { @@ -3092,15 +3194,49 @@ var doc = `{ } } }, - "dto.SysLoginLogById": { + "dto.SysDictTypeUpdateReq": { "type": "object", "properties": { "createBy": { "type": "integer" }, + "dictName": { + "type": "string" + }, + "dictType": { + "type": "string" + }, "id": { "type": "integer" }, + "remark": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysLoginLogDeleteReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysMenuDeleteReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, "ids": { "type": "array", "items": { @@ -3112,27 +3248,94 @@ var doc = `{ } } }, - "dto.SysMenuById": { + "dto.SysMenuInsertReq": { "type": "object", "properties": { + "action": { + "description": "请求方式", + "type": "string" + }, + "apis": { + "type": "array", + "items": { + "type": "integer" + } + }, + "breadcrumb": { + "description": "是否面包屑", + "type": "string" + }, + "component": { + "description": "组件", + "type": "string" + }, "createBy": { "type": "integer" }, - "id": { + "icon": { + "description": "图标", + "type": "string" + }, + "isFrame": { + "description": "是否frame", + "type": "string" + }, + "menuId": { + "description": "编码", "type": "integer" }, - "ids": { + "menuName": { + "description": "菜单name", + "type": "string" + }, + "menuType": { + "description": "菜单类型", + "type": "string" + }, + "noCache": { + "description": "是否缓存", + "type": "boolean" + }, + "parentId": { + "description": "上级菜单", + "type": "integer" + }, + "path": { + "description": "路径", + "type": "string" + }, + "paths": { + "description": "id路径", + "type": "string" + }, + "permission": { + "description": "权限编码", + "type": "string" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "sysApi": { "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/models.SysApi" } }, + "title": { + "description": "显示名称", + "type": "string" + }, "updateBy": { "type": "integer" + }, + "visible": { + "description": "是否显示", + "type": "string" } } }, - "dto.SysMenuControl": { + "dto.SysMenuUpdateReq": { "type": "object", "properties": { "action": { @@ -3219,12 +3422,9 @@ var doc = `{ } } }, - "dto.SysOperaLogById": { + "dto.SysOperaLogDeleteReq": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "ids": { "type": "array", "items": { @@ -3308,21 +3508,87 @@ var doc = `{ } } }, - "dto.SysRoleById": { + "dto.SysRoleDeleteReq": { "type": "object", "properties": { - "id": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysRoleInsertReq": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "createBy": { "type": "integer" }, - "ids": { + "dataScope": { + "type": "string" + }, + "deptIds": { "type": "array", "items": { "type": "integer" } + }, + "flag": { + "description": "标记", + "type": "string" + }, + "menuIds": { + "type": "array", + "items": { + "type": "integer" + } + }, + "remark": { + "description": "备注", + "type": "string" + }, + "roleId": { + "description": "角色编码", + "type": "integer" + }, + "roleKey": { + "description": "角色代码", + "type": "string" + }, + "roleName": { + "description": "角色名称", + "type": "string" + }, + "roleSort": { + "description": "角色排序", + "type": "integer" + }, + "status": { + "description": "状态", + "type": "string" + }, + "sysDept": { + "type": "array", + "items": { + "$ref": "#/definitions/models.SysDept" + } + }, + "sysMenu": { + "type": "array", + "items": { + "$ref": "#/definitions/models.SysMenu" + } + }, + "updateBy": { + "type": "integer" } } }, - "dto.SysRoleControl": { + "dto.SysRoleUpdateReq": { "type": "object", "properties": { "admin": { @@ -3391,16 +3657,8 @@ var doc = `{ } } }, - "dto.SysUserControl": { + "dto.SysUserInsertReq": { "type": "object", - "required": [ - "deptId", - "email", - "nickName", - "phone", - "status", - "username" - ], "properties": { "avatar": { "type": "string" @@ -3451,6 +3709,55 @@ var doc = `{ } } }, + "dto.SysUserUpdateReq": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "createBy": { + "type": "integer" + }, + "deptId": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "nickName": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "postId": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "roleId": { + "type": "integer" + }, + "sex": { + "type": "string" + }, + "status": { + "type": "string", + "default": "1" + }, + "updateBy": { + "type": "integer" + }, + "userId": { + "description": "用户ID", + "type": "integer" + }, + "username": { + "type": "string" + } + } + }, "dto.UpdateStatusReq": { "type": "object", "properties": { @@ -3472,10 +3779,6 @@ var doc = `{ }, "dto.UpdateSysUserStatusReq": { "type": "object", - "required": [ - "status", - "userId" - ], "properties": { "createBy": { "type": "integer" @@ -3575,7 +3878,7 @@ var doc = `{ "type": "integer" }, "isFrontend": { - "type": "integer" + "type": "string" }, "remark": { "type": "string" @@ -4053,49 +4356,18 @@ var doc = `{ } }` -type swaggerInfo struct { - Version string - Host string - BasePath string - Schemes []string - Title string - Description string -} - // SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = swaggerInfo{ - Version: "2.0.0", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "go-admin API", - Description: "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", -} - -type s struct{} - -func (s *s) ReadDoc() string { - sInfo := SwaggerInfo - sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) - - t, err := template.New("swagger_info").Funcs(template.FuncMap{ - "marshal": func(v interface{}) string { - a, _ := json.Marshal(v) - return string(a) - }, - }).Parse(doc) - if err != nil { - return doc - } - - var tpl bytes.Buffer - if err := t.Execute(&tpl, sInfo); err != nil { - return doc - } - - return tpl.String() +var SwaggerInfo = &swag.Spec{ + Version: "2.0.0", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "go-admin API", + Description: "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, } func init() { - swag.Register(swag.Name, &s{}) + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) } diff --git a/docs/swagger.json b/docs/swagger.json index fbee1c099..a6ec8185c 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -214,7 +214,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptControl" + "$ref": "#/definitions/dto.SysDeptInsertReq" } } ], @@ -245,7 +245,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptById" + "$ref": "#/definitions/dto.SysDeptDeleteReq" } } ], @@ -270,19 +270,13 @@ "tags": [ "部门" ], - "summary": "部门列表数据", + "summary": "获取部门数据", "parameters": [ { "type": "string", "description": "deptId", "name": "deptId", "in": "path" - }, - { - "type": "string", - "description": "position", - "name": "position", - "in": "query" } ], "responses": { @@ -322,7 +316,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDeptControl" + "$ref": "#/definitions/dto.SysDeptUpdateReq" } } ], @@ -359,9 +353,24 @@ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/response.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/dto.SysDictDataGetAllResp" + } + } + } + } + ] } } } @@ -441,15 +450,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataControl" + "$ref": "#/definitions/dto.SysDictDataInsertReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"message\": \"添加成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -472,15 +481,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataById" + "$ref": "#/definitions/dto.SysDictDataDeleteReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"message\": \"删除成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -537,15 +546,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictDataControl" + "$ref": "#/definitions/dto.SysDictDataUpdateReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"message\": \"修改成功\"}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -625,15 +634,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictTypeControl" + "$ref": "#/definitions/dto.SysDictTypeInsertReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -651,18 +660,20 @@ "summary": "删除字典类型", "parameters": [ { - "type": "integer", - "description": "dictId", - "name": "dictId", - "in": "path", - "required": true + "description": "body", + "name": "dictCode", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.SysDictTypeDeleteReq" + } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -761,15 +772,15 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysDictTypeControl" + "$ref": "#/definitions/dto.SysDictTypeUpdateReq" } } ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -841,12 +852,6 @@ ], "summary": "Menu列表数据", "parameters": [ - { - "type": "string", - "description": "menuName", - "name": "menuName", - "in": "query" - }, { "type": "string", "description": "menuName", @@ -884,7 +889,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuControl" + "$ref": "#/definitions/dto.SysMenuInsertReq" } } ], @@ -915,7 +920,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuById" + "$ref": "#/definitions/dto.SysMenuDeleteReq" } } ], @@ -986,7 +991,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysMenuControl" + "$ref": "#/definitions/dto.SysMenuUpdateReq" } } ], @@ -1130,9 +1135,9 @@ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1161,15 +1166,9 @@ ], "responses": { "200": { - "description": "{\"code\": 200, \"message\": \"删除成功\"}", - "schema": { - "type": "string" - } - }, - "500": { - "description": "{\"code\": 500, \"message\": \"删除失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1203,9 +1202,9 @@ ], "responses": { "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "description": "{\"code\": 200, \"data\": [...]}", "schema": { - "type": "string" + "$ref": "#/definitions/response.Response" } } } @@ -1357,7 +1356,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleControl" + "$ref": "#/definitions/dto.SysRoleInsertReq" } } ], @@ -1388,7 +1387,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleById" + "$ref": "#/definitions/dto.SysRoleDeleteReq" } } ], @@ -1488,7 +1487,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysRoleControl" + "$ref": "#/definitions/dto.SysRoleUpdateReq" } } ], @@ -1698,14 +1697,12 @@ "summary": "删除接口管理", "parameters": [ { - "description": "ids", - "name": "ids", + "description": "body", + "name": "data", "in": "body", + "required": true, "schema": { - "type": "array", - "items": { - "type": "integer" - } + "$ref": "#/definitions/dto.SysApiDeleteReq" } } ], @@ -1781,7 +1778,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysApiControl" + "$ref": "#/definitions/dto.SysApiUpdateReq" } } ], @@ -2102,7 +2099,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysLoginLogById" + "$ref": "#/definitions/dto.SysLoginLogDeleteReq" } } ], @@ -2235,7 +2232,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysOperaLogById" + "$ref": "#/definitions/dto.SysOperaLogDeleteReq" } } ], @@ -2329,7 +2326,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysUserControl" + "$ref": "#/definitions/dto.SysUserInsertReq" } } ], @@ -2394,7 +2391,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/dto.SysUserControl" + "$ref": "#/definitions/dto.SysUserUpdateReq" } } ], @@ -2702,7 +2699,7 @@ "tags": [ "用户" ], - "summary": "重置密码", + "summary": "修改密码", "parameters": [ { "description": "body", @@ -2797,10 +2794,6 @@ }, "dto.PassWord": { "type": "object", - "required": [ - "newPassword", - "oldPassword" - ], "properties": { "newPassword": { "type": "string" @@ -2812,10 +2805,6 @@ }, "dto.ResetSysUserPwdReq": { "type": "object", - "required": [ - "password", - "userId" - ], "properties": { "createBy": { "type": "integer" @@ -2853,7 +2842,18 @@ } } }, - "dto.SysApiControl": { + "dto.SysApiDeleteReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysApiUpdateReq": { "type": "object", "properties": { "action": { @@ -2914,7 +2914,7 @@ "type": "integer" }, "isFrontend": { - "type": "integer" + "type": "string" }, "remark": { "type": "string" @@ -2924,12 +2924,9 @@ } } }, - "dto.SysDeptById": { + "dto.SysDeptDeleteReq": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "ids": { "type": "array", "items": { @@ -2938,7 +2935,7 @@ } } }, - "dto.SysDeptControl": { + "dto.SysDeptInsertReq": { "type": "object", "properties": { "createBy": { @@ -2985,13 +2982,57 @@ } } }, - "dto.SysDictDataById": { + "dto.SysDeptUpdateReq": { "type": "object", "properties": { "createBy": { "type": "integer" }, - "id": { + "deptId": { + "description": "编码", + "type": "integer" + }, + "deptName": { + "description": "部门名称", + "type": "string" + }, + "deptPath": { + "description": "路径", + "type": "string" + }, + "email": { + "description": "邮箱", + "type": "string" + }, + "leader": { + "description": "负责人", + "type": "string" + }, + "parentId": { + "description": "上级部门", + "type": "integer" + }, + "phone": { + "description": "手机", + "type": "string" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "status": { + "description": "状态", + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictDataDeleteReq": { + "type": "object", + "properties": { + "createBy": { "type": "integer" }, "ids": { @@ -3005,7 +3046,59 @@ } } }, - "dto.SysDictDataControl": { + "dto.SysDictDataGetAllResp": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "dto.SysDictDataInsertReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, + "cssClass": { + "type": "string" + }, + "default": { + "type": "string" + }, + "dictLabel": { + "type": "string" + }, + "dictSort": { + "type": "integer" + }, + "dictType": { + "type": "string" + }, + "dictValue": { + "type": "string" + }, + "isDefault": { + "type": "string" + }, + "listClass": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictDataUpdateReq": { "type": "object", "properties": { "createBy": { @@ -3049,7 +3142,24 @@ } } }, - "dto.SysDictTypeControl": { + "dto.SysDictTypeDeleteReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, + "ids": { + "type": "array", + "items": { + "type": "integer" + } + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysDictTypeInsertReq": { "type": "object", "properties": { "createBy": { @@ -3075,15 +3185,49 @@ } } }, - "dto.SysLoginLogById": { + "dto.SysDictTypeUpdateReq": { "type": "object", "properties": { "createBy": { "type": "integer" }, + "dictName": { + "type": "string" + }, + "dictType": { + "type": "string" + }, "id": { "type": "integer" }, + "remark": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + } + } + }, + "dto.SysLoginLogDeleteReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysMenuDeleteReq": { + "type": "object", + "properties": { + "createBy": { + "type": "integer" + }, "ids": { "type": "array", "items": { @@ -3095,27 +3239,94 @@ } } }, - "dto.SysMenuById": { + "dto.SysMenuInsertReq": { "type": "object", "properties": { + "action": { + "description": "请求方式", + "type": "string" + }, + "apis": { + "type": "array", + "items": { + "type": "integer" + } + }, + "breadcrumb": { + "description": "是否面包屑", + "type": "string" + }, + "component": { + "description": "组件", + "type": "string" + }, "createBy": { "type": "integer" }, - "id": { + "icon": { + "description": "图标", + "type": "string" + }, + "isFrame": { + "description": "是否frame", + "type": "string" + }, + "menuId": { + "description": "编码", "type": "integer" }, - "ids": { + "menuName": { + "description": "菜单name", + "type": "string" + }, + "menuType": { + "description": "菜单类型", + "type": "string" + }, + "noCache": { + "description": "是否缓存", + "type": "boolean" + }, + "parentId": { + "description": "上级菜单", + "type": "integer" + }, + "path": { + "description": "路径", + "type": "string" + }, + "paths": { + "description": "id路径", + "type": "string" + }, + "permission": { + "description": "权限编码", + "type": "string" + }, + "sort": { + "description": "排序", + "type": "integer" + }, + "sysApi": { "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/models.SysApi" } }, + "title": { + "description": "显示名称", + "type": "string" + }, "updateBy": { "type": "integer" + }, + "visible": { + "description": "是否显示", + "type": "string" } } }, - "dto.SysMenuControl": { + "dto.SysMenuUpdateReq": { "type": "object", "properties": { "action": { @@ -3202,12 +3413,9 @@ } } }, - "dto.SysOperaLogById": { + "dto.SysOperaLogDeleteReq": { "type": "object", "properties": { - "id": { - "type": "integer" - }, "ids": { "type": "array", "items": { @@ -3291,21 +3499,87 @@ } } }, - "dto.SysRoleById": { + "dto.SysRoleDeleteReq": { "type": "object", "properties": { - "id": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "dto.SysRoleInsertReq": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "createBy": { "type": "integer" }, - "ids": { + "dataScope": { + "type": "string" + }, + "deptIds": { + "type": "array", + "items": { + "type": "integer" + } + }, + "flag": { + "description": "标记", + "type": "string" + }, + "menuIds": { "type": "array", "items": { "type": "integer" } + }, + "remark": { + "description": "备注", + "type": "string" + }, + "roleId": { + "description": "角色编码", + "type": "integer" + }, + "roleKey": { + "description": "角色代码", + "type": "string" + }, + "roleName": { + "description": "角色名称", + "type": "string" + }, + "roleSort": { + "description": "角色排序", + "type": "integer" + }, + "status": { + "description": "状态", + "type": "string" + }, + "sysDept": { + "type": "array", + "items": { + "$ref": "#/definitions/models.SysDept" + } + }, + "sysMenu": { + "type": "array", + "items": { + "$ref": "#/definitions/models.SysMenu" + } + }, + "updateBy": { + "type": "integer" } } }, - "dto.SysRoleControl": { + "dto.SysRoleUpdateReq": { "type": "object", "properties": { "admin": { @@ -3374,16 +3648,8 @@ } } }, - "dto.SysUserControl": { + "dto.SysUserInsertReq": { "type": "object", - "required": [ - "deptId", - "email", - "nickName", - "phone", - "status", - "username" - ], "properties": { "avatar": { "type": "string" @@ -3434,6 +3700,55 @@ } } }, + "dto.SysUserUpdateReq": { + "type": "object", + "properties": { + "avatar": { + "type": "string" + }, + "createBy": { + "type": "integer" + }, + "deptId": { + "type": "integer" + }, + "email": { + "type": "string" + }, + "nickName": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "postId": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "roleId": { + "type": "integer" + }, + "sex": { + "type": "string" + }, + "status": { + "type": "string", + "default": "1" + }, + "updateBy": { + "type": "integer" + }, + "userId": { + "description": "用户ID", + "type": "integer" + }, + "username": { + "type": "string" + } + } + }, "dto.UpdateStatusReq": { "type": "object", "properties": { @@ -3455,10 +3770,6 @@ }, "dto.UpdateSysUserStatusReq": { "type": "object", - "required": [ - "status", - "userId" - ], "properties": { "createBy": { "type": "integer" @@ -3558,7 +3869,7 @@ "type": "integer" }, "isFrontend": { - "type": "integer" + "type": "string" }, "remark": { "type": "string" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 69a667ccf..95dee5aef 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -12,9 +12,6 @@ definitions: type: string oldPassword: type: string - required: - - newPassword - - oldPassword type: object dto.ResetSysUserPwdReq: properties: @@ -27,9 +24,6 @@ definitions: userId: description: 用户ID type: integer - required: - - password - - userId type: object dto.RoleDataScopeReq: properties: @@ -45,7 +39,14 @@ definitions: - dataScope - roleId type: object - dto.SysApiControl: + dto.SysApiDeleteReq: + properties: + ids: + items: + type: integer + type: array + type: object + dto.SysApiUpdateReq: properties: action: type: string @@ -86,22 +87,20 @@ definitions: description: 编码 type: integer isFrontend: - type: integer + type: string remark: type: string updateBy: type: integer type: object - dto.SysDeptById: + dto.SysDeptDeleteReq: properties: - id: - type: integer ids: items: type: integer type: array type: object - dto.SysDeptControl: + dto.SysDeptInsertReq: properties: createBy: type: integer @@ -135,11 +134,43 @@ definitions: updateBy: type: integer type: object - dto.SysDictDataById: + dto.SysDeptUpdateReq: properties: createBy: type: integer - id: + deptId: + description: 编码 + type: integer + deptName: + description: 部门名称 + type: string + deptPath: + description: 路径 + type: string + email: + description: 邮箱 + type: string + leader: + description: 负责人 + type: string + parentId: + description: 上级部门 + type: integer + phone: + description: 手机 + type: string + sort: + description: 排序 + type: integer + status: + description: 状态 + type: integer + updateBy: + type: integer + type: object + dto.SysDictDataDeleteReq: + properties: + createBy: type: integer ids: items: @@ -148,7 +179,41 @@ definitions: updateBy: type: integer type: object - dto.SysDictDataControl: + dto.SysDictDataGetAllResp: + properties: + label: + type: string + value: + type: string + type: object + dto.SysDictDataInsertReq: + properties: + createBy: + type: integer + cssClass: + type: string + default: + type: string + dictLabel: + type: string + dictSort: + type: integer + dictType: + type: string + dictValue: + type: string + isDefault: + type: string + listClass: + type: string + remark: + type: string + status: + type: integer + updateBy: + type: integer + type: object + dto.SysDictDataUpdateReq: properties: createBy: type: integer @@ -177,7 +242,18 @@ definitions: updateBy: type: integer type: object - dto.SysDictTypeControl: + dto.SysDictTypeDeleteReq: + properties: + createBy: + type: integer + ids: + items: + type: integer + type: array + updateBy: + type: integer + type: object + dto.SysDictTypeInsertReq: properties: createBy: type: integer @@ -194,25 +270,34 @@ definitions: updateBy: type: integer type: object - dto.SysLoginLogById: + dto.SysDictTypeUpdateReq: properties: createBy: type: integer + dictName: + type: string + dictType: + type: string id: type: integer + remark: + type: string + status: + type: integer + updateBy: + type: integer + type: object + dto.SysLoginLogDeleteReq: + properties: ids: items: type: integer type: array - updateBy: - type: integer type: object - dto.SysMenuById: + dto.SysMenuDeleteReq: properties: createBy: type: integer - id: - type: integer ids: items: type: integer @@ -220,7 +305,7 @@ definitions: updateBy: type: integer type: object - dto.SysMenuControl: + dto.SysMenuInsertReq: properties: action: description: 请求方式 @@ -283,10 +368,71 @@ definitions: description: 是否显示 type: string type: object - dto.SysOperaLogById: + dto.SysMenuUpdateReq: properties: - id: + action: + description: 请求方式 + type: string + apis: + items: + type: integer + type: array + breadcrumb: + description: 是否面包屑 + type: string + component: + description: 组件 + type: string + createBy: + type: integer + icon: + description: 图标 + type: string + isFrame: + description: 是否frame + type: string + menuId: + description: 编码 + type: integer + menuName: + description: 菜单name + type: string + menuType: + description: 菜单类型 + type: string + noCache: + description: 是否缓存 + type: boolean + parentId: + description: 上级菜单 + type: integer + path: + description: 路径 + type: string + paths: + description: id路径 + type: string + permission: + description: 权限编码 + type: string + sort: + description: 排序 type: integer + sysApi: + items: + $ref: '#/definitions/models.SysApi' + type: array + title: + description: 显示名称 + type: string + updateBy: + type: integer + visible: + description: 是否显示 + type: string + type: object + dto.SysOperaLogDeleteReq: + properties: ids: items: type: integer @@ -341,16 +487,62 @@ definitions: updateBy: type: integer type: object - dto.SysRoleById: + dto.SysRoleDeleteReq: properties: - id: - type: integer ids: items: type: integer type: array type: object - dto.SysRoleControl: + dto.SysRoleInsertReq: + properties: + admin: + type: boolean + createBy: + type: integer + dataScope: + type: string + deptIds: + items: + type: integer + type: array + flag: + description: 标记 + type: string + menuIds: + items: + type: integer + type: array + remark: + description: 备注 + type: string + roleId: + description: 角色编码 + type: integer + roleKey: + description: 角色代码 + type: string + roleName: + description: 角色名称 + type: string + roleSort: + description: 角色排序 + type: integer + status: + description: 状态 + type: string + sysDept: + items: + $ref: '#/definitions/models.SysDept' + type: array + sysMenu: + items: + $ref: '#/definitions/models.SysMenu' + type: array + updateBy: + type: integer + type: object + dto.SysRoleUpdateReq: properties: admin: type: boolean @@ -398,7 +590,7 @@ definitions: updateBy: type: integer type: object - dto.SysUserControl: + dto.SysUserInsertReq: properties: avatar: type: string @@ -432,13 +624,39 @@ definitions: type: integer username: type: string - required: - - deptId - - email - - nickName - - phone - - status - - username + type: object + dto.SysUserUpdateReq: + properties: + avatar: + type: string + createBy: + type: integer + deptId: + type: integer + email: + type: string + nickName: + type: string + phone: + type: string + postId: + type: integer + remark: + type: string + roleId: + type: integer + sex: + type: string + status: + default: "1" + type: string + updateBy: + type: integer + userId: + description: 用户ID + type: integer + username: + type: string type: object dto.UpdateStatusReq: properties: @@ -464,9 +682,6 @@ definitions: userId: description: 用户ID type: integer - required: - - status - - userId type: object handler.Login: properties: @@ -524,7 +739,7 @@ definitions: id: type: integer isFrontend: - type: integer + type: string remark: type: string updateBy: @@ -945,7 +1160,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDeptById' + $ref: '#/definitions/dto.SysDeptDeleteReq' responses: "200": description: '{"code": -1, "message": "删除失败"}' @@ -991,7 +1206,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDeptControl' + $ref: '#/definitions/dto.SysDeptInsertReq' responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1010,10 +1225,6 @@ paths: in: path name: deptId type: string - - description: position - in: query - name: position - type: string responses: "200": description: '{"code": 200, "data": [...]}' @@ -1021,7 +1232,7 @@ paths: $ref: '#/definitions/response.Response' security: - Bearer: [] - summary: 部门列表数据 + summary: 获取部门数据 tags: - 部门 put: @@ -1039,7 +1250,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDeptControl' + $ref: '#/definitions/dto.SysDeptUpdateReq' responses: "200": description: '{"code": -1, "message": "添加失败"}' @@ -1061,9 +1272,16 @@ paths: type: integer responses: "200": - description: '{"code": -1, "message": "删除失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + allOf: + - $ref: '#/definitions/response.Response' + - properties: + data: + items: + $ref: '#/definitions/dto.SysDictDataGetAllResp' + type: array + type: object security: - Bearer: [] summary: 数据字典根据key获取 @@ -1078,12 +1296,12 @@ paths: name: dictCode required: true schema: - $ref: '#/definitions/dto.SysDictDataById' + $ref: '#/definitions/dto.SysDictDataDeleteReq' responses: "200": - description: '{"code": -1, "message": "删除失败"}' + description: '{"code": 200, "message": "删除成功"}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 删除字典数据 @@ -1132,12 +1350,12 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDictDataControl' + $ref: '#/definitions/dto.SysDictDataInsertReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "message": "添加成功"}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 添加字典数据 @@ -1172,12 +1390,12 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDictDataControl' + $ref: '#/definitions/dto.SysDictDataUpdateReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "message": "修改成功"}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 修改字典数据 @@ -1187,16 +1405,17 @@ paths: delete: description: 删除数据 parameters: - - description: dictId - in: path - name: dictId + - description: body + in: body + name: dictCode required: true - type: integer + schema: + $ref: '#/definitions/dto.SysDictTypeDeleteReq' responses: "200": - description: '{"code": -1, "message": "删除失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 删除字典类型 @@ -1245,12 +1464,12 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDictTypeControl' + $ref: '#/definitions/dto.SysDictTypeInsertReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 添加字典类型 @@ -1311,12 +1530,12 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysDictTypeControl' + $ref: '#/definitions/dto.SysDictTypeUpdateReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 修改字典类型 @@ -1372,7 +1591,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysMenuById' + $ref: '#/definitions/dto.SysMenuDeleteReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1386,10 +1605,6 @@ paths: get: description: 获取JSON parameters: - - description: menuName - in: query - name: menuName - type: string - description: menuName in: query name: menuName @@ -1414,7 +1629,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysMenuControl' + $ref: '#/definitions/dto.SysMenuInsertReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1458,7 +1673,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysMenuControl' + $ref: '#/definitions/dto.SysMenuUpdateReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1515,13 +1730,9 @@ paths: $ref: '#/definitions/dto.SysPostDeleteReq' responses: "200": - description: '{"code": 200, "message": "删除成功"}' - schema: - type: string - "500": - description: '{"code": 500, "message": "删除失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 删除岗位 @@ -1569,9 +1780,9 @@ paths: $ref: '#/definitions/dto.SysPostInsertReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 添加岗位 @@ -1591,9 +1802,9 @@ paths: $ref: '#/definitions/dto.SysPostUpdateReq' responses: "200": - description: '{"code": -1, "message": "添加失败"}' + description: '{"code": 200, "data": [...]}' schema: - type: string + $ref: '#/definitions/response.Response' security: - Bearer: [] summary: 修改岗位 @@ -1653,7 +1864,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysRoleById' + $ref: '#/definitions/dto.SysRoleDeleteReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1707,7 +1918,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysRoleControl' + $ref: '#/definitions/dto.SysRoleInsertReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1768,7 +1979,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysRoleControl' + $ref: '#/definitions/dto.SysRoleUpdateReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -1840,13 +2051,12 @@ paths: delete: description: 删除接口管理 parameters: - - description: ids + - description: body in: body - name: ids + name: data + required: true schema: - items: - type: integer - type: array + $ref: '#/definitions/dto.SysApiDeleteReq' responses: "200": description: '{"code": 200, "message": "删除成功"}' @@ -1939,7 +2149,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysApiControl' + $ref: '#/definitions/dto.SysApiUpdateReq' responses: "200": description: '{"code": 200, "message": "修改成功"}' @@ -2094,7 +2304,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysLoginLogById' + $ref: '#/definitions/dto.SysLoginLogDeleteReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -2169,7 +2379,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysOperaLogById' + $ref: '#/definitions/dto.SysOperaLogDeleteReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -2271,7 +2481,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysUserControl' + $ref: '#/definitions/dto.SysUserInsertReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -2329,7 +2539,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/dto.SysUserControl' + $ref: '#/definitions/dto.SysUserUpdateReq' responses: "200": description: '{"code": 200, "data": [...]}' @@ -2515,7 +2725,7 @@ paths: $ref: '#/definitions/response.Response' security: - Bearer: [] - summary: 重置密码 + summary: 修改密码 tags: - 用户 /api/v1/user/status: diff --git a/go.mod b/go.mod index f7de68684..02502f511 100644 --- a/go.mod +++ b/go.mod @@ -8,23 +8,42 @@ require ( github.com/alibaba/sentinel-golang/pkg/adapters/gin v0.0.0-20220808015021-c5f1f1d055c5 github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5 github.com/bitly/go-simplejson v0.5.0 + github.com/bsm/redislock v0.5.0 github.com/bytedance/go-tagexpr/v2 v2.7.12 github.com/casbin/casbin/v2 v2.51.2 + github.com/casbin/redis-watcher/v2 v2.0.0-20220614104201-0e70bf2be930 + github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd github.com/gin-gonic/gin v1.7.7 github.com/go-admin-team/go-admin-core v1.4.1-0.20220809101213-21187928f7d9 + github.com/go-admin-team/go-admin-core/plugins/logger/zap v0.0.0-20210610020726-2db73adb505d github.com/go-admin-team/go-admin-core/sdk v1.4.1-0.20220809101213-21187928f7d9 + github.com/go-admin-team/gorm-adapter/v3 v3.7.8-0.20220809100335-eaf9f67b3d21 + github.com/go-playground/locales v0.14.0 + github.com/go-playground/universal-translator v0.18.0 + github.com/go-playground/validator/v10 v10.8.0 + github.com/go-redis/redis/v7 v7.4.0 + github.com/go-redis/redis/v8 v8.11.5 + github.com/golang-jwt/jwt/v4 v4.4.2 github.com/google/uuid v1.3.0 + github.com/gorilla/websocket v1.4.2 github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible + github.com/mojocn/base64Captcha v1.3.1 github.com/mssola/user_agent v0.5.2 + github.com/nsqio/go-nsq v1.0.8 github.com/opentracing/opentracing-go v1.1.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 + github.com/robinjoseph08/redisqueue/v2 v2.1.0 + github.com/shamsher31/goimgext v1.0.0 github.com/shirou/gopsutil/v3 v3.22.1 + github.com/slok/go-http-metrics v0.9.0 + github.com/smartystreets/goconvey v1.6.4 github.com/spf13/cobra v1.0.0 - github.com/swaggo/gin-swagger v1.2.0 - github.com/swaggo/swag v1.6.7 + github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a + github.com/swaggo/gin-swagger v1.5.0 + github.com/swaggo/swag v1.8.3 github.com/unrolled/secure v1.0.8 golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 gorm.io/driver/mysql v1.3.5 @@ -42,11 +61,8 @@ require ( github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bsm/redislock v0.5.0 // indirect - github.com/casbin/redis-watcher/v2 v2.0.0-20220614104201-0e70bf2be930 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chanxuehong/rand v0.0.0-20201110082127-2f19a1bdd973 // indirect - github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/denisenkom/go-mssqldb v0.12.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect @@ -55,26 +71,18 @@ require ( github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/git-chglog/git-chglog v0.0.0-20190611050339-63a4e637021f // indirect - github.com/go-admin-team/go-admin-core/plugins/logger/zap v0.0.0-20210610020726-2db73adb505d // indirect - github.com/go-admin-team/gorm-adapter/v3 v3.7.8-0.20220809100335-eaf9f67b3d21 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-openapi/jsonpointer v0.19.3 // indirect - github.com/go-openapi/jsonreference v0.19.3 // indirect - github.com/go-openapi/spec v0.19.4 // indirect - github.com/go-openapi/swag v0.19.5 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.8.0 // indirect - github.com/go-redis/redis/v7 v7.4.0 // indirect - github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.6 // indirect + github.com/go-openapi/spec v0.20.4 // indirect + github.com/go-openapi/swag v0.19.15 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/protobuf v1.4.3 // indirect github.com/golang/snappy v0.0.1 // indirect - github.com/gorilla/websocket v1.4.2 // indirect + github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect github.com/henrylee2cn/ameda v1.4.10 // indirect github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 // indirect github.com/imdario/mergo v0.3.9 // indirect @@ -89,11 +97,13 @@ require ( github.com/jackc/pgx/v4 v4.16.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.11 // indirect + github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e // indirect + github.com/mailru/easyjson v0.7.6 // indirect github.com/mattn/go-colorable v0.1.7 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-sqlite3 v1.14.12 // indirect @@ -102,17 +112,14 @@ require ( github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/mojocn/base64Captcha v1.3.1 // indirect - github.com/nsqio/go-nsq v1.0.8 // indirect github.com/nyaruka/phonenumbers v1.0.55 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect - github.com/robinjoseph08/redisqueue/v2 v2.1.0 // indirect github.com/russross/blackfriday/v2 v2.0.1 // indirect - github.com/shamsher31/goimgext v1.0.0 // indirect github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect + github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.3 // indirect github.com/tklauser/go-sysconf v0.3.9 // indirect @@ -126,12 +133,12 @@ require ( go.uber.org/zap v1.15.0 // indirect golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect - golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect + golang.org/x/tools v0.1.10 // indirect google.golang.org/protobuf v1.26.0-rc.1 // indirect gopkg.in/AlecAivazis/survey.v1 v1.8.5 // indirect gopkg.in/kyokomi/emoji.v1 v1.5.1 // indirect From 1f8babd9e7bfc8eaa75d23c07e4d74be55eade10 Mon Sep 17 00:00:00 2001 From: NaturalGao <924789862@qq.com> Date: Thu, 25 Aug 2022 01:19:55 +0800 Subject: [PATCH 130/238] fix: fix sys_router && add swag commond --- app/admin/router/sys_router.go | 2 +- cmd/api/server.go | 4 +- docs/{swagger.json => admin/admin_docs.go} | 606 +----------------- docs/{docs.go => admin/admin_swagger.json} | 605 +---------------- .../admin_swagger.yaml} | 378 ----------- ssh/swag.sh | 3 + 6 files changed, 39 insertions(+), 1559 deletions(-) rename docs/{swagger.json => admin/admin_docs.go} (86%) rename docs/{docs.go => admin/admin_swagger.json} (86%) rename docs/{swagger.yaml => admin/admin_swagger.yaml} (86%) create mode 100755 ssh/swag.sh diff --git a/app/admin/router/sys_router.go b/app/admin/router/sys_router.go index 67132a42f..b713e4b0d 100644 --- a/app/admin/router/sys_router.go +++ b/app/admin/router/sys_router.go @@ -15,7 +15,7 @@ import ( "go-admin/common/middleware" "go-admin/common/middleware/handler" - _ "go-admin/docs" + _ "go-admin/docs/admin" ) func InitSysRouter(r *gin.Engine, authMiddleware *jwt.GinJWTMiddleware) *gin.RouterGroup { diff --git a/cmd/api/server.go b/cmd/api/server.go index b5769d6d0..0a274fe4f 100644 --- a/cmd/api/server.go +++ b/cmd/api/server.go @@ -134,8 +134,8 @@ func run() error { fmt.Printf("- Local: http://localhost:%d/ \r\n", config.ApplicationConfig.Port) fmt.Printf("- Network: http://%s:%d/ \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) fmt.Println(pkg.Green("Swagger run at:")) - fmt.Printf("- Local: http://localhost:%d/swagger/index.html \r\n", config.ApplicationConfig.Port) - fmt.Printf("- Network: http://%s:%d/swagger/index.html \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) + fmt.Printf("- Local: http://localhost:%d/swagger/admin/index.html \r\n", config.ApplicationConfig.Port) + fmt.Printf("- Network: http://%s:%d/swagger/admin/index.html \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) fmt.Printf("%s Enter Control + C Shutdown Server \r\n", pkg.GetCurrentTimeStr()) // 等待中断信号以优雅地关闭服务器(设置 5 秒的超时时间) quit := make(chan os.Signal) diff --git a/docs/swagger.json b/docs/admin/admin_docs.go similarity index 86% rename from docs/swagger.json rename to docs/admin/admin_docs.go index a6ec8185c..b2cf06e4c 100644 --- a/docs/swagger.json +++ b/docs/admin/admin_docs.go @@ -1,15 +1,20 @@ -{ +// Package admin GENERATED BY SWAG; DO NOT EDIT +// This file was generated by swaggo/swag +package admin + +import "github.com/swaggo/swag" + +const docTemplateadmin = `{ + "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { - "description": "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", - "title": "go-admin API", + "description": "{{escape .Description}}", + "title": "{{.Title}}", "contact": {}, - "license": { - "name": "MIT", - "url": "https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md" - }, - "version": "2.0.0" + "version": "{{.Version}}" }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", "paths": { "/api/v1/app-config": { "get": { @@ -78,80 +83,6 @@ } } }, - "/api/v1/db/columns/page": { - "get": { - "description": "数据库表列分页列表 / database table column page list", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据 / page list data", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, - "/api/v1/db/tables/page": { - "get": { - "description": "数据库表分页列表 / database table page list", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据 / page list data", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/dept": { "get": { "security": [ @@ -1241,47 +1172,6 @@ } } }, - "/api/v1/public/uploadFile": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "公共接口" - ], - "summary": "上传图片", - "parameters": [ - { - "type": "string", - "description": "type", - "name": "type", - "in": "query", - "required": true - }, - { - "type": "file", - "description": "file", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/api/v1/role": { "get": { "security": [ @@ -1501,28 +1391,6 @@ } } }, - "/api/v1/server-monitor": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "系统信息" - ], - "summary": "系统信息", - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/set-config": { "get": { "security": [ @@ -2434,165 +2302,6 @@ } } }, - "/api/v1/sys/tables/info": { - "put": { - "security": [ - { - "Bearer": [] - } - ], - "description": "修改表结构", - "consumes": [ - "application/json" - ], - "tags": [ - "工具 / 生成工具" - ], - "summary": "修改表结构", - "parameters": [ - { - "description": "body", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tools.SysTables" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - }, - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "添加表结构", - "consumes": [ - "application/json" - ], - "tags": [ - "工具 / 生成工具" - ], - "summary": "添加表结构", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tables", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sys/tables/info/{tableId}": { - "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/response.Response" - } - } - } - }, - "delete": { - "description": "删除表结构", - "tags": [ - "工具 / 生成工具" - ], - "summary": "删除表结构", - "parameters": [ - { - "type": "integer", - "description": "tableId", - "name": "tableId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sys/tables/page": { - "get": { - "description": "生成表分页列表", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/user/avatar": { "post": { "security": [ @@ -4072,277 +3781,22 @@ "type": "string" } } - }, - "tools.Params": { - "type": "object", - "properties": { - "treeCode": { - "type": "string" - }, - "treeName": { - "type": "string" - }, - "treeParentCode": { - "type": "string" - } - } - }, - "tools.SysColumns": { - "type": "object", - "properties": { - "columnComment": { - "type": "string" - }, - "columnId": { - "type": "integer" - }, - "columnName": { - "type": "string" - }, - "columnType": { - "type": "string" - }, - "createBy": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "dictType": { - "type": "string" - }, - "edit": { - "type": "boolean" - }, - "fkCol": { - "type": "array", - "items": { - "$ref": "#/definitions/tools.SysColumns" - } - }, - "fkLabelId": { - "type": "string" - }, - "fkLabelName": { - "type": "string" - }, - "fkTableName": { - "type": "string" - }, - "fkTableNameClass": { - "type": "string" - }, - "fkTableNamePackage": { - "type": "string" - }, - "goField": { - "type": "string" - }, - "goType": { - "type": "string" - }, - "htmlType": { - "type": "string" - }, - "increment": { - "type": "boolean" - }, - "insert": { - "type": "boolean" - }, - "isEdit": { - "type": "string" - }, - "isIncrement": { - "type": "string" - }, - "isInsert": { - "type": "string" - }, - "isList": { - "type": "string" - }, - "isPk": { - "type": "string" - }, - "isQuery": { - "type": "string" - }, - "isRequired": { - "type": "string" - }, - "jsonField": { - "type": "string" - }, - "list": { - "type": "string" - }, - "pk": { - "type": "boolean" - }, - "query": { - "type": "boolean" - }, - "queryType": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "sort": { - "type": "integer" - }, - "superColumn": { - "type": "boolean" - }, - "tableId": { - "type": "integer" - }, - "updateBy": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - }, - "usableColumn": { - "type": "boolean" - } - } - }, - "tools.SysTables": { - "type": "object", - "properties": { - "businessName": { - "type": "string" - }, - "className": { - "description": "类名", - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/definitions/tools.SysColumns" - } - }, - "createBy": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "crud": { - "type": "boolean" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "functionAuthor": { - "description": "功能作者", - "type": "string" - }, - "functionName": { - "description": "功能名称", - "type": "string" - }, - "isActions": { - "type": "integer" - }, - "isAuth": { - "type": "integer" - }, - "isDataScope": { - "type": "integer" - }, - "isLogicalDelete": { - "type": "string" - }, - "logicalDelete": { - "type": "boolean" - }, - "logicalDeleteColumn": { - "type": "string" - }, - "moduleFrontName": { - "description": "前端文件名", - "type": "string" - }, - "moduleName": { - "description": "go文件名", - "type": "string" - }, - "options": { - "type": "string" - }, - "packageName": { - "description": "包名", - "type": "string" - }, - "params": { - "$ref": "#/definitions/tools.Params" - }, - "pkColumn": { - "type": "string" - }, - "pkGoField": { - "type": "string" - }, - "pkJsonField": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tableComment": { - "description": "表备注", - "type": "string" - }, - "tableId": { - "description": "表编码", - "type": "integer" - }, - "tableName": { - "description": "表名称", - "type": "string" - }, - "tplCategory": { - "type": "string" - }, - "tree": { - "type": "boolean" - }, - "treeCode": { - "type": "string" - }, - "treeName": { - "type": "string" - }, - "treeParentCode": { - "type": "string" - }, - "updateBy": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - } - } - } - }, - "securityDefinitions": { - "Bearer": { - "type": "apiKey", - "name": "Authorization", - "in": "header" } } -} \ No newline at end of file +}` + +// SwaggerInfoadmin holds exported Swagger Info so clients can modify it +var SwaggerInfoadmin = &swag.Spec{ + Version: "", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "", + Description: "", + InfoInstanceName: "admin", + SwaggerTemplate: docTemplateadmin, +} + +func init() { + swag.Register(SwaggerInfoadmin.InstanceName(), SwaggerInfoadmin) +} diff --git a/docs/docs.go b/docs/admin/admin_swagger.json similarity index 86% rename from docs/docs.go rename to docs/admin/admin_swagger.json index 780b1d877..c43d90304 100644 --- a/docs/docs.go +++ b/docs/admin/admin_swagger.json @@ -1,24 +1,8 @@ -// Package docs GENERATED BY SWAG; DO NOT EDIT -// This file was generated by swaggo/swag -package docs - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, +{ "swagger": "2.0", "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": {}, - "license": { - "name": "MIT", - "url": "https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md" - }, - "version": "{{.Version}}" + "contact": {} }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", "paths": { "/api/v1/app-config": { "get": { @@ -87,80 +71,6 @@ const docTemplate = `{ } } }, - "/api/v1/db/columns/page": { - "get": { - "description": "数据库表列分页列表 / database table column page list", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据 / page list data", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, - "/api/v1/db/tables/page": { - "get": { - "description": "数据库表分页列表 / database table page list", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据 / page list data", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/dept": { "get": { "security": [ @@ -1250,47 +1160,6 @@ const docTemplate = `{ } } }, - "/api/v1/public/uploadFile": { - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "公共接口" - ], - "summary": "上传图片", - "parameters": [ - { - "type": "string", - "description": "type", - "name": "type", - "in": "query", - "required": true - }, - { - "type": "file", - "description": "file", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/api/v1/role": { "get": { "security": [ @@ -1510,28 +1379,6 @@ const docTemplate = `{ } } }, - "/api/v1/server-monitor": { - "get": { - "security": [ - { - "Bearer": [] - } - ], - "description": "获取JSON", - "tags": [ - "系统信息" - ], - "summary": "系统信息", - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/set-config": { "get": { "security": [ @@ -2443,165 +2290,6 @@ const docTemplate = `{ } } }, - "/api/v1/sys/tables/info": { - "put": { - "security": [ - { - "Bearer": [] - } - ], - "description": "修改表结构", - "consumes": [ - "application/json" - ], - "tags": [ - "工具 / 生成工具" - ], - "summary": "修改表结构", - "parameters": [ - { - "description": "body", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/tools.SysTables" - } - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - }, - "post": { - "security": [ - { - "Bearer": [] - } - ], - "description": "添加表结构", - "consumes": [ - "application/json" - ], - "tags": [ - "工具 / 生成工具" - ], - "summary": "添加表结构", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tables", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"添加失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sys/tables/info/{tableId}": { - "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/response.Response" - } - } - } - }, - "delete": { - "description": "删除表结构", - "tags": [ - "工具 / 生成工具" - ], - "summary": "删除表结构", - "parameters": [ - { - "type": "integer", - "description": "tableId", - "name": "tableId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"code\": -1, \"message\": \"删除失败\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/v1/sys/tables/page": { - "get": { - "description": "生成表分页列表", - "tags": [ - "工具 / 生成工具" - ], - "summary": "分页列表数据", - "parameters": [ - { - "type": "string", - "description": "tableName / 数据表名称", - "name": "tableName", - "in": "query" - }, - { - "type": "integer", - "description": "pageSize / 页条数", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "pageIndex / 页码", - "name": "pageIndex", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"code\": 200, \"data\": [...]}", - "schema": { - "$ref": "#/definitions/response.Response" - } - } - } - } - }, "/api/v1/user/avatar": { "post": { "security": [ @@ -4081,293 +3769,6 @@ const docTemplate = `{ "type": "string" } } - }, - "tools.Params": { - "type": "object", - "properties": { - "treeCode": { - "type": "string" - }, - "treeName": { - "type": "string" - }, - "treeParentCode": { - "type": "string" - } - } - }, - "tools.SysColumns": { - "type": "object", - "properties": { - "columnComment": { - "type": "string" - }, - "columnId": { - "type": "integer" - }, - "columnName": { - "type": "string" - }, - "columnType": { - "type": "string" - }, - "createBy": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "dictType": { - "type": "string" - }, - "edit": { - "type": "boolean" - }, - "fkCol": { - "type": "array", - "items": { - "$ref": "#/definitions/tools.SysColumns" - } - }, - "fkLabelId": { - "type": "string" - }, - "fkLabelName": { - "type": "string" - }, - "fkTableName": { - "type": "string" - }, - "fkTableNameClass": { - "type": "string" - }, - "fkTableNamePackage": { - "type": "string" - }, - "goField": { - "type": "string" - }, - "goType": { - "type": "string" - }, - "htmlType": { - "type": "string" - }, - "increment": { - "type": "boolean" - }, - "insert": { - "type": "boolean" - }, - "isEdit": { - "type": "string" - }, - "isIncrement": { - "type": "string" - }, - "isInsert": { - "type": "string" - }, - "isList": { - "type": "string" - }, - "isPk": { - "type": "string" - }, - "isQuery": { - "type": "string" - }, - "isRequired": { - "type": "string" - }, - "jsonField": { - "type": "string" - }, - "list": { - "type": "string" - }, - "pk": { - "type": "boolean" - }, - "query": { - "type": "boolean" - }, - "queryType": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "required": { - "type": "boolean" - }, - "sort": { - "type": "integer" - }, - "superColumn": { - "type": "boolean" - }, - "tableId": { - "type": "integer" - }, - "updateBy": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - }, - "usableColumn": { - "type": "boolean" - } - } - }, - "tools.SysTables": { - "type": "object", - "properties": { - "businessName": { - "type": "string" - }, - "className": { - "description": "类名", - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/definitions/tools.SysColumns" - } - }, - "createBy": { - "type": "integer" - }, - "createdAt": { - "type": "string" - }, - "crud": { - "type": "boolean" - }, - "dataScope": { - "type": "string" - }, - "deletedAt": { - "type": "string" - }, - "functionAuthor": { - "description": "功能作者", - "type": "string" - }, - "functionName": { - "description": "功能名称", - "type": "string" - }, - "isActions": { - "type": "integer" - }, - "isAuth": { - "type": "integer" - }, - "isDataScope": { - "type": "integer" - }, - "isLogicalDelete": { - "type": "string" - }, - "logicalDelete": { - "type": "boolean" - }, - "logicalDeleteColumn": { - "type": "string" - }, - "moduleFrontName": { - "description": "前端文件名", - "type": "string" - }, - "moduleName": { - "description": "go文件名", - "type": "string" - }, - "options": { - "type": "string" - }, - "packageName": { - "description": "包名", - "type": "string" - }, - "params": { - "$ref": "#/definitions/tools.Params" - }, - "pkColumn": { - "type": "string" - }, - "pkGoField": { - "type": "string" - }, - "pkJsonField": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "tableComment": { - "description": "表备注", - "type": "string" - }, - "tableId": { - "description": "表编码", - "type": "integer" - }, - "tableName": { - "description": "表名称", - "type": "string" - }, - "tplCategory": { - "type": "string" - }, - "tree": { - "type": "boolean" - }, - "treeCode": { - "type": "string" - }, - "treeName": { - "type": "string" - }, - "treeParentCode": { - "type": "string" - }, - "updateBy": { - "type": "integer" - }, - "updatedAt": { - "type": "string" - } - } - } - }, - "securityDefinitions": { - "Bearer": { - "type": "apiKey", - "name": "Authorization", - "in": "header" } } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "2.0.0", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "go-admin API", - Description: "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} +} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/admin/admin_swagger.yaml similarity index 86% rename from docs/swagger.yaml rename to docs/admin/admin_swagger.yaml index 95dee5aef..7e5318bc5 100644 --- a/docs/swagger.yaml +++ b/docs/admin/admin_swagger.yaml @@ -876,194 +876,8 @@ definitions: status: type: string type: object - tools.Params: - properties: - treeCode: - type: string - treeName: - type: string - treeParentCode: - type: string - type: object - tools.SysColumns: - properties: - columnComment: - type: string - columnId: - type: integer - columnName: - type: string - columnType: - type: string - createBy: - type: integer - createdAt: - type: string - deletedAt: - type: string - dictType: - type: string - edit: - type: boolean - fkCol: - items: - $ref: '#/definitions/tools.SysColumns' - type: array - fkLabelId: - type: string - fkLabelName: - type: string - fkTableName: - type: string - fkTableNameClass: - type: string - fkTableNamePackage: - type: string - goField: - type: string - goType: - type: string - htmlType: - type: string - increment: - type: boolean - insert: - type: boolean - isEdit: - type: string - isIncrement: - type: string - isInsert: - type: string - isList: - type: string - isPk: - type: string - isQuery: - type: string - isRequired: - type: string - jsonField: - type: string - list: - type: string - pk: - type: boolean - query: - type: boolean - queryType: - type: string - remark: - type: string - required: - type: boolean - sort: - type: integer - superColumn: - type: boolean - tableId: - type: integer - updateBy: - type: integer - updatedAt: - type: string - usableColumn: - type: boolean - type: object - tools.SysTables: - properties: - businessName: - type: string - className: - description: 类名 - type: string - columns: - items: - $ref: '#/definitions/tools.SysColumns' - type: array - createBy: - type: integer - createdAt: - type: string - crud: - type: boolean - dataScope: - type: string - deletedAt: - type: string - functionAuthor: - description: 功能作者 - type: string - functionName: - description: 功能名称 - type: string - isActions: - type: integer - isAuth: - type: integer - isDataScope: - type: integer - isLogicalDelete: - type: string - logicalDelete: - type: boolean - logicalDeleteColumn: - type: string - moduleFrontName: - description: 前端文件名 - type: string - moduleName: - description: go文件名 - type: string - options: - type: string - packageName: - description: 包名 - type: string - params: - $ref: '#/definitions/tools.Params' - pkColumn: - type: string - pkGoField: - type: string - pkJsonField: - type: string - remark: - type: string - tableComment: - description: 表备注 - type: string - tableId: - description: 表编码 - type: integer - tableName: - description: 表名称 - type: string - tplCategory: - type: string - tree: - type: boolean - treeCode: - type: string - treeName: - type: string - treeParentCode: - type: string - updateBy: - type: integer - updatedAt: - type: string - type: object info: contact: {} - description: |- - 基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档 - 添加qq群: 521386980 进入技术交流群 请先star,谢谢! - license: - name: MIT - url: https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md - title: go-admin API - version: 2.0.0 paths: /api/v1/app-config: get: @@ -1103,54 +917,6 @@ paths: summary: 获取验证码 tags: - 登陆 - /api/v1/db/columns/page: - get: - description: 数据库表列分页列表 / database table column page list - parameters: - - description: tableName / 数据表名称 - in: query - name: tableName - type: string - - description: pageSize / 页条数 - in: query - name: pageSize - type: integer - - description: pageIndex / 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - summary: 分页列表数据 / page list data - tags: - - 工具 / 生成工具 - /api/v1/db/tables/page: - get: - description: 数据库表分页列表 / database table page list - parameters: - - description: tableName / 数据表名称 - in: query - name: tableName - type: string - - description: pageSize / 页条数 - in: query - name: pageSize - type: integer - - description: pageIndex / 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - summary: 分页列表数据 / page list data - tags: - - 工具 / 生成工具 /api/v1/dept: delete: description: 删除数据 @@ -1829,32 +1595,6 @@ paths: summary: 获取岗位信息 tags: - 岗位 - /api/v1/public/uploadFile: - post: - consumes: - - multipart/form-data - description: 获取JSON - parameters: - - description: type - in: query - name: type - required: true - type: string - - description: file - in: formData - name: file - required: true - type: file - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 上传图片 - tags: - - 公共接口 /api/v1/role: delete: description: 删除数据 @@ -1990,19 +1730,6 @@ paths: summary: 修改用户角色 tags: - 角色/Role - /api/v1/server-monitor: - get: - description: 获取JSON - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - security: - - Bearer: [] - summary: 系统信息 - tags: - - 系统信息 /api/v1/set-config: get: consumes: @@ -2550,106 +2277,6 @@ paths: summary: 修改用户数据 tags: - 用户 - /api/v1/sys/tables/info: - post: - consumes: - - application/json - description: 添加表结构 - parameters: - - description: tableName / 数据表名称 - in: query - name: tables - type: string - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 添加表结构 - tags: - - 工具 / 生成工具 - put: - consumes: - - application/json - description: 修改表结构 - parameters: - - description: body - in: body - name: data - required: true - schema: - $ref: '#/definitions/tools.SysTables' - responses: - "200": - description: '{"code": -1, "message": "添加失败"}' - schema: - type: string - security: - - Bearer: [] - summary: 修改表结构 - tags: - - 工具 / 生成工具 - /api/v1/sys/tables/info/{tableId}: - delete: - description: 删除表结构 - parameters: - - description: tableId - in: path - name: tableId - required: true - type: integer - responses: - "200": - description: '{"code": -1, "message": "删除失败"}' - schema: - type: string - summary: 删除表结构 - tags: - - 工具 / 生成工具 - get: - description: 获取JSON - parameters: - - description: configKey - in: path - name: configKey - required: true - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - security: - - Bearer: [] - summary: 获取配置 - tags: - - 工具 / 生成工具 - /api/v1/sys/tables/page: - get: - description: 生成表分页列表 - parameters: - - description: tableName / 数据表名称 - in: query - name: tableName - type: string - - description: pageSize / 页条数 - in: query - name: pageSize - type: integer - - description: pageIndex / 页码 - in: query - name: pageIndex - type: integer - responses: - "200": - description: '{"code": 200, "data": [...]}' - schema: - $ref: '#/definitions/response.Response' - summary: 分页列表数据 - tags: - - 工具 / 生成工具 /api/v1/user/avatar: post: consumes: @@ -2763,9 +2390,4 @@ paths: security: - Bearer: [] summary: 退出登录 -securityDefinitions: - Bearer: - in: header - name: Authorization - type: apiKey swagger: "2.0" diff --git a/ssh/swag.sh b/ssh/swag.sh new file mode 100755 index 000000000..48139df25 --- /dev/null +++ b/ssh/swag.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +swag i -g init_router.go -dir app/admin/router --instanceName admin --parseDependency -o docs/admin From c7a4434a0eb2c11aa6ace2ea100030659127231c Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 25 Aug 2022 13:40:24 +0800 Subject: [PATCH 131/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 25624e552..a60fb5bb0 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,12 @@ npm run dev + + + + From e663de3697d2e3d71c8ef631d84bd80482bc4b0f Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 25 Aug 2022 13:44:24 +0800 Subject: [PATCH 132/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a60fb5bb0..994ff4cff 100644 --- a/README.md +++ b/README.md @@ -281,6 +281,8 @@ npm run dev " > + From c06df13a755f506fbc53975850df3361fc859615 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 25 Aug 2022 13:44:59 +0800 Subject: [PATCH 133/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20readme?= =?UTF-8?q?=20zh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 3e74791b0..86559c095 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -290,7 +290,14 @@ npm run dev - + + + + + ## JetBrains 开源证书支持 From 695ac7b29bc7ec0a62eda0cb03a79fc2ecfedc56 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 25 Aug 2022 13:55:11 +0800 Subject: [PATCH 134/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20Update=20README.?= =?UTF-8?q?Zh-cn.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 86559c095..77850089a 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -298,6 +298,8 @@ npm run dev " > + ## JetBrains 开源证书支持 From 508137da4b78ad0007b2714123d5ff436d0f9f3d Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 25 Aug 2022 13:56:14 +0800 Subject: [PATCH 135/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20=20update=20READ?= =?UTF-8?q?ME.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 994ff4cff..05170f4bf 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,8 @@ npm run dev " > + From 90db381b5afb6e0247f3cfc7b27992412dcd15e8 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 25 Aug 2022 14:18:02 +0800 Subject: [PATCH 136/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BE=A7=E8=BE=B9=E6=A0=8F=E8=8F=9C=E5=8D=95=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98=20(690)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/models/sys_menu.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/models/sys_menu.go b/app/admin/models/sys_menu.go index c8c02786e..a14a795a8 100644 --- a/app/admin/models/sys_menu.go +++ b/app/admin/models/sys_menu.go @@ -33,7 +33,7 @@ type SysMenu struct { type SysMenuSlice []SysMenu func (x SysMenuSlice) Len() int { return len(x) } -func (x SysMenuSlice) Less(i, j int) bool { return x[i].MenuId < x[j].MenuId } +func (x SysMenuSlice) Less(i, j int) bool { return x[i].Sort < x[j].Sort } func (x SysMenuSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func (SysMenu) TableName() string { @@ -47,4 +47,4 @@ func (e *SysMenu) Generate() models.ActiveRecord { func (e *SysMenu) GetId() interface{} { return e.MenuId -} \ No newline at end of file +} From c3fe13d9dd05baefeaed3357513a0d728312f0db Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 25 Aug 2022 14:24:05 +0800 Subject: [PATCH 137/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20Update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 05170f4bf..f2ddd4c83 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,8 @@ npm run dev " > + From d39faa1acabe30b6fca141549c9cc9a5570955b2 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 25 Aug 2022 14:25:07 +0800 Subject: [PATCH 138/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20readme?= =?UTF-8?q?=20zh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 77850089a..8176e57c0 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -300,6 +300,8 @@ npm run dev " > + ## JetBrains 开源证书支持 From e6f4fac859e609e0b745f05da5fb56431130cc03 Mon Sep 17 00:00:00 2001 From: quanbisen <1769128867@qq.com> Date: Wed, 31 Aug 2022 18:14:33 +0800 Subject: [PATCH 139/238] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=98=E9=9B=85?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/api/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/api/server.go b/cmd/api/server.go index 0a274fe4f..f515ffbbc 100644 --- a/cmd/api/server.go +++ b/cmd/api/server.go @@ -113,8 +113,6 @@ func run() error { } } } - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() go func() { // 服务连接 @@ -141,6 +139,9 @@ func run() error { quit := make(chan os.Signal) signal.Notify(quit, os.Interrupt) <-quit + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() fmt.Printf("%s Shutdown Server ... \r\n", pkg.GetCurrentTimeStr()) if err := srv.Shutdown(ctx); err != nil { From 0f742900f59f9391789eff98e1d332514898b654 Mon Sep 17 00:00:00 2001 From: wanghaima Date: Sun, 4 Sep 2022 10:02:26 +0800 Subject: [PATCH 140/238] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84bug.=202.=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=87=8C=E6=93=8D=E4=BD=9C=E4=BA=BA=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=EF=BC=8CuserAgent=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84bug.=203.=20=E8=BF=81=E7=A7=BB=E8=A1=A8=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=97=A5=E5=BF=97=E8=A1=A8=E6=B7=BB=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=B3=A8=E9=87=8A.=204.=20sys=5Fopera=5Flog=E8=A1=A8o?= =?UTF-8?q?per=5Fparam=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E6=94=B9?= =?UTF-8?q?=E4=B8=BAtext=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + app/admin/models/sys_opera_log.go | 6 +++--- app/admin/service/dto/sys_opera_log.go | 13 +++++++++---- cmd/migrate/migration/models/sys_opera_log.go | 6 +++--- common/middleware/logger.go | 13 +++++++++---- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index ce6fd6bd2..030a4cb9a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ */.DS_Store static/uploadfile main.exe +*.exe go-admin temp/ !temp diff --git a/app/admin/models/sys_opera_log.go b/app/admin/models/sys_opera_log.go index 31fb63500..cac6f3462 100644 --- a/app/admin/models/sys_opera_log.go +++ b/app/admin/models/sys_opera_log.go @@ -18,15 +18,15 @@ type SysOperaLog struct { BusinessType string `json:"businessType" gorm:"size:128;comment:操作类型"` BusinessTypes string `json:"businessTypes" gorm:"size:128;comment:BusinessTypes"` Method string `json:"method" gorm:"size:128;comment:函数"` - RequestMethod string `json:"requestMethod" gorm:"size:128;comment:请求方式"` + RequestMethod string `json:"requestMethod" gorm:"size:128;comment:请求方式 GET POST PUT DELETE"` OperatorType string `json:"operatorType" gorm:"size:128;comment:操作类型"` OperName string `json:"operName" gorm:"size:128;comment:操作者"` DeptName string `json:"deptName" gorm:"size:128;comment:部门名称"` OperUrl string `json:"operUrl" gorm:"size:255;comment:访问地址"` OperIp string `json:"operIp" gorm:"size:128;comment:客户端ip"` OperLocation string `json:"operLocation" gorm:"size:128;comment:访问位置"` - OperParam string `json:"operParam" gorm:"size:255;comment:请求参数"` - Status string `json:"status" gorm:"size:4;comment:操作状态"` + OperParam string `json:"operParam" gorm:"text;comment:请求参数"` + Status string `json:"status" gorm:"size:4;comment:操作状态 1:正常 2:关闭"` OperTime time.Time `json:"operTime" gorm:"comment:操作时间"` JsonResult string `json:"jsonResult" gorm:"size:255;comment:返回数据"` Remark string `json:"remark" gorm:"size:255;comment:备注"` diff --git a/app/admin/service/dto/sys_opera_log.go b/app/admin/service/dto/sys_opera_log.go index f83f6061c..5df36eb6d 100644 --- a/app/admin/service/dto/sys_opera_log.go +++ b/app/admin/service/dto/sys_opera_log.go @@ -8,16 +8,21 @@ import ( common "go-admin/common/models" ) +const ( + OperaStatusEnabel = "1" // 状态-正常 + OperaStatusDisable = "2" // 状态-关闭 +) + type SysOperaLogGetPageReq struct { dto.Pagination `search:"-"` Title string `form:"title" search:"type:contains;column:title;table:sys_opera_log" comment:"操作模块"` Method string `form:"method" search:"type:contains;column:method;table:sys_opera_log" comment:"函数"` - RequestMethod string `form:"requestMethod" search:"type:contains;column:request_method;table:sys_opera_log" comment:"请求方式"` + RequestMethod string `form:"requestMethod" search:"type:contains;column:request_method;table:sys_opera_log" comment:"请求方式: GET POST PUT DELETE"` OperUrl string `form:"operUrl" search:"type:contains;column:oper_url;table:sys_opera_log" comment:"访问地址"` OperIp string `form:"operIp" search:"type:exact;column:oper_ip;table:sys_opera_log" comment:"客户端ip"` - Status int `form:"status" search:"type:exact;column:status;table:sys_opera_log" comment:"状态"` - BeginTime string `form:"beginTime" search:"type:gte;column:ctime;table:sys_opera_log" comment:"创建时间"` - EndTime string `form:"endTime" search:"type:lte;column:ctime;table:sys_opera_log" comment:"创建时间"` + Status int `form:"status" search:"type:exact;column:status;table:sys_opera_log" comment:"状态 1:正常 2:关闭"` + BeginTime string `form:"beginTime" search:"type:gte;column:created_at;table:sys_opera_log" comment:"创建时间"` + EndTime string `form:"endTime" search:"type:lte;column:created_at;table:sys_opera_log" comment:"更新时间"` SysOperaLogOrder } diff --git a/cmd/migrate/migration/models/sys_opera_log.go b/cmd/migrate/migration/models/sys_opera_log.go index 3143dba4e..5055b96b8 100644 --- a/cmd/migrate/migration/models/sys_opera_log.go +++ b/cmd/migrate/migration/models/sys_opera_log.go @@ -10,15 +10,15 @@ type SysOperaLog struct { BusinessType string `json:"businessType" gorm:"type:varchar(128);comment:操作类型"` BusinessTypes string `json:"businessTypes" gorm:"type:varchar(128);comment:BusinessTypes"` Method string `json:"method" gorm:"type:varchar(128);comment:函数"` - RequestMethod string `json:"requestMethod" gorm:"type:varchar(128);comment:请求方式"` + RequestMethod string `json:"requestMethod" gorm:"type:varchar(128);comment:请求方式: GET POST PUT DELETE"` OperatorType string `json:"operatorType" gorm:"type:varchar(128);comment:操作类型"` OperName string `json:"operName" gorm:"type:varchar(128);comment:操作者"` DeptName string `json:"deptName" gorm:"type:varchar(128);comment:部门名称"` OperUrl string `json:"operUrl" gorm:"type:varchar(255);comment:访问地址"` OperIp string `json:"operIp" gorm:"type:varchar(128);comment:客户端ip"` OperLocation string `json:"operLocation" gorm:"type:varchar(128);comment:访问位置"` - OperParam string `json:"operParam" gorm:"type:varchar(255);comment:请求参数"` - Status string `json:"status" gorm:"type:varchar(4);comment:操作状态"` + OperParam string `json:"operParam" gorm:"type:text;comment:请求参数"` + Status string `json:"status" gorm:"type:varchar(4);comment:操作状态 1:正常 2:关闭"` OperTime time.Time `json:"operTime" gorm:"type:timestamp;comment:操作时间"` JsonResult string `json:"jsonResult" gorm:"type:varchar(255);comment:返回数据"` Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"` diff --git a/common/middleware/logger.go b/common/middleware/logger.go index e449916e2..fe2596a42 100644 --- a/common/middleware/logger.go +++ b/common/middleware/logger.go @@ -5,6 +5,7 @@ import ( "bytes" "encoding/json" "fmt" + "go-admin/app/admin/service/dto" "go-admin/common" gaConfig "go-admin/config" "io" @@ -102,6 +103,7 @@ func LoggerToFile() gin.HandlerFunc { // SetDBOperLog 写入操作日志表 fixme 该方法后续即将弃用 func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string, reqMethod string, latencyTime time.Duration, body string, result string, status int) { + log := api.GetRequestLogger(c) l := make(map[string]interface{}) l["_fullPath"] = c.FullPath() @@ -110,16 +112,19 @@ func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string fmt.Println("gaConfig.ExtConfig.AMap.Key", gaConfig.ExtConfig.AMap.Key) l["operLocation"] = pkg.GetLocation(clientIP, gaConfig.ExtConfig.AMap.Key) l["operName"] = user.GetUserName(c) - l["requestMethod"] = c.Request.Method + l["requestMethod"] = reqMethod l["operParam"] = body l["operTime"] = time.Now() l["jsonResult"] = result l["latencyTime"] = latencyTime.String() l["statusCode"] = statusCode + l["userAgent"] = c.Request.UserAgent() + l["createBy"] = user.GetUserId(c) + l["updateBy"] = user.GetUserId(c) if status == http.StatusOK { - l["status"] = "2" + l["status"] = dto.OperaStatusEnabel } else { - l["status"] = "1" + l["status"] = dto.OperaStatusDisable } q := sdk.Runtime.GetMemoryQueue(c.Request.Host) message, err := sdk.Runtime.GetStreamMessage("", global.OperateLog, l) @@ -132,4 +137,4 @@ func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string log.Errorf("Append message error, %s", err.Error()) } } -} \ No newline at end of file +} From 4df859a0ea3479e560707f5aa3875cb471ad900b Mon Sep 17 00:00:00 2001 From: zhaoyidong Date: Tue, 6 Sep 2022 14:10:27 +0800 Subject: [PATCH 141/238] =?UTF-8?q?fix=F0=9F=90=9B:=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=BF=85=E9=A1=BB=E7=94=A8string=E6=8E=A5?= =?UTF-8?q?=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化了代码生成的格式,最后的空行无法删除,删除之后}前面会增加空格 --- template/v4/dto.go.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/template/v4/dto.go.template b/template/v4/dto.go.template index 4f84c9f37..507f0c15c 100644 --- a/template/v4/dto.go.template +++ b/template/v4/dto.go.template @@ -34,9 +34,9 @@ type {{.ClassName}}GetPageReq struct { } type {{.ClassName}}Order struct { - {{- $tablename := .TBName -}} + {{ $tablename := .TBName }} {{- range .Columns -}} - {{.GoField}} {{.GoType}} `form:"{{.JsonField}}Order" search:"type:order;column:{{.ColumnName}};table:{{$tablename}}"` + {{.GoField}} string `form:"{{.JsonField}}Order" search:"type:order;column:{{.ColumnName}};table:{{$tablename}}"` {{ end }} } @@ -144,4 +144,4 @@ type {{.ClassName}}DeleteReq struct { func (s *{{.ClassName}}DeleteReq) GetId() interface{} { return s.Ids -} \ No newline at end of file +} From 3685510d254c85d157f7d07c659db8516e56400a Mon Sep 17 00:00:00 2001 From: zhaoyidong Date: Wed, 7 Sep 2022 20:08:17 +0800 Subject: [PATCH 142/238] =?UTF-8?q?fix=F0=9F=90=9B:=E6=A8=A1=E6=9D=BFUpdat?= =?UTF-8?q?e=E6=96=B9=E6=B3=95=EF=BC=8Cerr=E6=B2=A1=E6=9C=89=E8=A2=AB?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=EF=BC=8C=E8=BF=94=E5=9B=9E=E7=9A=84err?= =?UTF-8?q?=E6=B0=B8=E8=BF=9C=E6=98=AFnil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/no_actions/service.go.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/template/v4/no_actions/service.go.template b/template/v4/no_actions/service.go.template index 8ab3ef6f5..84e8886f7 100644 --- a/template/v4/no_actions/service.go.template +++ b/template/v4/no_actions/service.go.template @@ -80,7 +80,7 @@ func (e *{{.ClassName}}) Update(c *dto.{{.ClassName}}UpdateReq, p *actions.DataP c.Generate(&data) db := e.Orm.Save(&data) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("{{.ClassName}}Service Save error:%s \r\n", err) return err } @@ -106,4 +106,4 @@ func (e *{{.ClassName}}) Remove(d *dto.{{.ClassName}}DeleteReq, p *actions.DataP return errors.New("无权删除该数据") } return nil -} \ No newline at end of file +} From b55cbe1992018bb2dea09c7cf87e87fdb1f56f20 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 14 Sep 2022 12:23:06 +0800 Subject: [PATCH 143/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20Update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f2ddd4c83..ef06f40b2 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,8 @@ npm run dev " > + From 453dd65cb1c97211ba9c1d4ad85a2245aaff20bb Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 14 Sep 2022 12:24:02 +0800 Subject: [PATCH 144/238] =?UTF-8?q?docs=F0=9F=93=9D:=20update=20readme=20z?= =?UTF-8?q?h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 8176e57c0..7e923c847 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -302,6 +302,8 @@ npm run dev " > + ## JetBrains 开源证书支持 From c004b3d3334e1398759c3fcf41f164031eb6d4d2 Mon Sep 17 00:00:00 2001 From: zhaodongdong Date: Wed, 14 Sep 2022 17:42:09 +0800 Subject: [PATCH 145/238] =?UTF-8?q?fix=F0=9F=90=9B:e.Log.Errorf("db=20erro?= =?UTF-8?q?r:%s",=20err)=E8=BE=93=E5=87=BA=E7=9A=84err=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=A2=AB=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_config.go | 2 +- app/admin/service/sys_dept.go | 6 +++--- app/admin/service/sys_dict_data.go | 4 ++-- app/admin/service/sys_dict_type.go | 6 +++--- app/admin/service/sys_login_log.go | 4 ++-- app/admin/service/sys_menu.go | 4 ++-- app/admin/service/sys_post.go | 6 +++--- app/admin/service/sys_role.go | 8 ++++---- common/actions/delete.go | 2 +- common/actions/update.go | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/admin/service/sys_config.go b/app/admin/service/sys_config.go index a7a99f627..c21fe448a 100644 --- a/app/admin/service/sys_config.go +++ b/app/admin/service/sys_config.go @@ -142,7 +142,7 @@ func (e *SysConfig) Remove(d *dto.SysConfigDeleteReq) error { var data models.SysConfig db := e.Orm.Delete(&data, d.Ids) - if db.Error != nil { + if err = db.Error; err != nil { err = db.Error e.Log.Errorf("Service RemoveSysConfig error:%s", err) return err diff --git a/app/admin/service/sys_dept.go b/app/admin/service/sys_dept.go index 80fe0a77b..e6dba54c0 100644 --- a/app/admin/service/sys_dept.go +++ b/app/admin/service/sys_dept.go @@ -49,7 +49,7 @@ func (e *SysDept) Get(d *dto.SysDeptGetReq, model *models.SysDept) error { e.Log.Errorf("db error:%s", err) return err } - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -116,7 +116,7 @@ func (e *SysDept) Update(c *dto.SysDeptUpdateReq) error { } model.DeptPath = deptPath db := tx.Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("UpdateSysDept error:%s", err) return err } @@ -132,7 +132,7 @@ func (e *SysDept) Remove(d *dto.SysDeptDeleteReq) error { var data models.SysDept db := e.Orm.Model(&data).Delete(&data, d.GetId()) - if db.Error != nil { + if err = db.Error; err != nil { err = db.Error e.Log.Errorf("Delete error: %s", err) return err diff --git a/app/admin/service/sys_dict_data.go b/app/admin/service/sys_dict_data.go index 28eedbadd..553ad4c8f 100644 --- a/app/admin/service/sys_dict_data.go +++ b/app/admin/service/sys_dict_data.go @@ -47,7 +47,7 @@ func (e *SysDictData) Get(d *dto.SysDictDataGetReq, model *models.SysDictData) e e.Log.Errorf("db error: %s", err) return err } - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error: %s", err) return err } @@ -91,7 +91,7 @@ func (e *SysDictData) Remove(c *dto.SysDictDataDeleteReq) error { var data models.SysDictData db := e.Orm.Delete(&data, c.GetId()) - if db.Error != nil { + if err = db.Error; err != nil { err = db.Error e.Log.Errorf("Delete error: %s", err) return err diff --git a/app/admin/service/sys_dict_type.go b/app/admin/service/sys_dict_type.go index 888bccb7a..5d6ff2b8c 100644 --- a/app/admin/service/sys_dict_type.go +++ b/app/admin/service/sys_dict_type.go @@ -45,7 +45,7 @@ func (e *SysDictType) Get(d *dto.SysDictTypeGetReq, model *models.SysDictType) e e.Log.Errorf("db error: %s", err) return err } - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error: %s", err) return err } @@ -77,7 +77,7 @@ func (e *SysDictType) Update(c *dto.SysDictTypeUpdateReq) error { e.Orm.First(&model, c.GetId()) c.Generate(&model) db := e.Orm.Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error: %s", err) return err } @@ -94,7 +94,7 @@ func (e *SysDictType) Remove(d *dto.SysDictTypeDeleteReq) error { var data models.SysDictType db := e.Orm.Delete(&data, d.GetId()) - if db.Error != nil { + if err = db.Error; err != nil { err = db.Error e.Log.Errorf("Delete error: %s", err) return err diff --git a/app/admin/service/sys_login_log.go b/app/admin/service/sys_login_log.go index 04db57d79..985feb3e5 100644 --- a/app/admin/service/sys_login_log.go +++ b/app/admin/service/sys_login_log.go @@ -44,7 +44,7 @@ func (e *SysLoginLog) Get(d *dto.SysLoginLogGetReq, model *models.SysLoginLog) e e.Log.Errorf("db error:%s", err) return err } - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -57,7 +57,7 @@ func (e *SysLoginLog) Remove(c *dto.SysLoginLogDeleteReq) error { var data models.SysLoginLog db := e.Orm.Delete(&data, c.GetId()) - if db.Error != nil { + if err = db.Error; err != nil { err = db.Error e.Log.Errorf("Delete error: %s", err) return err diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index 6779c740a..013690856 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -147,7 +147,7 @@ func (e *SysMenu) Update(c *dto.SysMenuUpdateReq) *SysMenu { c.Generate(&model) model.SysApi = alist db := tx.Model(&model).Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) _ = e.AddError(err) return e @@ -171,7 +171,7 @@ func (e *SysMenu) Remove(d *dto.SysMenuDeleteReq) *SysMenu { var data models.SysMenu db := e.Orm.Model(&data).Delete(&data, d.Ids) - if db.Error != nil { + if err = db.Error; err != nil { err = db.Error e.Log.Errorf("Delete error: %s", err) _ = e.AddError(err) diff --git a/app/admin/service/sys_post.go b/app/admin/service/sys_post.go index 99f1213bc..51956f4eb 100644 --- a/app/admin/service/sys_post.go +++ b/app/admin/service/sys_post.go @@ -47,7 +47,7 @@ func (e *SysPost) Get(d *dto.SysPostGetReq, model *models.SysPost) error { e.Log.Errorf("db error:%s", err) return err } - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -75,7 +75,7 @@ func (e *SysPost) Update(c *dto.SysPostUpdateReq) error { c.Generate(&model) db := e.Orm.Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -92,7 +92,7 @@ func (e *SysPost) Remove(d *dto.SysPostDeleteReq) error { var data models.SysPost db := e.Orm.Model(&data).Delete(&data, d.GetId()) - if db.Error != nil { + if err = db.Error; err != nil { err = db.Error e.Log.Errorf("Delete error: %s", err) return err diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index 8eeade1b5..e8bd2d183 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -153,7 +153,7 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err model.SysMenu = &mlist db := tx.Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -205,7 +205,7 @@ func (e *SysRole) Remove(c *dto.SysRoleDeleteReq, cb *casbin.SyncedEnforcer) err tx.Preload("SysMenu").Preload("SysDept").First(&model, c.GetId()) db := tx.Select(clause.Associations).Delete(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } @@ -259,7 +259,7 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { c.Generate(&model) model.SysDept = dlist db := tx.Model(&model).Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) _ = e.AddError(err) return e @@ -289,7 +289,7 @@ func (e *SysRole) UpdateStatus(c *dto.UpdateStatusReq) error { tx.First(&model, c.GetId()) c.Generate(&model) db := tx.Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) - if db.Error != nil { + if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) return err } diff --git a/common/actions/delete.go b/common/actions/delete.go index f98e1fb04..811b9bf90 100644 --- a/common/actions/delete.go +++ b/common/actions/delete.go @@ -46,7 +46,7 @@ func DeleteAction(control dto.Control) gin.HandlerFunc { db = db.WithContext(c).Scopes( Permission(object.TableName(), p), ).Where(req.GetId()).Delete(object) - if db.Error != nil { + if err = db.Error; err != nil { log.Errorf("MsgID[%s] Delete error: %s", msgID, err) response.Error(c, 500, err, "删除失败") return diff --git a/common/actions/update.go b/common/actions/update.go index 3dd63b1e3..705233451 100644 --- a/common/actions/update.go +++ b/common/actions/update.go @@ -44,7 +44,7 @@ func UpdateAction(control dto.Control) gin.HandlerFunc { db = db.WithContext(c).Scopes( Permission(object.TableName(), p), ).Where(req.GetId()).Updates(object) - if db.Error != nil { + if err = db.Error; err != nil { log.Errorf("MsgID[%s] Update error: %s", msgID, err) response.Error(c, 500, err, "更新失败") return From 5043ce541162e153c1d98fb04956ef64b1372b6e Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 26 Oct 2022 23:37:16 +0800 Subject: [PATCH 146/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20antd=20?= =?UTF-8?q?view=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef06f40b2..b2c678693 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The front-end and back-end separation authority management system based on Gin + vue demo:[https://www.go-admin.dev](https://www.go-admin.dev/#/login) > 账号 / 密码: admin / 123456 -antd demo:[https://preview.go-admin.dev](https://preview.go-admin.dev/) +antd demo:[https://antd.go-admin.pro](https://antd.go-admin.pro/) > 账号 / 密码: admin / 123456 > ## ✨ Feature From e0519a4d7e8dd42737d4fd5365184fc9d75a9afc Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 26 Oct 2022 23:38:18 +0800 Subject: [PATCH 147/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20antd=20?= =?UTF-8?q?view=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 7e923c847..378cd69bf 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -11,7 +11,7 @@ 基于Gin + Vue + Element UI的前后端分离权限管理系统,系统初始化极度简单,只需要配置文件中,修改数据库连接,系统支持多指令操作,迁移指令可以让初始化数据库信息变得更简单,服务指令可以很简单的启动api服务 -[在线文档](https://doc.go-admin.dev) +[在线文档](https://www.go-admin.pro) [前端项目](https://github.com/go-admin-team/go-admin-ui) @@ -22,7 +22,7 @@ vue体验:[https://www.go-admin.dev](https://www.go-admin.dev/#/login) > ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 -antd体验:[https://preview.go-admin.dev](https://preview.go-admin.dev/) +antd体验:[https://antd.go-admin.pro](https://antd.go-admin.pro/) > ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 ## ✨ 特性 From 0ef422d3095b92699db8af6b3863a24f62238fb1 Mon Sep 17 00:00:00 2001 From: xiaobo Date: Thu, 27 Oct 2022 16:12:50 +0800 Subject: [PATCH 148/238] fix: update README Update README file: update dependencies before build. --- README.Zh-cn.md | 3 +++ README.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 378cd69bf..d96899bf2 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -142,6 +142,9 @@ git clone https://github.com/go-admin-team/go-admin-ui.git # 进入 go-admin 后端项目 cd ./go-admin +# 更新整理依赖 +go mod tidy + # 编译项目 go build diff --git a/README.md b/README.md index b2c678693..18850bb38 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,9 @@ git clone https://github.com/go-admin-team/go-admin-ui.git # Enter the go-admin backend project cd ./go-admin +# Update dependencies +go mod tidy + # Compile the project go build From a359c25e36c792282fa3c517ef4c46fa6f5af38b Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 1 Nov 2022 14:13:53 +0800 Subject: [PATCH 149/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0CI=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 86 +++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..69b1fcc09 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,86 @@ +name: Build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + IMAGE_NAME: registry.ap-northeast-1.aliyuncs.com/go-admin/go-admin-api # 镜像名称 + TAG: ${{ github.sha }} + IMAGE_NAME_TAG: registry.ap-northeast-1.aliyuncs.com/go-admin/go-admin-api:${{ github.sha }} + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.18 + + # - name: Show GitHub context + # env: + # GITHUB_CONTEXT: ${{ toJson(github) }} + # run: echo "$GITHUB_CONTEXT" + # + # - name: Show GITHUB_SHA + # run: echo "${GITHUB_SHA}" + + - name: Tidy + run: go mod tidy + + - name: Build + run: env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags "sqlite3,json1" --ldflags "-extldflags -static" -o main . + + - name: Build the Docker image and push + run: | + docker login --username=${{ secrets.DOCKER_USERNAME }} registry.ap-northeast-1.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }} + echo "************ docker login end" + docker build -t go-admin-api:latest . + echo "************ docker build end" + docker tag go-admin-api ${{ env.IMAGE_NAME_TAG }} + echo "************ docker tag end" + docker images + echo "************ docker images end" + docker push ${{ env.IMAGE_NAME_TAG }} # 推送 + echo "************ docker push end" + + - name: Restart server # 第五步,重启服务 + uses: appleboy/ssh-action@master + env: + GITHUB_SHA_X: ${GITHUB_SHA} + with: + host: ${{ secrets.SSH_HOST }} # 下面三个配置与上一步类似 + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.DEPLOY_KEY }} + # 重启的脚本,根据自身情况做相应改动,一般要做的是migrate数据库以及重启服务器 + script: | + sudo docker rm -f go-admin-api + sudo docker login --username=${{ secrets.DOCKER_USERNAME }} registry.ap-northeast-1.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }} + sudo docker run -d -p 8000:8000 --name go-admin-api ${{ env.IMAGE_NAME_TAG }} + + +# - name: Generate Changelog +# id: changelog +# uses: jaywcjlove/changelog-generator@v1.5.0 +# with: +# head-ref: ${{steps.create_tag.outputs.version}} +# filter-author: (renovate-bot|Renovate Bot) +# filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' +# +# - name: Create Release +# uses: ncipollo/release-action@v1 +# if: steps.create_tag.outputs.successful +# with: +# token: ${{ secrets.ACCESS_TOKEN }} +# name: ${{ steps.create_tag.outputs.version }} +# tag: ${{ steps.create_tag.outputs.version }} +# body: | +# Comparing Changes: ${{ steps.changelog.outputs.compareurl }} +# +# ${{ steps.changelog.outputs.changelog }} From f795a356e7415ef33b6ead7e7ab90b2238d505f9 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 1 Nov 2022 14:14:27 +0800 Subject: [PATCH 150/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0CI=E8=84=9A=E6=9C=AC=E4=B8=AD=E7=9A=84=E5=88=86?= =?UTF-8?q?=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69b1fcc09..89bf956f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,9 @@ name: Build on: push: - branches: [ main ] + branches: [ master ] pull_request: - branches: [ main ] + branches: [ master ] env: IMAGE_NAME: registry.ap-northeast-1.aliyuncs.com/go-admin/go-admin-api # 镜像名称 From d56142463ae9a05ac2284aed104de07f9f33d182 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 1 Nov 2022 14:58:18 +0800 Subject: [PATCH 151/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=BC=94=E7=A4=BA=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 37 +++++++++++++------------------------ config/settings.demo.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 24 deletions(-) create mode 100644 config/settings.demo.yml diff --git a/Dockerfile b/Dockerfile index c7e29261d..bfb4a5fda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,18 @@ -FROM golang:alpine as builder +FROM alpine -MAINTAINER haimait +# ENV GOPROXY https://goproxy.cn/ -WORKDIR /work - -RUN go env -w GOPROXY=https://goproxy.cn,direct && go env -w CGO_ENABLED=0 -COPY go.mod go.sum ./ -RUN go mod download - -COPY . . -RUN go build -o go-admin main.go - - -FROM alpine:latest -# change timezone -RUN apk add --no-cache tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone - -WORKDIR /go-admin-api - -COPY --from=builder /work/go-admin ./ -COPY --from=builder /work/config ./config -COPY --from=builder /work/static ./static -COPY --from=builder /work/temp ./temp +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories +RUN apk update --no-cache +RUN apk add --update gcc g++ libc6-compat +RUN apk add --no-cache ca-certificates +RUN apk add --no-cache tzdata +ENV TZ Asia/Shanghai +COPY ./main /main +COPY ./config/settings.demo.yml /config/settings.yml +COPY ./go-admin-pro.db /go-admin-pro.db EXPOSE 8000 - -CMD ["./go-admin","server","-c", "config/settings.dev.yml"] +RUN chmod +x /main +CMD ["/main","server","-c", "/config/settings.yml"] \ No newline at end of file diff --git a/config/settings.demo.yml b/config/settings.demo.yml new file mode 100644 index 000000000..9b297e693 --- /dev/null +++ b/config/settings.demo.yml @@ -0,0 +1,34 @@ +settings: + application: + demomsg: "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600" + enabledp: true + host: 0.0.0.0 + mode: demo + name: testApp + port: 8000 + readtimeout: 10000 + writertimeout: 20000 + database: + driver: sqlite3 + source: ./go-admin-db.db + gen: + dbname: testhhh + frontpath: ../go-admin-ui/src + jwt: + secret: go-admin + timeout: 3600 + logger: + # 日志存放路径 + path: temp/logs + # 日志输出,file:文件,default:命令行,其他:命令行 + stdout: '' #控制台日志,启用后,不输出到文件 + # 日志等级, trace, debug, info, warn, error, fatal + level: trace + # 数据库日志开关 + enableddb: true + queue: + memory: + poolSize: 100 + extend: + amap: + key: de7a062c984bf828d5d1b3a631a517e4 \ No newline at end of file From ed8bac8a1b295bfc1c210ac8a9bc5e33b356261c Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 1 Nov 2022 15:00:41 +0800 Subject: [PATCH 152/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0ci=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89bf956f6..8e2fd89d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,14 +23,6 @@ jobs: with: go-version: 1.18 - # - name: Show GitHub context - # env: - # GITHUB_CONTEXT: ${{ toJson(github) }} - # run: echo "$GITHUB_CONTEXT" - # - # - name: Show GITHUB_SHA - # run: echo "${GITHUB_SHA}" - - name: Tidy run: go mod tidy @@ -63,24 +55,3 @@ jobs: sudo docker rm -f go-admin-api sudo docker login --username=${{ secrets.DOCKER_USERNAME }} registry.ap-northeast-1.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }} sudo docker run -d -p 8000:8000 --name go-admin-api ${{ env.IMAGE_NAME_TAG }} - - -# - name: Generate Changelog -# id: changelog -# uses: jaywcjlove/changelog-generator@v1.5.0 -# with: -# head-ref: ${{steps.create_tag.outputs.version}} -# filter-author: (renovate-bot|Renovate Bot) -# filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' -# -# - name: Create Release -# uses: ncipollo/release-action@v1 -# if: steps.create_tag.outputs.successful -# with: -# token: ${{ secrets.ACCESS_TOKEN }} -# name: ${{ steps.create_tag.outputs.version }} -# tag: ${{ steps.create_tag.outputs.version }} -# body: | -# Comparing Changes: ${{ steps.changelog.outputs.compareurl }} -# -# ${{ steps.changelog.outputs.changelog }} From b62fbc803c20d5c6340b47993068654c00dc18f3 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 1 Nov 2022 15:02:36 +0800 Subject: [PATCH 153/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=BC=94=E7=A4=BA=E7=8E=AF=E5=A2=83=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bfb4a5fda..fb3e023dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ ENV TZ Asia/Shanghai COPY ./main /main COPY ./config/settings.demo.yml /config/settings.yml -COPY ./go-admin-pro.db /go-admin-pro.db +COPY ./go-admin-db.db /go-admin-db.db EXPOSE 8000 RUN chmod +x /main CMD ["/main","server","-c", "/config/settings.yml"] \ No newline at end of file From b532ad994cbf9b6b70eeeb801e924992c11a5e30 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 1 Nov 2022 16:53:42 +0800 Subject: [PATCH 154/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2c678693..604f4e011 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ The front-end and back-end separation authority management system based on Gin + ## 🎬 Online Demo -vue demo:[https://www.go-admin.dev](https://www.go-admin.dev/#/login) +Element UI vue demo:[https://vue2.go-admin.dev](https://vue2.go-admin.dev/#/login) > 账号 / 密码: admin / 123456 antd demo:[https://antd.go-admin.pro](https://antd.go-admin.pro/) From d9122d29cb6393e65520c1c1544a3b13c241b95d Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 1 Nov 2022 16:54:19 +0800 Subject: [PATCH 155/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 378cd69bf..a4a8742cd 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -19,7 +19,7 @@ ## 🎬 在线体验 -vue体验:[https://www.go-admin.dev](https://www.go-admin.dev/#/login) +Element UI vue体验:[https://vue2.go-admin.dev](https://vue2.go-admin.dev/#/login) > ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 antd体验:[https://antd.go-admin.pro](https://antd.go-admin.pro/) From bc42412e928215975f9f1c333e3870a9fe24338e Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Tue, 1 Nov 2022 16:57:28 +0800 Subject: [PATCH 156/238] =?UTF-8?q?perf=F0=9F=91=8C:=20=20=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0logo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go-admin-db.db | Bin 348160 -> 348160 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/go-admin-db.db b/go-admin-db.db index abb003c43de07c7dd575050f0041485aab103338..fe73e037485b8b47f69bed124e4162c331c895cb 100644 GIT binary patch delta 110 zcmZozAlk4%bb>Ua%0wAwRuu-lc&Uvki~4!)G4KoWweX(hP2#z?Sx{gUa@-wUGjkKuQ}v4y%k^^;i%U|Anic1^E6!yE PVkRJF-mW;8<^CoB0jMT~ From 5c834939afbefe486b7b792021786dfaf73571ab Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 1 Nov 2022 19:13:37 +0800 Subject: [PATCH 157/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 604f4e011..98a4d4868 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ English | [简体中文](https://github.com/go-admin-team/go-admin/blob/master/README.Zh-cn.md) -The front-end and back-end separation authority management system based on Gin + Vue + Element UI is extremely simple to initialize the system. You only need to modify the database connection in the configuration file. The system supports multi-instruction operations. Migration instructions can make it easier to initialize database information. Service instructions It's easy to start the api service. +The front-end and back-end separation authority management system based on Gin + Vue + Element UI OR Arco Design is extremely simple to initialize the system. You only need to modify the database connection in the configuration file. The system supports multi-instruction operations. Migration instructions can make it easier to initialize database information. Service instructions It's easy to start the api service. [documentation](https://doc.go-admin.dev) @@ -23,6 +23,9 @@ The front-end and back-end separation authority management system based on Gin + Element UI vue demo:[https://vue2.go-admin.dev](https://vue2.go-admin.dev/#/login) > 账号 / 密码: admin / 123456 +Arco Design vue3 demo:[https://vue3.go-admin.dev](https://vue3.go-admin.dev/#/login) +> 账号 / 密码: admin / 123456 + antd demo:[https://antd.go-admin.pro](https://antd.go-admin.pro/) > 账号 / 密码: admin / 123456 > @@ -303,6 +306,8 @@ The `go-admin` project has always been developed in the GoLand integrated develo 1. [ant-design](https://github.com/ant-design/ant-design) 2. [ant-design-pro](https://github.com/ant-design/ant-design-pro) +2. [arco-design](https://github.com/arco-design/arco-design) +2. [arco-design-pro](https://github.com/arco-design/arco-design-pro) 2. [gin](https://github.com/gin-gonic/gin) 2. [casbin](https://github.com/casbin/casbin) 2. [spf13/viper](https://github.com/spf13/viper) From eac1bf197e73419848ecfaab19771a3dbe7db1d9 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 1 Nov 2022 19:16:01 +0800 Subject: [PATCH 158/238] =?UTF-8?q?docs=F0=9F=93=9D:=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index a4a8742cd..a697e900c 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -9,7 +9,7 @@ [English](https://github.com/go-admin-team/go-admin/blob/master/README.md) | 简体中文 -基于Gin + Vue + Element UI的前后端分离权限管理系统,系统初始化极度简单,只需要配置文件中,修改数据库连接,系统支持多指令操作,迁移指令可以让初始化数据库信息变得更简单,服务指令可以很简单的启动api服务 +基于Gin + Vue + Element UI OR Arco Design OR Ant Design的前后端分离权限管理系统,系统初始化极度简单,只需要配置文件中,修改数据库连接,系统支持多指令操作,迁移指令可以让初始化数据库信息变得更简单,服务指令可以很简单的启动api服务 [在线文档](https://www.go-admin.pro) @@ -22,6 +22,9 @@ Element UI vue体验:[https://vue2.go-admin.dev](https://vue2.go-admin.dev/#/login) > ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 +Arco Design vue3 demo:[https://vue3.go-admin.dev](https://vue3.go-admin.dev/#/login) +> ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 + antd体验:[https://antd.go-admin.pro](https://antd.go-admin.pro/) > ⚠️⚠️⚠️ 账号 / 密码: admin / 123456 @@ -315,15 +318,17 @@ npm run dev 1. [ant-design](https://github.com/ant-design/ant-design) 2. [ant-design-pro](https://github.com/ant-design/ant-design-pro) -2. [gin](https://github.com/gin-gonic/gin) -2. [casbin](https://github.com/casbin/casbin) -2. [spf13/viper](https://github.com/spf13/viper) -2. [gorm](https://github.com/jinzhu/gorm) -2. [gin-swagger](https://github.com/swaggo/gin-swagger) -2. [jwt-go](https://github.com/dgrijalva/jwt-go) -2. [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) -2. [ruoyi-vue](https://gitee.com/y_project/RuoYi-Vue) -2. [form-generator](https://github.com/JakHuang/form-generator) +2. [arco-design](https://github.com/arco-design/arco-design) +2. [arco-design-pro](https://github.com/arco-design/arco-design-pro) +4. [gin](https://github.com/gin-gonic/gin) +5. [casbin](https://github.com/casbin/casbin) +6. [spf13/viper](https://github.com/spf13/viper) +7. [gorm](https://github.com/jinzhu/gorm) +8. [gin-swagger](https://github.com/swaggo/gin-swagger) +9. [jwt-go](https://github.com/dgrijalva/jwt-go) +10. [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) +11. [ruoyi-vue](https://gitee.com/y_project/RuoYi-Vue) +12. [form-generator](https://github.com/JakHuang/form-generator) ## 🤟 打赏 From 5df43b4d11a29674999cec826d1fcd2c3edd5aeb Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 2 Nov 2022 10:18:32 +0800 Subject: [PATCH 159/238] =?UTF-8?q?=20docs=F0=9F=93=9D:=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98a4d4868..27ec1c38e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ English | [简体中文](https://github.com/go-admin-team/go-admin/blob/master/R The front-end and back-end separation authority management system based on Gin + Vue + Element UI OR Arco Design is extremely simple to initialize the system. You only need to modify the database connection in the configuration file. The system supports multi-instruction operations. Migration instructions can make it easier to initialize database information. Service instructions It's easy to start the api service. -[documentation](https://doc.go-admin.dev) +[documentation](https://www.go-admin.dev) [Front-end project](https://github.com/go-admin-team/go-admin-ui) From 42f302521748ba4c498e2d8f948f6641ee18b32e Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Thu, 3 Nov 2022 14:00:48 +0800 Subject: [PATCH 160/238] =?UTF-8?q?fix=F0=9F=90=9B:=20Fix=20the=20problem?= =?UTF-8?q?=20that=20api=20saving=20fails=20when=20creating=20a=20new=20me?= =?UTF-8?q?nu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_menu.go | 30 ++++++++++++++++++++----- go.mod | 41 ++++++++++++++--------------------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/app/admin/service/sys_menu.go b/app/admin/service/sys_menu.go index 013690856..3d6aab7fa 100644 --- a/app/admin/service/sys_menu.go +++ b/app/admin/service/sys_menu.go @@ -90,26 +90,46 @@ func (e *SysMenu) Insert(c *dto.SysMenuInsertReq) *SysMenu { var err error var data models.SysMenu c.Generate(&data) - err = e.Orm.Create(&data).Error + tx := e.Orm.Debug().Begin() + defer func() { + if err != nil { + tx.Rollback() + } else { + tx.Commit() + } + }() + err = tx.Where("id in ?", c.Apis).Find(&data.SysApi).Error if err != nil { + tx.Rollback() + e.Log.Errorf("db error:%s", err) + _ = e.AddError(err) + } + err = tx.Create(&data).Error + if err != nil { + tx.Rollback() e.Log.Errorf("db error:%s", err) _ = e.AddError(err) } c.MenuId = data.MenuId - err = e.initPaths(&data) + err = e.initPaths(tx, &data) if err != nil { + tx.Rollback() e.Log.Errorf("db error:%s", err) _ = e.AddError(err) } + tx.Commit() return e } -func (e *SysMenu) initPaths(menu *models.SysMenu) error { +func (e *SysMenu) initPaths(tx *gorm.DB, menu *models.SysMenu) error { var err error var data models.SysMenu parentMenu := new(models.SysMenu) if menu.ParentId != 0 { - e.Orm.Model(&data).First(parentMenu, menu.ParentId) + err = tx.Model(&data).First(parentMenu, menu.ParentId).Error + if err != nil { + return err + } if parentMenu.Paths == "" { err = errors.New("父级paths异常,请尝试对当前节点父级菜单进行更新操作!") return err @@ -118,7 +138,7 @@ func (e *SysMenu) initPaths(menu *models.SysMenu) error { } else { menu.Paths = "/0/" + pkg.IntToString(menu.MenuId) } - e.Orm.Model(&data).Where("menu_id = ?", menu.MenuId).Update("paths", menu.Paths) + err = tx.Model(&data).Where("menu_id = ?", menu.MenuId).Update("paths", menu.Paths).Error return err } diff --git a/go.mod b/go.mod index 02502f511..0eac81f42 100644 --- a/go.mod +++ b/go.mod @@ -3,43 +3,24 @@ module go-admin go 1.18 require ( - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/alibaba/sentinel-golang v1.0.4 github.com/alibaba/sentinel-golang/pkg/adapters/gin v0.0.0-20220808015021-c5f1f1d055c5 github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5 github.com/bitly/go-simplejson v0.5.0 - github.com/bsm/redislock v0.5.0 github.com/bytedance/go-tagexpr/v2 v2.7.12 github.com/casbin/casbin/v2 v2.51.2 - github.com/casbin/redis-watcher/v2 v2.0.0-20220614104201-0e70bf2be930 - github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd github.com/gin-gonic/gin v1.7.7 github.com/go-admin-team/go-admin-core v1.4.1-0.20220809101213-21187928f7d9 - github.com/go-admin-team/go-admin-core/plugins/logger/zap v0.0.0-20210610020726-2db73adb505d github.com/go-admin-team/go-admin-core/sdk v1.4.1-0.20220809101213-21187928f7d9 - github.com/go-admin-team/gorm-adapter/v3 v3.7.8-0.20220809100335-eaf9f67b3d21 - github.com/go-playground/locales v0.14.0 - github.com/go-playground/universal-translator v0.18.0 - github.com/go-playground/validator/v10 v10.8.0 - github.com/go-redis/redis/v7 v7.4.0 - github.com/go-redis/redis/v8 v8.11.5 - github.com/golang-jwt/jwt/v4 v4.4.2 github.com/google/uuid v1.3.0 - github.com/gorilla/websocket v1.4.2 github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible - github.com/mojocn/base64Captcha v1.3.1 github.com/mssola/user_agent v0.5.2 - github.com/nsqio/go-nsq v1.0.8 github.com/opentracing/opentracing-go v1.1.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 - github.com/robinjoseph08/redisqueue/v2 v2.1.0 - github.com/shamsher31/goimgext v1.0.0 github.com/shirou/gopsutil/v3 v3.22.1 - github.com/slok/go-http-metrics v0.9.0 - github.com/smartystreets/goconvey v1.6.4 github.com/spf13/cobra v1.0.0 github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a github.com/swaggo/gin-swagger v1.5.0 @@ -61,9 +42,11 @@ require ( github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bsm/redislock v0.5.0 // indirect + github.com/casbin/redis-watcher/v2 v2.0.0-20220614104201-0e70bf2be930 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chanxuehong/rand v0.0.0-20201110082127-2f19a1bdd973 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect + github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd // indirect github.com/denisenkom/go-mssqldb v0.12.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.9.0 // indirect @@ -71,18 +54,26 @@ require ( github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/git-chglog/git-chglog v0.0.0-20190611050339-63a4e637021f // indirect + github.com/go-admin-team/go-admin-core/plugins/logger/zap v0.0.0-20210610020726-2db73adb505d // indirect + github.com/go-admin-team/gorm-adapter/v3 v3.7.8-0.20220809100335-eaf9f67b3d21 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.6 // indirect github.com/go-openapi/spec v0.20.4 // indirect github.com/go-openapi/swag v0.19.15 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.8.0 // indirect + github.com/go-redis/redis/v7 v7.4.0 // indirect + github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/protobuf v1.4.3 // indirect github.com/golang/snappy v0.0.1 // indirect - github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect + github.com/gorilla/websocket v1.4.2 // indirect github.com/henrylee2cn/ameda v1.4.10 // indirect github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 // indirect github.com/imdario/mergo v0.3.9 // indirect @@ -99,7 +90,6 @@ require ( github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.11 // indirect - github.com/jtolds/gls v4.20.0+incompatible // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect @@ -112,14 +102,15 @@ require ( github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/mojocn/base64Captcha v1.3.1 // indirect + github.com/nsqio/go-nsq v1.0.8 // indirect github.com/nyaruka/phonenumbers v1.0.55 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect - github.com/russross/blackfriday/v2 v2.0.1 // indirect - github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect - github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect + github.com/robinjoseph08/redisqueue/v2 v2.1.0 // indirect + github.com/shamsher31/goimgext v1.0.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.3 // indirect github.com/tklauser/go-sysconf v0.3.9 // indirect From fa73c3d6b103457d6c18f9a585d620bac65a2ff1 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 3 Nov 2022 14:55:02 +0800 Subject: [PATCH 161/238] =?UTF-8?q?patch=F0=9F=9A=91:=20=20update=20restar?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- restart.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/restart.sh b/restart.sh index 53ea7b588..ef8c4c13f 100644 --- a/restart.sh +++ b/restart.sh @@ -2,8 +2,9 @@ echo "go build" go mod tidy go build -o go-admin main.go +chmod +x ./go-admin echo "kill go-admin service" killall go-admin # kill go-admin service nohup ./go-admin server -c=config/settings.dev.yml >> access.log 2>&1 & #后台启动服务将日志写入access.log文件 echo "run go-admin success" -ps -aux | grep go-admin \ No newline at end of file +ps -aux | grep go-admin From ddd97d5a9e1b9e889405faa069a7d4532bb1c583 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Wed, 9 Nov 2022 17:35:16 +0800 Subject: [PATCH 162/238] =?UTF-8?q?fix=F0=9F=90=9B:=20Adjust=20the=20demo?= =?UTF-8?q?=20environment=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/sys_user.go | 21 +++------------------ common/middleware/handler/auth.go | 6 +----- common/middleware/init.go | 4 ++-- common/middleware/logger.go | 6 +----- 4 files changed, 7 insertions(+), 30 deletions(-) diff --git a/app/admin/apis/sys_user.go b/app/admin/apis/sys_user.go index ed932ff34..64eb50138 100644 --- a/app/admin/apis/sys_user.go +++ b/app/admin/apis/sys_user.go @@ -2,7 +2,6 @@ package apis import ( "github.com/gin-gonic/gin/binding" - "github.com/go-admin-team/go-admin-core/sdk/config" "go-admin/app/admin/models" "golang.org/x/crypto/bcrypt" "net/http" @@ -313,19 +312,12 @@ func (e SysUser) ResetPwd(c *gin.Context) { //数据权限检查 p := actions.GetPermissionFromContext(c) - if req.UserId == 1 && config.ApplicationConfig.Mode == "demo" { - req.Password = "123456" - } err = s.ResetPwd(&req, p) if err != nil { e.Logger.Error(err) return } - if req.UserId == 1 && config.ApplicationConfig.Mode == "demo" { - e.OK(req.GetId(), "admin:现在使用的预览环境,休想改掉我!否则会影响其他朋友体验的哦!可以创建其他用户体验该功能!") - } else { - e.OK(req.GetId(), "更新成功") - } + e.OK(req.GetId(), "更新成功") } // UpdatePwd @@ -354,10 +346,6 @@ func (e SysUser) UpdatePwd(c *gin.Context) { // 数据权限检查 p := actions.GetPermissionFromContext(c) - if user.GetUserId(c) == 1 && config.ApplicationConfig.Mode == "demo" { - req.NewPassword = "123456" - } - var hash []byte if hash, err = bcrypt.GenerateFromPassword([]byte(req.NewPassword), bcrypt.DefaultCost); err != nil { req.NewPassword = string(hash) @@ -369,11 +357,8 @@ func (e SysUser) UpdatePwd(c *gin.Context) { e.Error(http.StatusForbidden, err, "密码修改失败") return } - if user.GetUserId(c) == 1 && config.ApplicationConfig.Mode == "demo" { - e.OK(nil, "admin:现在使用的预览环境,休想改掉我!否则会影响其他朋友体验的哦!可以创建其他用户体验该功能!") - } else { - e.OK(nil, "密码修改成功") - } + + e.OK(nil, "密码修改成功") } // GetProfile diff --git a/common/middleware/handler/auth.go b/common/middleware/handler/auth.go index 222bd65d5..910c3cdaa 100644 --- a/common/middleware/handler/auth.go +++ b/common/middleware/handler/auth.go @@ -1,7 +1,6 @@ package handler import ( - "fmt" "go-admin/app/admin/models" "go-admin/common" "net/http" @@ -16,8 +15,6 @@ import ( "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user" "github.com/go-admin-team/go-admin-core/sdk/pkg/response" "github.com/mssola/user_agent" - gaConfig "go-admin/config" - "go-admin/common/global" ) @@ -119,8 +116,7 @@ func LoginLogToDB(c *gin.Context, status string, msg string, username string) { ua := user_agent.New(c.Request.UserAgent()) l["ipaddr"] = common.GetClientIP(c) - fmt.Println("gaConfig.ExtConfig.AMap.Key", gaConfig.ExtConfig.AMap.Key) - l["loginLocation"] = pkg.GetLocation(common.GetClientIP(c),gaConfig.ExtConfig.AMap.Key) + l["loginLocation"] = "" // pkg.GetLocation(common.GetClientIP(c),gaConfig.ExtConfig.AMap.Key) l["loginTime"] = pkg.GetCurrentTime() l["status"] = status l["remark"] = c.Request.UserAgent() diff --git a/common/middleware/init.go b/common/middleware/init.go index c82521ad6..990269816 100644 --- a/common/middleware/init.go +++ b/common/middleware/init.go @@ -14,6 +14,7 @@ const ( ) func InitMiddleware(r *gin.Engine) { + r.Use(DemoEvn()) // 数据库链接 r.Use(WithContextDb) // 日志处理 @@ -26,10 +27,9 @@ func InitMiddleware(r *gin.Engine) { r.Use(Options) // Secure is a middleware function that appends security r.Use(Secure) - //r.Use(DemoEvn()) // 链路追踪 //r.Use(middleware.Trace()) sdk.Runtime.SetMiddleware(JwtTokenCheck, (*jwt.GinJWTMiddleware).MiddlewareFunc) sdk.Runtime.SetMiddleware(RoleCheck, AuthCheckRole()) sdk.Runtime.SetMiddleware(PermissionCheck, actions.PermissionAction()) -} \ No newline at end of file +} diff --git a/common/middleware/logger.go b/common/middleware/logger.go index fe2596a42..89c2c070c 100644 --- a/common/middleware/logger.go +++ b/common/middleware/logger.go @@ -4,10 +4,8 @@ import ( "bufio" "bytes" "encoding/json" - "fmt" "go-admin/app/admin/service/dto" "go-admin/common" - gaConfig "go-admin/config" "io" "io/ioutil" "net/http" @@ -18,7 +16,6 @@ import ( "github.com/go-admin-team/go-admin-core/sdk" "github.com/go-admin-team/go-admin-core/sdk/api" "github.com/go-admin-team/go-admin-core/sdk/config" - "github.com/go-admin-team/go-admin-core/sdk/pkg" "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth/user" "go-admin/common/global" @@ -109,8 +106,7 @@ func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string l["_fullPath"] = c.FullPath() l["operUrl"] = reqUri l["operIp"] = clientIP - fmt.Println("gaConfig.ExtConfig.AMap.Key", gaConfig.ExtConfig.AMap.Key) - l["operLocation"] = pkg.GetLocation(clientIP, gaConfig.ExtConfig.AMap.Key) + l["operLocation"] = "" // pkg.GetLocation(clientIP, gaConfig.ExtConfig.AMap.Key) l["operName"] = user.GetUserName(c) l["requestMethod"] = reqMethod l["operParam"] = body From c8b27492eb9cb93ace7b80689a88cfa6550970f8 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Wed, 9 Nov 2022 17:36:04 +0800 Subject: [PATCH 163/238] =?UTF-8?q?fix=F0=9F=90=9B:=20update=20sqlite3=20c?= =?UTF-8?q?onfiguration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/settings.sqlite.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/settings.sqlite.yml b/config/settings.sqlite.yml index 8fb81fd0b..90e98e2ca 100644 --- a/config/settings.sqlite.yml +++ b/config/settings.sqlite.yml @@ -8,8 +8,8 @@ settings: name: testApp # 端口号 port: 8000 # 服务端口号 - readtimeout: 1 - writertimeout: 2 + readtimeout: 3000 + writertimeout: 2000 # 数据权限功能开关 enabledp: false logger: @@ -30,7 +30,7 @@ settings: # 数据库类型 mysql,sqlite3, postgres driver: sqlite3 # 数据库连接sqlite3数据文件的路径 - source: sqlite3.db + source: go-admin-db.db gen: # 代码生成读取的数据库名称 dbname: dbname From 7d7d8484d4bfc0e560d909d964acca77e19b8ffe Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 16 Nov 2022 12:05:33 +0800 Subject: [PATCH 164/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20demo=E4=B8=AD?= =?UTF-8?q?=E9=97=B4=E4=BB=B6=E6=B7=BB=E5=8A=A0=E7=8E=AF=E5=A2=83=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/middleware/demo.go | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/common/middleware/demo.go b/common/middleware/demo.go index f2cc9533e..936238744 100644 --- a/common/middleware/demo.go +++ b/common/middleware/demo.go @@ -8,19 +8,21 @@ import ( func DemoEvn() gin.HandlerFunc { return func(c *gin.Context) { method := c.Request.Method - if method == "GET" || - method == "OPTIONS" || - c.Request.RequestURI == "/api/v1/login" || - c.Request.RequestURI == "/api/v1/logout" { - c.Next() - } else { - c.JSON(http.StatusOK, gin.H{ - "code": 500, - "msg": "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600", - }) - c.Abort() - return + if config.ApplicationConfig.Mode == "demo" { + if method == "GET" || + method == "OPTIONS" || + c.Request.RequestURI == "/api/v1/login" || + c.Request.RequestURI == "/api/v1/logout" { + c.Next() + } else { + c.JSON(http.StatusOK, gin.H{ + "code": 500, + "msg": "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600", + }) + c.Abort() + return + } } - + c.Next() } -} \ No newline at end of file +} From 44f62abbcae91b837a2ae21607c7cd81bc7c1c18 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 16 Nov 2022 16:47:32 +0800 Subject: [PATCH 165/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/middleware/demo.go | 1 + 1 file changed, 1 insertion(+) diff --git a/common/middleware/demo.go b/common/middleware/demo.go index 936238744..f13f28fdb 100644 --- a/common/middleware/demo.go +++ b/common/middleware/demo.go @@ -2,6 +2,7 @@ package middleware import ( "github.com/gin-gonic/gin" + "github.com/go-admin-team/go-admin-core/sdk/config" "net/http" ) From ac971bda4b899b9653d5e510e0f97edd369bddb1 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Thu, 8 Dec 2022 18:00:33 +0800 Subject: [PATCH 166/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20=E5=BF=BD?= =?UTF-8?q?=E7=95=A5pkg=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/router.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/router.template b/template/router.template index 247ca32ab..b11e9b921 100644 --- a/template/router.template +++ b/template/router.template @@ -6,7 +6,7 @@ import ( _ "github.com/gin-gonic/gin" log "github.com/go-admin-team/go-admin-core/logger" "github.com/go-admin-team/go-admin-core/sdk" - "github.com/go-admin-team/go-admin-core/sdk/pkg" + // "github.com/go-admin-team/go-admin-core/sdk/pkg" "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth" common "go-admin/common/middleware" From 3d8b879e645d9d1d2fae7271b6a908c658c2ef27 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 13 Dec 2022 11:45:28 +0800 Subject: [PATCH 167/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 35b24d4ff..1314351be 100644 --- a/README.md +++ b/README.md @@ -241,11 +241,15 @@ npm run dev
+ + + +
wenjianzhang
WechatWechat公众号🔥🔥🔥 go-admin技术交流乙号bilibili🔥🔥🔥
From c973d6819ceb008e0dfa97173ca3c69ce1cfd49a Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 13 Dec 2022 11:47:04 +0800 Subject: [PATCH 168/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=20update=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.Zh-cn.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 889d35be3..2e637edfc 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -253,13 +253,15 @@ npm run dev - + + - + +
wenjianzhang
微信go-admin技术交流甲号公众号🔥🔥🔥 go-admin技术交流乙号哔哩哔哩🔥🔥🔥
From 79fb2d0bee9b2aff28b197b1ca237ab8d92339d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 01:38:52 +0000 Subject: [PATCH 169/238] build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.11.0 to 1.11.1. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.11.0...v1.11.1) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- go.mod | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0eac81f42..5f435fe05 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/mssola/user_agent v0.5.2 github.com/opentracing/opentracing-go v1.1.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.11.0 + github.com/prometheus/client_golang v1.11.1 github.com/qiniu/go-sdk/v7 v7.11.1 github.com/robfig/cron/v3 v3.0.1 github.com/shirou/gopsutil/v3 v3.22.1 @@ -47,6 +47,7 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chanxuehong/rand v0.0.0-20201110082127-2f19a1bdd973 // indirect github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/denisenkom/go-mssqldb v0.12.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.9.0 // indirect @@ -110,7 +111,9 @@ require ( github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/robinjoseph08/redisqueue/v2 v2.1.0 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/shamsher31/goimgext v1.0.0 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.3 // indirect github.com/tklauser/go-sysconf v0.3.9 // indirect From f61de5beeba7bc054fde90a02a516093b0863021 Mon Sep 17 00:00:00 2001 From: ford <1334788676@qq.com> Date: Fri, 17 Feb 2023 19:24:50 +0800 Subject: [PATCH 170/238] =?UTF-8?q?=E3=80=90bug=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E7=94=A8=E6=88=B7=E5=8F=AA=E7=94=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=83=E9=99=90=E6=97=B6=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF(?= =?UTF-8?q?=E6=98=B5=E7=A7=B0=E3=80=81=E7=94=A8=E6=88=B7=E5=AF=86=E7=A0=81?= =?UTF-8?q?)=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/middleware/settings.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/middleware/settings.go b/common/middleware/settings.go index b333f4802..daf8d3058 100644 --- a/common/middleware/settings.go +++ b/common/middleware/settings.go @@ -38,4 +38,6 @@ var CasbinExclude = []UrlInfo{ {Url: "/", Method: "GET"}, {Url: "/api/v1/server-monitor", Method: "GET"}, {Url: "/api/v1/public/uploadFile", Method: "POST"}, + {Url: "/api/v1/user/pwd/set", Method: "PUT"}, + {Url: "/api/v1/sys-user", Method: "PUT"}, } From 1bf9f74bdf4ad6e510dbb9fa81cc4453800f755c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Feb 2023 00:08:28 +0000 Subject: [PATCH 171/238] build(deps): bump golang.org/x/text from 0.3.7 to 0.3.8 Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 0eac81f42..d7ec1c78b 100644 --- a/go.mod +++ b/go.mod @@ -47,6 +47,7 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chanxuehong/rand v0.0.0-20201110082127-2f19a1bdd973 // indirect github.com/chanxuehong/wechat v0.0.0-20201110083048-0180211b69fd // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/denisenkom/go-mssqldb v0.12.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.9.0 // indirect @@ -110,7 +111,9 @@ require ( github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/robinjoseph08/redisqueue/v2 v2.1.0 // indirect + github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/shamsher31/goimgext v1.0.0 // indirect + github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect github.com/spf13/cast v1.3.1 // indirect github.com/spf13/pflag v1.0.3 // indirect github.com/tklauser/go-sysconf v0.3.9 // indirect @@ -124,12 +127,12 @@ require ( go.uber.org/zap v1.15.0 // indirect golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect + golang.org/x/text v0.3.8 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - golang.org/x/tools v0.1.10 // indirect + golang.org/x/tools v0.1.12 // indirect google.golang.org/protobuf v1.26.0-rc.1 // indirect gopkg.in/AlecAivazis/survey.v1 v1.8.5 // indirect gopkg.in/kyokomi/emoji.v1 v1.5.1 // indirect From 6036c6e4e3da4d5e4bd5b76c231064e7c43a3bb2 Mon Sep 17 00:00:00 2001 From: Akiraka Date: Fri, 14 Apr 2023 19:07:01 +0800 Subject: [PATCH 172/238] =?UTF-8?q?=E6=8E=A5=E5=8F=97=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/ip.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/ip.go b/common/ip.go index ab3414837..bc4d9ef44 100644 --- a/common/ip.go +++ b/common/ip.go @@ -8,7 +8,7 @@ import ( func GetClientIP(c *gin.Context) string { ClientIP := c.ClientIP() //fmt.Println("ClientIP:", ClientIP) - RemoteIP, _ := c.RemoteIP() + RemoteIP := c.RemoteIP() //fmt.Println("RemoteIP:", RemoteIP) ip := c.Request.Header.Get("X-Forwarded-For") if strings.Contains(ip, "127.0.0.1") || ip == "" { @@ -17,8 +17,8 @@ func GetClientIP(c *gin.Context) string { if ip == "" { ip = "127.0.0.1" } - if RemoteIP.String() != "127.0.0.1" { - ip = RemoteIP.String() + if RemoteIP != "127.0.0.1" { + ip = RemoteIP } if ClientIP != "127.0.0.1" { ip = ClientIP From a1a5634c4ed4e353c870f6e447306ec616aa3c2d Mon Sep 17 00:00:00 2001 From: Akiraka Date: Fri, 14 Apr 2023 19:51:22 +0800 Subject: [PATCH 173/238] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/ip.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/ip.go b/common/ip.go index bc4d9ef44..ab3414837 100644 --- a/common/ip.go +++ b/common/ip.go @@ -8,7 +8,7 @@ import ( func GetClientIP(c *gin.Context) string { ClientIP := c.ClientIP() //fmt.Println("ClientIP:", ClientIP) - RemoteIP := c.RemoteIP() + RemoteIP, _ := c.RemoteIP() //fmt.Println("RemoteIP:", RemoteIP) ip := c.Request.Header.Get("X-Forwarded-For") if strings.Contains(ip, "127.0.0.1") || ip == "" { @@ -17,8 +17,8 @@ func GetClientIP(c *gin.Context) string { if ip == "" { ip = "127.0.0.1" } - if RemoteIP != "127.0.0.1" { - ip = RemoteIP + if RemoteIP.String() != "127.0.0.1" { + ip = RemoteIP.String() } if ClientIP != "127.0.0.1" { ip = ClientIP From b846053beaf1b446af8a11bea6a9c9350822e7ba Mon Sep 17 00:00:00 2001 From: Akiraka Date: Fri, 14 Apr 2023 19:51:48 +0800 Subject: [PATCH 174/238] =?UTF-8?q?=E6=81=A2=E5=A4=8D=20common/middleware/?= =?UTF-8?q?demo.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 30fb59f30..4cc42051b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ temp/ !temp vendor config/settings.dev.yml -common/middleware/demo.go config/settings.dev.*.yml config/settings.dev.*.yml.log temp/logs From 04d2d7dde1fdf150149a77d001b46813d0fdef0a Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 19 Apr 2023 18:50:35 +0800 Subject: [PATCH 175/238] =?UTF-8?q?format=F0=9F=A5=9A:=20Exclude=20empty?= =?UTF-8?q?=20permission=20identification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/sys_role.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index e8bd2d183..fe82dbe13 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -334,7 +334,9 @@ func (e *SysRole) GetById(roleId int) ([]string, error) { } l := *model.SysMenu for i := 0; i < len(l); i++ { - permissions = append(permissions, l[i].Permission) + if l[i].Permission != "" { + permissions = append(permissions, l[i].Permission) + } } return permissions, nil } From a078e31664a5676b545a5ea71ca0658baafbdf6a Mon Sep 17 00:00:00 2001 From: llussy Date: Wed, 26 Apr 2023 15:59:19 +0800 Subject: [PATCH 176/238] fix setting.yml --- README.Zh-cn.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.Zh-cn.md b/README.Zh-cn.md index 2e637edfc..50d207e65 100644 --- a/README.Zh-cn.md +++ b/README.Zh-cn.md @@ -153,7 +153,7 @@ go build # 修改配置 # 文件路径 go-admin/config/settings.yml -vi ./config/setting.yml +vi ./config/settings.yml # 1. 配置文件中修改数据库信息 # 注意: settings.database 下对应的配置数据 diff --git a/README.md b/README.md index 1314351be..5660f6230 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ go build # Change setting # File path go-admin/config/settings.yml -vi ./config/setting.yml +vi ./config/settings.yml # 1. Modify the database information in the configuration file # Note: The corresponding configuration data under settings.database From c48f70a7c6fa80e5ae472a4b7442f4826b84367f Mon Sep 17 00:00:00 2001 From: wwhai Date: Thu, 4 May 2023 23:25:43 +0800 Subject: [PATCH 177/238] fix: change 'os.Signal' channel to buffered --- cmd/api/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/api/server.go b/cmd/api/server.go index f515ffbbc..7168bc13d 100644 --- a/cmd/api/server.go +++ b/cmd/api/server.go @@ -136,7 +136,7 @@ func run() error { fmt.Printf("- Network: http://%s:%d/swagger/admin/index.html \r\n", pkg.GetLocaHonst(), config.ApplicationConfig.Port) fmt.Printf("%s Enter Control + C Shutdown Server \r\n", pkg.GetCurrentTimeStr()) // 等待中断信号以优雅地关闭服务器(设置 5 秒的超时时间) - quit := make(chan os.Signal) + quit := make(chan os.Signal, 1) signal.Notify(quit, os.Interrupt) <-quit From 5527f6386afb0cf37cc893f8a2cfde3b90dfefbe Mon Sep 17 00:00:00 2001 From: wanghaima Date: Sun, 7 May 2023 18:47:36 +0800 Subject: [PATCH 178/238] =?UTF-8?q?=E4=BC=98=E5=8C=96API=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/dto/sys_api.go | 5 ++--- app/admin/service/sys_api.go | 13 ++++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/admin/service/dto/sys_api.go b/app/admin/service/dto/sys_api.go index 5e53d071b..d26034eec 100644 --- a/app/admin/service/dto/sys_api.go +++ b/app/admin/service/dto/sys_api.go @@ -11,8 +11,9 @@ type SysApiGetPageReq struct { dto.Pagination `search:"-"` Title string `form:"title" search:"type:contains;column:title;table:sys_api" comment:"标题"` Path string `form:"path" search:"type:contains;column:path;table:sys_api" comment:"地址"` - Action string `form:"action" search:"type:exact;column:action;table:sys_api" comment:"类型"` + Action string `form:"action" search:"type:exact;column:action;table:sys_api" comment:"请求方式"` ParentId string `form:"parentId" search:"type:exact;column:parent_id;table:sys_api" comment:"按钮id"` + Type string `form:"type" search:"-" comment:"类型"` SysApiOrder } @@ -84,7 +85,6 @@ func (s *SysApiGetReq) GetId() interface{} { return s.Id } - // SysApiDeleteReq 功能删除请求参数 type SysApiDeleteReq struct { Ids []int `json:"ids"` @@ -93,4 +93,3 @@ type SysApiDeleteReq struct { func (s *SysApiDeleteReq) GetId() interface{} { return s.Ids } - diff --git a/app/admin/service/sys_api.go b/app/admin/service/sys_api.go index 1818a8877..d8d6c3504 100644 --- a/app/admin/service/sys_api.go +++ b/app/admin/service/sys_api.go @@ -23,13 +23,20 @@ func (e *SysApi) GetPage(c *dto.SysApiGetPageReq, p *actions.DataPermission, lis var err error var data models.SysApi - err = e.Orm.Debug().Model(&data). + orm := e.Orm.Debug().Model(&data). Scopes( cDto.MakeCondition(c.GetNeedSearch()), cDto.Paginate(c.GetPageSize(), c.GetPageIndex()), actions.Permission(data.TableName(), p), - ). - Find(list).Limit(-1).Offset(-1). + ) + if c.Type != "" { + qType := c.Type + if qType == "暂无" { + qType = "" + } + orm = orm.Where("`type` = ?", qType) + } + err = orm.Find(list).Limit(-1).Offset(-1). Count(count).Error if err != nil { e.Log.Errorf("Service GetSysApiPage error:%s", err) From 68accd5448b743d18b455ad28c31c71359f742fd Mon Sep 17 00:00:00 2001 From: wanghaima Date: Sun, 7 May 2023 19:33:00 +0800 Subject: [PATCH 179/238] =?UTF-8?q?fix=5Fedit=5Fmaster=5Frole=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/models/sys_role.go | 28 ++++++++++++++-------------- app/admin/service/dto/sys_role.go | 2 +- app/admin/service/sys_role.go | 12 +++++++++++- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/admin/models/sys_role.go b/app/admin/models/sys_role.go index 766af2091..ee97f00d5 100644 --- a/app/admin/models/sys_role.go +++ b/app/admin/models/sys_role.go @@ -3,19 +3,19 @@ package models import "go-admin/common/models" type SysRole struct { - RoleId int `json:"roleId" gorm:"primaryKey;autoIncrement"` // 角色编码 - RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称 - Status string `json:"status" gorm:"size:4;"` // - RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码 - RoleSort int `json:"roleSort" gorm:""` //角色排序 - Flag string `json:"flag" gorm:"size:128;"` // - Remark string `json:"remark" gorm:"size:255;"` //备注 - Admin bool `json:"admin" gorm:"size:4;"` - DataScope string `json:"dataScope" gorm:"size:128;"` - Params string `json:"params" gorm:"-"` - MenuIds []int `json:"menuIds" gorm:"-"` - DeptIds []int `json:"deptIds" gorm:"-"` - SysDept []SysDept `json:"sysDept" gorm:"many2many:sys_role_dept;foreignKey:RoleId;joinForeignKey:role_id;references:DeptId;joinReferences:dept_id;"` + RoleId int `json:"roleId" gorm:"primaryKey;autoIncrement"` // 角色编码 + RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称 + Status string `json:"status" gorm:"size:4;"` // 状态 1禁用 2正常 + RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码 + RoleSort int `json:"roleSort" gorm:""` //角色排序 + Flag string `json:"flag" gorm:"size:128;"` // + Remark string `json:"remark" gorm:"size:255;"` //备注 + Admin bool `json:"admin" gorm:"size:4;"` + DataScope string `json:"dataScope" gorm:"size:128;"` + Params string `json:"params" gorm:"-"` + MenuIds []int `json:"menuIds" gorm:"-"` + DeptIds []int `json:"deptIds" gorm:"-"` + SysDept []SysDept `json:"sysDept" gorm:"many2many:sys_role_dept;foreignKey:RoleId;joinForeignKey:role_id;references:DeptId;joinReferences:dept_id;"` SysMenu *[]SysMenu `json:"sysMenu" gorm:"many2many:sys_role_menu;foreignKey:RoleId;joinForeignKey:role_id;references:MenuId;joinReferences:menu_id;"` models.ControlBy models.ModelTime @@ -32,4 +32,4 @@ func (e *SysRole) Generate() models.ActiveRecord { func (e *SysRole) GetId() interface{} { return e.RoleId -} \ No newline at end of file +} diff --git a/app/admin/service/dto/sys_role.go b/app/admin/service/dto/sys_role.go index 0fb31f5d5..789b85e14 100644 --- a/app/admin/service/dto/sys_role.go +++ b/app/admin/service/dto/sys_role.go @@ -36,7 +36,7 @@ func (m *SysRoleGetPageReq) GetNeedSearch() interface{} { type SysRoleInsertReq struct { RoleId int `uri:"id" comment:"角色编码"` // 角色编码 RoleName string `form:"roleName" comment:"角色名称"` // 角色名称 - Status string `form:"status" comment:"状态"` // 状态 + Status string `form:"status" comment:"状态"` // 状态 1禁用 2正常 RoleKey string `form:"roleKey" comment:"角色代码"` // 角色代码 RoleSort int `form:"roleSort" comment:"角色排序"` // 角色排序 Flag string `form:"flag" comment:"标记"` // 标记 diff --git a/app/admin/service/sys_role.go b/app/admin/service/sys_role.go index fe82dbe13..f1fee74be 100644 --- a/app/admin/service/sys_role.go +++ b/app/admin/service/sys_role.go @@ -118,6 +118,7 @@ func (e *SysRole) Insert(c *dto.SysRoleInsertReq, cb *casbin.SyncedEnforcer) err return nil } + // 写入 sys_casbin_rule 权限表里 当前角色数据的记录 _, err = cb.AddNamedPolicies("p", polices) if err != nil { return err @@ -151,6 +152,7 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err } c.Generate(&model) model.SysMenu = &mlist + // 更新关联的数据,使用 FullSaveAssociations 模式 db := tx.Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) if err = db.Error; err != nil { @@ -161,6 +163,7 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err return errors.New("无权更新该数据") } + // 清除 sys_casbin_rule 权限表里 当前角色的所有记录 _, err = cb.RemoveFilteredPolicy(0, model.RoleKey) if err != nil { e.Log.Errorf("delete policy error:%s", err) @@ -180,6 +183,8 @@ func (e *SysRole) Update(c *dto.SysRoleUpdateReq, cb *casbin.SyncedEnforcer) err if len(polices) <= 0 { return nil } + + // 写入 sys_casbin_rule 权限表里 当前角色数据的记录 _, err = cb.AddNamedPolicies("p", polices) if err != nil { return err @@ -203,6 +208,7 @@ func (e *SysRole) Remove(c *dto.SysRoleDeleteReq, cb *casbin.SyncedEnforcer) err } var model = models.SysRole{} tx.Preload("SysMenu").Preload("SysDept").First(&model, c.GetId()) + //删除 SysRole 时,同时删除角色所有 关联其它表 记录 (SysMenu 和 SysMenu) db := tx.Select(clause.Associations).Delete(&model) if err = db.Error; err != nil { @@ -213,6 +219,7 @@ func (e *SysRole) Remove(c *dto.SysRoleDeleteReq, cb *casbin.SyncedEnforcer) err return errors.New("无权更新该数据") } + // 清除 sys_casbin_rule 权限表里 当前角色的所有记录 _, _ = cb.RemoveFilteredPolicy(0, model.RoleKey) return nil @@ -250,6 +257,7 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { var model = models.SysRole{} tx.Preload("SysDept").First(&model, c.RoleId) tx.Where("dept_id in ?", c.DeptIds).Find(&dlist) + // 删除SysRole 和 SysDept 的关联关系 err = tx.Model(&model).Association("SysDept").Delete(model.SysDept) if err != nil { e.Log.Errorf("delete SysDept error:%s", err) @@ -258,6 +266,7 @@ func (e *SysRole) UpdateDataScope(c *dto.RoleDataScopeReq) *SysRole { } c.Generate(&model) model.SysDept = dlist + // 更新关联的数据,使用 FullSaveAssociations 模式 db := tx.Model(&model).Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) @@ -288,6 +297,7 @@ func (e *SysRole) UpdateStatus(c *dto.UpdateStatusReq) error { var model = models.SysRole{} tx.First(&model, c.GetId()) c.Generate(&model) + // 更新关联的数据,使用 FullSaveAssociations 模式 db := tx.Session(&gorm.Session{FullSaveAssociations: true}).Debug().Save(&model) if err = db.Error; err != nil { e.Log.Errorf("db error:%s", err) @@ -334,7 +344,7 @@ func (e *SysRole) GetById(roleId int) ([]string, error) { } l := *model.SysMenu for i := 0; i < len(l); i++ { - if l[i].Permission != "" { + if l[i].Permission != "" { permissions = append(permissions, l[i].Permission) } } From ef6fdaa221b50fe7fa962be3b20e4dd7d069e192 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 May 2023 07:38:07 +0000 Subject: [PATCH 180/238] build(deps): bump golang.org/x/net Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220722155237-a158d28d115b to 0.7.0. - [Commits](https://github.com/golang/net/commits/v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d7ec1c78b..5989f2377 100644 --- a/go.mod +++ b/go.mod @@ -127,10 +127,10 @@ require ( go.uber.org/zap v1.15.0 // indirect golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect + golang.org/x/net v0.7.0 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect - golang.org/x/text v0.3.8 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/tools v0.1.12 // indirect google.golang.org/protobuf v1.26.0-rc.1 // indirect From 7b43982595563942d7eb66e311627fa559dde664 Mon Sep 17 00:00:00 2001 From: Vingurzhou Date: Sat, 10 Jun 2023 15:57:18 +0800 Subject: [PATCH 181/238] Update Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(makefile): -installsuffix 参数没有指定后缀字符串。它被设定为空,这可能导致一些问题 --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 812402bbe..afdb1a12b 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PROJECT:=go-admin .PHONY: build build: - CGO_ENABLED=0 go build -ldflags="-w -s" -a -installsuffix -o go-admin . + CGO_ENABLED=0 go build -ldflags="-w -s" -a -installsuffix "" -o go-admin . # make build-linux build-linux: @@ -51,4 +51,4 @@ deploy: #@git checkout master #@git pull origin master make build-linux - make run \ No newline at end of file + make run From 73118e49b93c2a07b9bcddf4ee92fe48f764a695 Mon Sep 17 00:00:00 2001 From: NipGeihou Date: Tue, 20 Jun 2023 00:37:59 +0800 Subject: [PATCH 182/238] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dgo=20generate?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E4=B8=8D=E6=9B=B4=E6=96=B0Swagger=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复go generate不更新Swagger文档问题,并更新生成后文档文件 --- docs/admin/admin_docs.go | 579 +++++++++++++++++++++++++++++++++- docs/admin/admin_swagger.json | 578 ++++++++++++++++++++++++++++++++- docs/admin/admin_swagger.yaml | 380 +++++++++++++++++++++- main.go | 2 +- 4 files changed, 1531 insertions(+), 8 deletions(-) diff --git a/docs/admin/admin_docs.go b/docs/admin/admin_docs.go index b2cf06e4c..31c596a56 100644 --- a/docs/admin/admin_docs.go +++ b/docs/admin/admin_docs.go @@ -11,6 +11,10 @@ const docTemplateadmin = `{ "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, + "license": { + "name": "MIT", + "url": "https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md" + }, "version": "{{.Version}}" }, "host": "{{.Host}}", @@ -83,6 +87,80 @@ const docTemplateadmin = `{ } } }, + "/api/v1/db/columns/page": { + "get": { + "description": "数据库表列分页列表 / database table column page list", + "tags": [ + "工具 / 生成工具" + ], + "summary": "分页列表数据 / page list data", + "parameters": [ + { + "type": "string", + "description": "tableName / 数据表名称", + "name": "tableName", + "in": "query" + }, + { + "type": "integer", + "description": "pageSize / 页条数", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "pageIndex / 页码", + "name": "pageIndex", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, + "/api/v1/db/tables/page": { + "get": { + "description": "数据库表分页列表 / database table page list", + "tags": [ + "工具 / 生成工具" + ], + "summary": "分页列表数据 / page list data", + "parameters": [ + { + "type": "string", + "description": "tableName / 数据表名称", + "name": "tableName", + "in": "query" + }, + { + "type": "integer", + "description": "pageSize / 页条数", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "pageIndex / 页码", + "name": "pageIndex", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/api/v1/dept": { "get": { "security": [ @@ -1172,6 +1250,47 @@ const docTemplateadmin = `{ } } }, + "/api/v1/public/uploadFile": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "获取JSON", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "公共接口" + ], + "summary": "上传图片", + "parameters": [ + { + "type": "string", + "description": "type", + "name": "type", + "in": "query", + "required": true + }, + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/api/v1/role": { "get": { "security": [ @@ -1391,6 +1510,28 @@ const docTemplateadmin = `{ } } }, + "/api/v1/server-monitor": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "description": "获取JSON", + "tags": [ + "系统信息" + ], + "summary": "系统信息", + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/api/v1/set-config": { "get": { "security": [ @@ -2302,6 +2443,165 @@ const docTemplateadmin = `{ } } }, + "/api/v1/sys/tables/info": { + "put": { + "security": [ + { + "Bearer": [] + } + ], + "description": "修改表结构", + "consumes": [ + "application/json" + ], + "tags": [ + "工具 / 生成工具" + ], + "summary": "修改表结构", + "parameters": [ + { + "description": "body", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tools.SysTables" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "添加表结构", + "consumes": [ + "application/json" + ], + "tags": [ + "工具 / 生成工具" + ], + "summary": "添加表结构", + "parameters": [ + { + "type": "string", + "description": "tableName / 数据表名称", + "name": "tables", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/v1/sys/tables/info/{tableId}": { + "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/response.Response" + } + } + } + }, + "delete": { + "description": "删除表结构", + "tags": [ + "工具 / 生成工具" + ], + "summary": "删除表结构", + "parameters": [ + { + "type": "integer", + "description": "tableId", + "name": "tableId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/v1/sys/tables/page": { + "get": { + "description": "生成表分页列表", + "tags": [ + "工具 / 生成工具" + ], + "summary": "分页列表数据", + "parameters": [ + { + "type": "string", + "description": "tableName / 数据表名称", + "name": "tableName", + "in": "query" + }, + { + "type": "integer", + "description": "pageSize / 页条数", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "pageIndex / 页码", + "name": "pageIndex", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/api/v1/user/avatar": { "post": { "security": [ @@ -3268,7 +3568,7 @@ const docTemplateadmin = `{ "type": "integer" }, "status": { - "description": "状态", + "description": "状态 1禁用 2正常", "type": "string" }, "sysDept": { @@ -3781,18 +4081,289 @@ const docTemplateadmin = `{ "type": "string" } } + }, + "tools.Params": { + "type": "object", + "properties": { + "treeCode": { + "type": "string" + }, + "treeName": { + "type": "string" + }, + "treeParentCode": { + "type": "string" + } + } + }, + "tools.SysColumns": { + "type": "object", + "properties": { + "columnComment": { + "type": "string" + }, + "columnId": { + "type": "integer" + }, + "columnName": { + "type": "string" + }, + "columnType": { + "type": "string" + }, + "createBy": { + "type": "integer" + }, + "createdAt": { + "type": "string" + }, + "deletedAt": { + "type": "string" + }, + "dictType": { + "type": "string" + }, + "edit": { + "type": "boolean" + }, + "fkCol": { + "type": "array", + "items": { + "$ref": "#/definitions/tools.SysColumns" + } + }, + "fkLabelId": { + "type": "string" + }, + "fkLabelName": { + "type": "string" + }, + "fkTableName": { + "type": "string" + }, + "fkTableNameClass": { + "type": "string" + }, + "fkTableNamePackage": { + "type": "string" + }, + "goField": { + "type": "string" + }, + "goType": { + "type": "string" + }, + "htmlType": { + "type": "string" + }, + "increment": { + "type": "boolean" + }, + "insert": { + "type": "boolean" + }, + "isEdit": { + "type": "string" + }, + "isIncrement": { + "type": "string" + }, + "isInsert": { + "type": "string" + }, + "isList": { + "type": "string" + }, + "isPk": { + "type": "string" + }, + "isQuery": { + "type": "string" + }, + "isRequired": { + "type": "string" + }, + "jsonField": { + "type": "string" + }, + "list": { + "type": "string" + }, + "pk": { + "type": "boolean" + }, + "query": { + "type": "boolean" + }, + "queryType": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "sort": { + "type": "integer" + }, + "superColumn": { + "type": "boolean" + }, + "tableId": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "usableColumn": { + "type": "boolean" + } + } + }, + "tools.SysTables": { + "type": "object", + "properties": { + "businessName": { + "type": "string" + }, + "className": { + "description": "类名", + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/tools.SysColumns" + } + }, + "createBy": { + "type": "integer" + }, + "createdAt": { + "type": "string" + }, + "crud": { + "type": "boolean" + }, + "dataScope": { + "type": "string" + }, + "deletedAt": { + "type": "string" + }, + "functionAuthor": { + "description": "功能作者", + "type": "string" + }, + "functionName": { + "description": "功能名称", + "type": "string" + }, + "isActions": { + "type": "integer" + }, + "isAuth": { + "type": "integer" + }, + "isDataScope": { + "type": "integer" + }, + "isLogicalDelete": { + "type": "string" + }, + "logicalDelete": { + "type": "boolean" + }, + "logicalDeleteColumn": { + "type": "string" + }, + "moduleFrontName": { + "description": "前端文件名", + "type": "string" + }, + "moduleName": { + "description": "go文件名", + "type": "string" + }, + "options": { + "type": "string" + }, + "packageName": { + "description": "包名", + "type": "string" + }, + "params": { + "$ref": "#/definitions/tools.Params" + }, + "pkColumn": { + "type": "string" + }, + "pkGoField": { + "type": "string" + }, + "pkJsonField": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "tableComment": { + "description": "表备注", + "type": "string" + }, + "tableId": { + "description": "表编码", + "type": "integer" + }, + "tableName": { + "description": "表名称", + "type": "string" + }, + "tplCategory": { + "type": "string" + }, + "tree": { + "type": "boolean" + }, + "treeCode": { + "type": "string" + }, + "treeName": { + "type": "string" + }, + "treeParentCode": { + "type": "string" + }, + "updateBy": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "Bearer": { + "type": "apiKey", + "name": "Authorization", + "in": "header" } } }` // SwaggerInfoadmin holds exported Swagger Info so clients can modify it var SwaggerInfoadmin = &swag.Spec{ - Version: "", + Version: "2.0.0", Host: "", BasePath: "", Schemes: []string{}, - Title: "", - Description: "", + Title: "go-admin API", + Description: "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", InfoInstanceName: "admin", SwaggerTemplate: docTemplateadmin, } diff --git a/docs/admin/admin_swagger.json b/docs/admin/admin_swagger.json index c43d90304..d3c32a185 100644 --- a/docs/admin/admin_swagger.json +++ b/docs/admin/admin_swagger.json @@ -1,7 +1,14 @@ { "swagger": "2.0", "info": { - "contact": {} + "description": "基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档\n添加qq群: 521386980 进入技术交流群 请先star,谢谢!", + "title": "go-admin API", + "contact": {}, + "license": { + "name": "MIT", + "url": "https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md" + }, + "version": "2.0.0" }, "paths": { "/api/v1/app-config": { @@ -71,6 +78,80 @@ } } }, + "/api/v1/db/columns/page": { + "get": { + "description": "数据库表列分页列表 / database table column page list", + "tags": [ + "工具 / 生成工具" + ], + "summary": "分页列表数据 / page list data", + "parameters": [ + { + "type": "string", + "description": "tableName / 数据表名称", + "name": "tableName", + "in": "query" + }, + { + "type": "integer", + "description": "pageSize / 页条数", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "pageIndex / 页码", + "name": "pageIndex", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, + "/api/v1/db/tables/page": { + "get": { + "description": "数据库表分页列表 / database table page list", + "tags": [ + "工具 / 生成工具" + ], + "summary": "分页列表数据 / page list data", + "parameters": [ + { + "type": "string", + "description": "tableName / 数据表名称", + "name": "tableName", + "in": "query" + }, + { + "type": "integer", + "description": "pageSize / 页条数", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "pageIndex / 页码", + "name": "pageIndex", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/api/v1/dept": { "get": { "security": [ @@ -1160,6 +1241,47 @@ } } }, + "/api/v1/public/uploadFile": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "获取JSON", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "公共接口" + ], + "summary": "上传图片", + "parameters": [ + { + "type": "string", + "description": "type", + "name": "type", + "in": "query", + "required": true + }, + { + "type": "file", + "description": "file", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/api/v1/role": { "get": { "security": [ @@ -1379,6 +1501,28 @@ } } }, + "/api/v1/server-monitor": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "description": "获取JSON", + "tags": [ + "系统信息" + ], + "summary": "系统信息", + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/api/v1/set-config": { "get": { "security": [ @@ -2290,6 +2434,165 @@ } } }, + "/api/v1/sys/tables/info": { + "put": { + "security": [ + { + "Bearer": [] + } + ], + "description": "修改表结构", + "consumes": [ + "application/json" + ], + "tags": [ + "工具 / 生成工具" + ], + "summary": "修改表结构", + "parameters": [ + { + "description": "body", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tools.SysTables" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "Bearer": [] + } + ], + "description": "添加表结构", + "consumes": [ + "application/json" + ], + "tags": [ + "工具 / 生成工具" + ], + "summary": "添加表结构", + "parameters": [ + { + "type": "string", + "description": "tableName / 数据表名称", + "name": "tables", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": -1, \"message\": \"添加失败\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/v1/sys/tables/info/{tableId}": { + "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/response.Response" + } + } + } + }, + "delete": { + "description": "删除表结构", + "tags": [ + "工具 / 生成工具" + ], + "summary": "删除表结构", + "parameters": [ + { + "type": "integer", + "description": "tableId", + "name": "tableId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"code\": -1, \"message\": \"删除失败\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/v1/sys/tables/page": { + "get": { + "description": "生成表分页列表", + "tags": [ + "工具 / 生成工具" + ], + "summary": "分页列表数据", + "parameters": [ + { + "type": "string", + "description": "tableName / 数据表名称", + "name": "tableName", + "in": "query" + }, + { + "type": "integer", + "description": "pageSize / 页条数", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "pageIndex / 页码", + "name": "pageIndex", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.Response" + } + } + } + } + }, "/api/v1/user/avatar": { "post": { "security": [ @@ -3256,7 +3559,7 @@ "type": "integer" }, "status": { - "description": "状态", + "description": "状态 1禁用 2正常", "type": "string" }, "sysDept": { @@ -3769,6 +4072,277 @@ "type": "string" } } + }, + "tools.Params": { + "type": "object", + "properties": { + "treeCode": { + "type": "string" + }, + "treeName": { + "type": "string" + }, + "treeParentCode": { + "type": "string" + } + } + }, + "tools.SysColumns": { + "type": "object", + "properties": { + "columnComment": { + "type": "string" + }, + "columnId": { + "type": "integer" + }, + "columnName": { + "type": "string" + }, + "columnType": { + "type": "string" + }, + "createBy": { + "type": "integer" + }, + "createdAt": { + "type": "string" + }, + "deletedAt": { + "type": "string" + }, + "dictType": { + "type": "string" + }, + "edit": { + "type": "boolean" + }, + "fkCol": { + "type": "array", + "items": { + "$ref": "#/definitions/tools.SysColumns" + } + }, + "fkLabelId": { + "type": "string" + }, + "fkLabelName": { + "type": "string" + }, + "fkTableName": { + "type": "string" + }, + "fkTableNameClass": { + "type": "string" + }, + "fkTableNamePackage": { + "type": "string" + }, + "goField": { + "type": "string" + }, + "goType": { + "type": "string" + }, + "htmlType": { + "type": "string" + }, + "increment": { + "type": "boolean" + }, + "insert": { + "type": "boolean" + }, + "isEdit": { + "type": "string" + }, + "isIncrement": { + "type": "string" + }, + "isInsert": { + "type": "string" + }, + "isList": { + "type": "string" + }, + "isPk": { + "type": "string" + }, + "isQuery": { + "type": "string" + }, + "isRequired": { + "type": "string" + }, + "jsonField": { + "type": "string" + }, + "list": { + "type": "string" + }, + "pk": { + "type": "boolean" + }, + "query": { + "type": "boolean" + }, + "queryType": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "sort": { + "type": "integer" + }, + "superColumn": { + "type": "boolean" + }, + "tableId": { + "type": "integer" + }, + "updateBy": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + }, + "usableColumn": { + "type": "boolean" + } + } + }, + "tools.SysTables": { + "type": "object", + "properties": { + "businessName": { + "type": "string" + }, + "className": { + "description": "类名", + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/tools.SysColumns" + } + }, + "createBy": { + "type": "integer" + }, + "createdAt": { + "type": "string" + }, + "crud": { + "type": "boolean" + }, + "dataScope": { + "type": "string" + }, + "deletedAt": { + "type": "string" + }, + "functionAuthor": { + "description": "功能作者", + "type": "string" + }, + "functionName": { + "description": "功能名称", + "type": "string" + }, + "isActions": { + "type": "integer" + }, + "isAuth": { + "type": "integer" + }, + "isDataScope": { + "type": "integer" + }, + "isLogicalDelete": { + "type": "string" + }, + "logicalDelete": { + "type": "boolean" + }, + "logicalDeleteColumn": { + "type": "string" + }, + "moduleFrontName": { + "description": "前端文件名", + "type": "string" + }, + "moduleName": { + "description": "go文件名", + "type": "string" + }, + "options": { + "type": "string" + }, + "packageName": { + "description": "包名", + "type": "string" + }, + "params": { + "$ref": "#/definitions/tools.Params" + }, + "pkColumn": { + "type": "string" + }, + "pkGoField": { + "type": "string" + }, + "pkJsonField": { + "type": "string" + }, + "remark": { + "type": "string" + }, + "tableComment": { + "description": "表备注", + "type": "string" + }, + "tableId": { + "description": "表编码", + "type": "integer" + }, + "tableName": { + "description": "表名称", + "type": "string" + }, + "tplCategory": { + "type": "string" + }, + "tree": { + "type": "boolean" + }, + "treeCode": { + "type": "string" + }, + "treeName": { + "type": "string" + }, + "treeParentCode": { + "type": "string" + }, + "updateBy": { + "type": "integer" + }, + "updatedAt": { + "type": "string" + } + } + } + }, + "securityDefinitions": { + "Bearer": { + "type": "apiKey", + "name": "Authorization", + "in": "header" } } } \ No newline at end of file diff --git a/docs/admin/admin_swagger.yaml b/docs/admin/admin_swagger.yaml index 7e5318bc5..412817e60 100644 --- a/docs/admin/admin_swagger.yaml +++ b/docs/admin/admin_swagger.yaml @@ -529,7 +529,7 @@ definitions: description: 角色排序 type: integer status: - description: 状态 + description: 状态 1禁用 2正常 type: string sysDept: items: @@ -876,8 +876,194 @@ definitions: status: type: string type: object + tools.Params: + properties: + treeCode: + type: string + treeName: + type: string + treeParentCode: + type: string + type: object + tools.SysColumns: + properties: + columnComment: + type: string + columnId: + type: integer + columnName: + type: string + columnType: + type: string + createBy: + type: integer + createdAt: + type: string + deletedAt: + type: string + dictType: + type: string + edit: + type: boolean + fkCol: + items: + $ref: '#/definitions/tools.SysColumns' + type: array + fkLabelId: + type: string + fkLabelName: + type: string + fkTableName: + type: string + fkTableNameClass: + type: string + fkTableNamePackage: + type: string + goField: + type: string + goType: + type: string + htmlType: + type: string + increment: + type: boolean + insert: + type: boolean + isEdit: + type: string + isIncrement: + type: string + isInsert: + type: string + isList: + type: string + isPk: + type: string + isQuery: + type: string + isRequired: + type: string + jsonField: + type: string + list: + type: string + pk: + type: boolean + query: + type: boolean + queryType: + type: string + remark: + type: string + required: + type: boolean + sort: + type: integer + superColumn: + type: boolean + tableId: + type: integer + updateBy: + type: integer + updatedAt: + type: string + usableColumn: + type: boolean + type: object + tools.SysTables: + properties: + businessName: + type: string + className: + description: 类名 + type: string + columns: + items: + $ref: '#/definitions/tools.SysColumns' + type: array + createBy: + type: integer + createdAt: + type: string + crud: + type: boolean + dataScope: + type: string + deletedAt: + type: string + functionAuthor: + description: 功能作者 + type: string + functionName: + description: 功能名称 + type: string + isActions: + type: integer + isAuth: + type: integer + isDataScope: + type: integer + isLogicalDelete: + type: string + logicalDelete: + type: boolean + logicalDeleteColumn: + type: string + moduleFrontName: + description: 前端文件名 + type: string + moduleName: + description: go文件名 + type: string + options: + type: string + packageName: + description: 包名 + type: string + params: + $ref: '#/definitions/tools.Params' + pkColumn: + type: string + pkGoField: + type: string + pkJsonField: + type: string + remark: + type: string + tableComment: + description: 表备注 + type: string + tableId: + description: 表编码 + type: integer + tableName: + description: 表名称 + type: string + tplCategory: + type: string + tree: + type: boolean + treeCode: + type: string + treeName: + type: string + treeParentCode: + type: string + updateBy: + type: integer + updatedAt: + type: string + type: object info: contact: {} + description: |- + 基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档 + 添加qq群: 521386980 进入技术交流群 请先star,谢谢! + license: + name: MIT + url: https://github.com/go-admin-team/go-admin/blob/master/LICENSE.md + title: go-admin API + version: 2.0.0 paths: /api/v1/app-config: get: @@ -917,6 +1103,54 @@ paths: summary: 获取验证码 tags: - 登陆 + /api/v1/db/columns/page: + get: + description: 数据库表列分页列表 / database table column page list + parameters: + - description: tableName / 数据表名称 + in: query + name: tableName + type: string + - description: pageSize / 页条数 + in: query + name: pageSize + type: integer + - description: pageIndex / 页码 + in: query + name: pageIndex + type: integer + responses: + "200": + description: '{"code": 200, "data": [...]}' + schema: + $ref: '#/definitions/response.Response' + summary: 分页列表数据 / page list data + tags: + - 工具 / 生成工具 + /api/v1/db/tables/page: + get: + description: 数据库表分页列表 / database table page list + parameters: + - description: tableName / 数据表名称 + in: query + name: tableName + type: string + - description: pageSize / 页条数 + in: query + name: pageSize + type: integer + - description: pageIndex / 页码 + in: query + name: pageIndex + type: integer + responses: + "200": + description: '{"code": 200, "data": [...]}' + schema: + $ref: '#/definitions/response.Response' + summary: 分页列表数据 / page list data + tags: + - 工具 / 生成工具 /api/v1/dept: delete: description: 删除数据 @@ -1595,6 +1829,32 @@ paths: summary: 获取岗位信息 tags: - 岗位 + /api/v1/public/uploadFile: + post: + consumes: + - multipart/form-data + description: 获取JSON + parameters: + - description: type + in: query + name: type + required: true + type: string + - description: file + in: formData + name: file + required: true + type: file + responses: + "200": + description: '{"code": -1, "message": "添加失败"}' + schema: + type: string + security: + - Bearer: [] + summary: 上传图片 + tags: + - 公共接口 /api/v1/role: delete: description: 删除数据 @@ -1730,6 +1990,19 @@ paths: summary: 修改用户角色 tags: - 角色/Role + /api/v1/server-monitor: + get: + description: 获取JSON + responses: + "200": + description: '{"code": 200, "data": [...]}' + schema: + $ref: '#/definitions/response.Response' + security: + - Bearer: [] + summary: 系统信息 + tags: + - 系统信息 /api/v1/set-config: get: consumes: @@ -2277,6 +2550,106 @@ paths: summary: 修改用户数据 tags: - 用户 + /api/v1/sys/tables/info: + post: + consumes: + - application/json + description: 添加表结构 + parameters: + - description: tableName / 数据表名称 + in: query + name: tables + type: string + responses: + "200": + description: '{"code": -1, "message": "添加失败"}' + schema: + type: string + security: + - Bearer: [] + summary: 添加表结构 + tags: + - 工具 / 生成工具 + put: + consumes: + - application/json + description: 修改表结构 + parameters: + - description: body + in: body + name: data + required: true + schema: + $ref: '#/definitions/tools.SysTables' + responses: + "200": + description: '{"code": -1, "message": "添加失败"}' + schema: + type: string + security: + - Bearer: [] + summary: 修改表结构 + tags: + - 工具 / 生成工具 + /api/v1/sys/tables/info/{tableId}: + delete: + description: 删除表结构 + parameters: + - description: tableId + in: path + name: tableId + required: true + type: integer + responses: + "200": + description: '{"code": -1, "message": "删除失败"}' + schema: + type: string + summary: 删除表结构 + tags: + - 工具 / 生成工具 + get: + description: 获取JSON + parameters: + - description: configKey + in: path + name: configKey + required: true + type: integer + responses: + "200": + description: '{"code": 200, "data": [...]}' + schema: + $ref: '#/definitions/response.Response' + security: + - Bearer: [] + summary: 获取配置 + tags: + - 工具 / 生成工具 + /api/v1/sys/tables/page: + get: + description: 生成表分页列表 + parameters: + - description: tableName / 数据表名称 + in: query + name: tableName + type: string + - description: pageSize / 页条数 + in: query + name: pageSize + type: integer + - description: pageIndex / 页码 + in: query + name: pageIndex + type: integer + responses: + "200": + description: '{"code": 200, "data": [...]}' + schema: + $ref: '#/definitions/response.Response' + summary: 分页列表数据 + tags: + - 工具 / 生成工具 /api/v1/user/avatar: post: consumes: @@ -2390,4 +2763,9 @@ paths: security: - Bearer: [] summary: 退出登录 +securityDefinitions: + Bearer: + in: header + name: Authorization + type: apiKey swagger: "2.0" diff --git a/main.go b/main.go index d41f30d2d..e25407e27 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,7 @@ import ( "go-admin/cmd" ) -//go:generate swag init --parseDependency --parseDepth=6 +//go:generate swag init --parseDependency --parseDepth=6 --instanceName admin -o ./docs/admin // @title go-admin API // @version 2.0.0 From ce0b5ff7bf1731c0733ea782b83d5f297636dff9 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 1 Aug 2023 22:08:43 +0800 Subject: [PATCH 183/238] =?UTF-8?q?perf=F0=9F=91=8C:=20update=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 47a81c9c0..2a3633921 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/bitly/go-simplejson v0.5.0 github.com/bytedance/go-tagexpr/v2 v2.7.12 github.com/casbin/casbin/v2 v2.51.2 - github.com/gin-gonic/gin v1.7.7 + github.com/gin-gonic/gin v1.9.1 github.com/go-admin-team/go-admin-core v1.4.1-0.20220809101213-21187928f7d9 github.com/go-admin-team/go-admin-core/sdk v1.4.1-0.20220809101213-21187928f7d9 github.com/google/uuid v1.3.0 @@ -26,7 +26,7 @@ require ( github.com/swaggo/gin-swagger v1.5.0 github.com/swaggo/swag v1.8.3 github.com/unrolled/secure v1.0.8 - golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 + golang.org/x/crypto v0.9.0 gorm.io/driver/mysql v1.3.5 gorm.io/driver/postgres v1.3.8 gorm.io/driver/sqlite v1.3.6 @@ -62,9 +62,9 @@ require ( github.com/go-openapi/jsonreference v0.19.6 // indirect github.com/go-openapi/spec v0.20.4 // indirect github.com/go-openapi/swag v0.19.15 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.8.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/go-redis/redis/v7 v7.4.0 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect @@ -72,7 +72,7 @@ require ( github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect - github.com/golang/protobuf v1.4.3 // indirect + github.com/golang/protobuf v1.5.0 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/henrylee2cn/ameda v1.4.10 // indirect @@ -90,19 +90,19 @@ require ( github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.11 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/leodido/go-urn v1.2.1 // indirect + github.com/leodido/go-urn v1.2.4 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/mattn/go-colorable v0.1.7 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-sqlite3 v1.14.12 // indirect github.com/mattn/goveralls v0.0.2 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mojocn/base64Captcha v1.3.1 // indirect github.com/nsqio/go-nsq v1.0.8 // indirect github.com/nyaruka/phonenumbers v1.0.55 // indirect @@ -119,21 +119,21 @@ require ( github.com/tklauser/go-sysconf v0.3.9 // indirect github.com/tklauser/numcpus v0.3.0 // indirect github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df // indirect - github.com/ugorji/go/codec v1.1.7 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect github.com/urfave/cli v1.22.1 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.uber.org/atomic v1.6.0 // indirect go.uber.org/multierr v1.5.0 // indirect go.uber.org/zap v1.15.0 // indirect - golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect + golang.org/x/image v0.1.0 // indirect golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - golang.org/x/tools v0.1.12 // indirect - google.golang.org/protobuf v1.26.0-rc.1 // indirect + golang.org/x/tools v0.6.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/AlecAivazis/survey.v1 v1.8.5 // indirect gopkg.in/kyokomi/emoji.v1 v1.5.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect From eae97f7a15f53684dc90009707587e7966defbb4 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 1 Aug 2023 22:08:47 +0800 Subject: [PATCH 184/238] =?UTF-8?q?perf=F0=9F=91=8C:=20update=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index 6f40ad99e..294345125 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.1.0" + Version = "2.1.1" ) var ( From 69df1b3d3459f0201a0fff860f3da9a0bf515715 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 1 Aug 2023 22:12:18 +0800 Subject: [PATCH 185/238] =?UTF-8?q?perf=F0=9F=91=8C:=20Remove=20unused=20a?= =?UTF-8?q?ttributes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/global/adm.go b/common/global/adm.go index 294345125..1f5254d8e 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -6,7 +6,6 @@ const ( ) var ( - Source string + // Driver 数据库驱动 Driver string - DBName string ) From 37a5963cd64d26e46cf4eff676739faf97962dcb Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 1 Aug 2023 22:38:41 +0800 Subject: [PATCH 186/238] =?UTF-8?q?perf=F0=9F=91=8C:=20Optimize=20go=20war?= =?UTF-8?q?nings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/issue-labeled.yml | 4 +-- .gitignore | 1 - README.md | 2 +- app/admin/apis/go_admin.go | 2 +- app/admin/models/casbin_rule.go | 1 - app/admin/models/initdb.go | 2 +- app/admin/models/sys_api.go | 6 ++--- app/admin/models/sys_config.go | 2 +- app/admin/models/sys_dept.go | 4 +-- app/admin/models/sys_dict_data.go | 2 +- app/admin/models/sys_dict_type.go | 2 +- app/admin/models/sys_login_log.go | 2 +- app/admin/models/sys_menu.go | 2 +- app/admin/models/sys_opera_log.go | 2 +- app/admin/models/sys_post.go | 4 +-- app/admin/models/sys_role.go | 2 +- app/admin/models/sys_user.go | 4 +-- app/admin/router/router.go | 3 +-- app/admin/service/sys_dept.go | 2 +- app/jobs/examples.go | 4 ++- app/jobs/jobbase.go | 22 ++++++++--------- app/jobs/models/sys_job.go | 4 +-- app/jobs/type.go | 4 +-- app/other/apis/file.go | 4 +-- app/other/apis/sys_server_monitor.go | 27 ++++++++++----------- app/other/apis/tools/db_columns.go | 2 +- app/other/apis/tools/db_tables.go | 2 +- app/other/models/tools/sys_columns.go | 2 +- app/other/models/tools/sys_tables.go | 2 +- cmd/api/server.go | 10 ++++---- cmd/migrate/migration/models/casbin_rule.go | 2 +- cmd/migrate/migration/models/role_dept.go | 1 - cmd/migrate/migration/models/sys_user.go | 2 +- common/apis/api.go | 14 +++++------ common/database/open.go | 1 - common/ip.go | 6 ++--- common/middleware/handler/auth.go | 4 +-- common/middleware/handler/user.go | 2 +- common/middleware/trace.go | 2 +- common/response/binding.go | 2 +- 41 files changed, 83 insertions(+), 87 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 48e8d022c..049421b9e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -62,5 +62,5 @@ Describe changes from the user side, and list all potential break changes or oth - [ ] Doc is updated/provided or not needed - [ ] Demo is updated/provided or not needed -- [ ] TypeScript definition is updated/provided or not needed +- [ ] TypeScript's definition is updated/provided or not needed - [ ] Changelog is provided or not needed diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index ce93c035a..5211d3e9b 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -46,8 +46,8 @@ jobs: token: ${{ secrets.ADMIN_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | - Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please [don't ask usage questions](https://github.com/ant-design/ant-design/issues/2320) here. You can try to open a new discussion in [antd discussions](https://github.com/ant-design/ant-design/discussions), select `Q&A` to ask questions, also can ask questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) or [Segment Fault](https://segmentfault.com/t/antd), then apply tag `antd` and `react` to your question. - 你好 @${{ github.event.issue.user.login }},go-admin Issue 板块是用于 bug 反馈与需求讨论的地方。请[勿询问如何使用的问题](https://github.com/go-admin-te/ant-design/issues/699),你可以试着在 [antd discussions](https://github.com/ant-design/ant-design/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问,也可以在 [Stack Overflow](http://stackoverflow.com/questions/tagged/antd) 或者 [Segment Fault](https://segmentfault.com/t/antd) 中提问(记得添加 `antd` 和 `react` 标签哦~)。 + Hello @${{ github.event.issue.user.login }}, we use GitHub issues to trace bugs or discuss plans of Ant Design. So, please [don't ask usage questions](https://github.com/ant-design/ant-design/issues/2320) here. You can try to open a new discussion in [antd discussions](https://github.com/ant-design/ant-design/discussions), select `Q&A` to ask questions, also can ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/antd) or [Segment Fault](https://segmentfault.com/t/antd), then apply tag `antd` and `react` to your question. + 你好 @${{ github.event.issue.user.login }},go-admin Issue 板块是用于 bug 反馈与需求讨论的地方。请[勿询问如何使用的问题](https://github.com/go-admin-te/ant-design/issues/699),你可以试着在 [antd discussions](https://github.com/ant-design/ant-design/discussions) 新开一个 discussion,选择 `Q&A` 类别进行提问,也可以在 [Stack Overflow](https://stackoverflow.com/questions/tagged/antd) 或者 [Segment Fault](https://segmentfault.com/t/antd) 中提问(记得添加 `antd` 和 `react` 标签哦~)。 - name: 3.x if: github.event.label.name == '3.x' uses: actions-cool/issues-helper@v3 diff --git a/.gitignore b/.gitignore index 4cc42051b..24cb16d50 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,6 @@ config/settings.dev.yml.log config/settings.b.dev.yml cmd/migrate/migration/version-local/* !cmd/migrate/migration/version-local/doc.go -*/.DS_Store # go sum go.sum diff --git a/README.md b/README.md index 5660f6230..52afc9c05 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ vi ./config/settings.yml # 2. Confirm the log path ``` -:::tip ⚠️Note that this problem will occur if CGO is not installed in the windows environment; +:::tip ⚠️Note that this problem will occur if CGO is not installed in the windows10+ environment; ```bash E:\go-admin>go build diff --git a/app/admin/apis/go_admin.go b/app/admin/apis/go_admin.go index 6fa8a1624..14a06dc3b 100644 --- a/app/admin/apis/go_admin.go +++ b/app/admin/apis/go_admin.go @@ -17,7 +17,7 @@ body{ overflow-y:hidden } - + - + ` From 4b477b3103445a1d1595d39730335efc1e3c2256 Mon Sep 17 00:00:00 2001 From: pigwantacat <79680042+pigwantacat@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:14:30 +0800 Subject: [PATCH 217/238] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E7=9A=84=E6=97=A5=E5=BF=97=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/jobbase.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/jobbase.go b/app/jobs/jobbase.go index 5993b3c87..ea6fe3df3 100644 --- a/app/jobs/jobbase.go +++ b/app/jobs/jobbase.go @@ -59,7 +59,7 @@ func (e *ExecJob) Run() { //TODO: 待完善部分 //str := time.Now().Format(timeFormat) + " [INFO] JobCore " + string(e.EntryId) + "exec success , spend :" + latencyTime.String() //ws.SendAll(str) - log.Info("[Job] JobCore %s exec success , spend :%v", e.Name, latencyTime) + log.Infof("[Job] JobCore %s exec success , spend :%v", e.Name, latencyTime) return } From 3ab67dfa7de396b6a33b1f7d0ade58d7879f31ba Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 24 Mar 2025 20:53:09 +0800 Subject: [PATCH 218/238] chore: update Go version from 1.21 to 1.24 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4904d0981..52e3de3a0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module go-admin -go 1.21 +go 1.24 require ( github.com/alibaba/sentinel-golang v1.0.4 From 84721265ddc87f7454d15032b99c114b56e2605a Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Mon, 24 Mar 2025 22:41:02 +0800 Subject: [PATCH 219/238] fix: simplify error handling in GenerateCaptchaHandler --- app/admin/apis/captcha.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/admin/apis/captcha.go b/app/admin/apis/captcha.go index f5bccace9..bd918a927 100644 --- a/app/admin/apis/captcha.go +++ b/app/admin/apis/captcha.go @@ -17,8 +17,7 @@ type System struct { // @Success 200 {object} response.Response{data=string,id=string,msg=string} "{"code": 200, "data": [...]}" // @Router /api/v1/captcha [get] func (e System) GenerateCaptchaHandler(c *gin.Context) { - err := e.MakeContext(c).Errors - if err != nil { + if err := e.MakeContext(c).Errors; err != nil { e.Error(500, err, "服务初始化失败!") return } From 937775e2a78bcde84826fb992d49fbbe0897affd Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 25 Mar 2025 08:53:39 +0800 Subject: [PATCH 220/238] chore: update Go version from 1.21 to 1.24 in build configuration --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93f860f6d..4825dddaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.21 + go-version: 1.24 - name: Tidy run: go mod tidy From 9540fdfc30755103585806a578be7e0442d1f6fa Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 25 Mar 2025 16:44:31 +0800 Subject: [PATCH 221/238] refactor: remove unused GetMenuIDS function and clean up code --- app/admin/apis/sys_menu.go | 42 ++------------------------------------ 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/app/admin/apis/sys_menu.go b/app/admin/apis/sys_menu.go index d6eab24d0..36fa29eeb 100644 --- a/app/admin/apis/sys_menu.go +++ b/app/admin/apis/sys_menu.go @@ -202,44 +202,6 @@ func (e SysMenu) GetMenuRole(c *gin.Context) { e.OK(result, "") } -//// GetMenuIDS 获取角色对应的菜单id数组 -//// @Summary 获取角色对应的菜单id数组,设置角色权限使用 -//// @Description 获取JSON -//// @Tags 菜单 -//// @Param id path int true "id" -//// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" -//// @Router /api/v1/menuids/{id} [get] -//// @Security Bearer -//func (e SysMenu) GetMenuIDS(c *gin.Context) { -// s := new(service.SysMenu) -// r := service.SysRole{} -// m := dto.SysRoleByName{} -// err := e.MakeContext(c). -// MakeOrm(). -// Bind(&m, binding.JSON). -// MakeService(&s.Service). -// MakeService(&r.Service). -// Errors -// if err != nil { -// e.Logger.Error(err) -// e.Error(500, err, err.Error()) -// return -// } -// var data models.SysRole -// err = r.GetWithName(&m, &data).Error -// -// //data.RoleName = c.GetString("role") -// //data.UpdateBy = user.GetUserId(c) -// //result, err := data.GetIDS(s.Orm) -// -// if err != nil { -// e.Logger.Errorf("GetIDS error, %s", err.Error()) -// e.Error(500, err, "获取失败") -// return -// } -// e.OK(result, "") -//} - // GetMenuTreeSelect 根据角色ID查询菜单下拉树结构 // @Summary 角色修改使用的菜单列表 // @Description 获取JSON @@ -253,7 +215,7 @@ func (e SysMenu) GetMenuRole(c *gin.Context) { func (e SysMenu) GetMenuTreeSelect(c *gin.Context) { m := service.SysMenu{} r := service.SysRole{} - req :=dto.SelectRole{} + req := dto.SelectRole{} err := e.MakeContext(c). MakeOrm(). MakeService(&m.Service). @@ -284,4 +246,4 @@ func (e SysMenu) GetMenuTreeSelect(c *gin.Context) { "menus": result, "checkedKeys": menuIds, }, "获取成功") -} \ No newline at end of file +} From 54dd3de5b690477c05c82f9fa5c09d75b3829408 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 25 Mar 2025 16:48:47 +0800 Subject: [PATCH 222/238] chore: update dependencies in go.mod to latest versions --- go.mod | 108 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 51 deletions(-) diff --git a/go.mod b/go.mod index 52e3de3a0..cb36365ca 100644 --- a/go.mod +++ b/go.mod @@ -4,65 +4,69 @@ go 1.24 require ( github.com/alibaba/sentinel-golang v1.0.4 - github.com/alibaba/sentinel-golang/pkg/adapters/gin v0.0.0-20230626085943-08071855bc67 - github.com/aliyun/aliyun-oss-go-sdk v3.0.1+incompatible + github.com/alibaba/sentinel-golang/pkg/adapters/gin v0.0.0-20241224061304-f4c2c5964666 + github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible github.com/bitly/go-simplejson v0.5.1 github.com/bytedance/go-tagexpr/v2 v2.9.11 - github.com/casbin/casbin/v2 v2.77.2 - github.com/gin-gonic/gin v1.9.1 + github.com/casbin/casbin/v2 v2.104.0 + github.com/gin-gonic/gin v1.10.0 github.com/go-admin-team/go-admin-core v1.5.2-0.20231103105356-84418ed9252c github.com/go-admin-team/go-admin-core/sdk v1.5.2-0.20231103105356-84418ed9252c - github.com/google/uuid v1.4.0 - github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.9+incompatible + github.com/google/uuid v1.6.0 + github.com/huaweicloud/huaweicloud-sdk-go-obs v3.24.9+incompatible github.com/mssola/user_agent v0.6.0 github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.17.0 - github.com/qiniu/go-sdk/v7 v7.18.2 + github.com/prometheus/client_golang v1.21.1 + github.com/qiniu/go-sdk/v7 v7.25.2 github.com/robfig/cron/v3 v3.0.1 - github.com/shirou/gopsutil/v3 v3.23.10 - github.com/spf13/cobra v1.7.0 + github.com/shirou/gopsutil/v3 v3.24.5 + github.com/spf13/cobra v1.9.1 github.com/swaggo/files v1.0.1 github.com/swaggo/gin-swagger v1.6.0 github.com/swaggo/swag v1.16.2 github.com/unrolled/secure v1.13.0 - golang.org/x/crypto v0.23.0 - gorm.io/driver/mysql v1.5.2 - gorm.io/driver/postgres v1.5.4 - gorm.io/driver/sqlite v1.5.4 - gorm.io/driver/sqlserver v1.5.2 - gorm.io/gorm v1.25.5 + golang.org/x/crypto v0.31.0 + gorm.io/driver/mysql v1.5.7 + gorm.io/driver/postgres v1.5.11 + gorm.io/driver/sqlite v1.5.7 + gorm.io/driver/sqlserver v1.5.4 + gorm.io/gorm v1.25.12 ) require ( - dario.cat/mergo v1.0.0 // indirect + dario.cat/mergo v1.0.1 // indirect github.com/AlecAivazis/survey/v2 v2.3.6 // indirect github.com/BurntSushi/toml v1.3.2 // indirect - github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect github.com/KyleBanks/depth v1.2.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 // indirect github.com/andeya/ameda v1.5.3 // indirect github.com/andeya/goutil v1.0.1 // indirect github.com/andygrunwald/go-jira v1.16.0 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect github.com/bsm/redislock v0.9.4 // indirect - github.com/bytedance/sonic v1.10.2 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/bytedance/sonic v1.11.6 // indirect + github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/casbin/govaluate v1.3.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chanxuehong/rand v0.0.0-20211009035549-2f07823e8e99 // indirect github.com/chanxuehong/wechat v0.0.0-20230222024006-36f0325263cd // indirect - github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect - github.com/chenzhuoyu/iasm v0.9.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.15.0 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gammazero/toposort v0.1.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/git-chglog/git-chglog v0.15.4 // indirect @@ -77,10 +81,12 @@ require ( github.com/go-openapi/swag v0.19.15 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.15.5 // indirect + github.com/go-playground/validator/v10 v10.20.0 // indirect github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/goccy/go-json v0.10.2 // indirect + github.com/gofrs/flock v0.8.1 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang-jwt/jwt/v5 v5.2.2 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect @@ -92,72 +98,72 @@ require ( github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/pgx/v5 v5.4.3 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/pgx/v5 v5.5.5 // indirect + github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/kyokomi/emoji/v2 v2.2.11 // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/leodido/go-urn v1.4.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-sqlite3 v1.14.17 // indirect + github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/mattn/goveralls v0.0.12 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect - github.com/microsoft/go-mssqldb v1.6.0 // indirect + github.com/microsoft/go-mssqldb v1.7.2 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mojocn/base64Captcha v1.3.5 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nsqio/go-nsq v1.1.0 // indirect github.com/nyaruka/phonenumbers v1.0.55 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.62.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/redis/go-redis/v9 v9.3.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/shamsher31/goimgext v1.0.0 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/shopspring/decimal v1.2.0 // indirect github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/tidwall/gjson v1.14.4 // indirect - github.com/tidwall/match v1.1.1 // indirect - github.com/tidwall/pretty v1.2.0 // indirect + github.com/spf13/pflag v1.0.6 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/trivago/tgo v1.0.7 // indirect github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect github.com/urfave/cli/v2 v2.24.3 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/multierr v1.10.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/arch v0.3.0 // indirect + golang.org/x/arch v0.8.0 // indirect golang.org/x/image v0.13.0 // indirect - golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - golang.org/x/tools v0.8.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gorm.io/plugin/dbresolver v1.4.7 // indirect + modernc.org/fileutil v1.0.0 // indirect ) //replace ( From 5bbd919745daafc27c0e2b0230590248ac784cf4 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 25 Mar 2025 17:16:40 +0800 Subject: [PATCH 223/238] chore: update dependencies in go.mod to latest versions --- go.mod | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index cb36365ca..a1fb46a4e 100644 --- a/go.mod +++ b/go.mod @@ -24,9 +24,9 @@ require ( github.com/spf13/cobra v1.9.1 github.com/swaggo/files v1.0.1 github.com/swaggo/gin-swagger v1.6.0 - github.com/swaggo/swag v1.16.2 - github.com/unrolled/secure v1.13.0 - golang.org/x/crypto v0.31.0 + github.com/swaggo/swag v1.16.4 + github.com/unrolled/secure v1.17.0 + golang.org/x/crypto v0.36.0 gorm.io/driver/mysql v1.5.7 gorm.io/driver/postgres v1.5.11 gorm.io/driver/sqlite v1.5.7 @@ -153,16 +153,16 @@ require ( golang.org/x/image v0.13.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect - golang.org/x/text v0.21.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/term v0.30.0 // indirect + golang.org/x/text v0.23.0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/protobuf v1.36.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gorm.io/plugin/dbresolver v1.4.7 // indirect + gorm.io/plugin/dbresolver v1.5.3 // indirect modernc.org/fileutil v1.0.0 // indirect ) From 44002fcb118db06bdd9027ccb2514a46ac9d91ad Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 25 Mar 2025 17:16:40 +0800 Subject: [PATCH 224/238] chore: update dependencies in go.mod to latest versions --- go.mod | 135 +++++++++++++++++++++++---------------------------------- 1 file changed, 54 insertions(+), 81 deletions(-) diff --git a/go.mod b/go.mod index cb36365ca..e1a2ff46f 100644 --- a/go.mod +++ b/go.mod @@ -10,23 +10,23 @@ require ( github.com/bytedance/go-tagexpr/v2 v2.9.11 github.com/casbin/casbin/v2 v2.104.0 github.com/gin-gonic/gin v1.10.0 - github.com/go-admin-team/go-admin-core v1.5.2-0.20231103105356-84418ed9252c - github.com/go-admin-team/go-admin-core/sdk v1.5.2-0.20231103105356-84418ed9252c + github.com/go-admin-team/go-admin-core v1.5.3-rc.3.0.20250408121721-2763de5dcdf4 + github.com/go-admin-team/go-admin-core/sdk v1.5.3-rc.3.0.20250408121721-2763de5dcdf4 github.com/google/uuid v1.6.0 github.com/huaweicloud/huaweicloud-sdk-go-obs v3.24.9+incompatible github.com/mssola/user_agent v0.6.0 github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.21.1 - github.com/qiniu/go-sdk/v7 v7.25.2 + github.com/prometheus/client_golang v1.22.0 + github.com/qiniu/go-sdk/v7 v7.25.3 github.com/robfig/cron/v3 v3.0.1 github.com/shirou/gopsutil/v3 v3.24.5 github.com/spf13/cobra v1.9.1 github.com/swaggo/files v1.0.1 github.com/swaggo/gin-swagger v1.6.0 - github.com/swaggo/swag v1.16.2 - github.com/unrolled/secure v1.13.0 - golang.org/x/crypto v0.31.0 + github.com/swaggo/swag v1.16.4 + github.com/unrolled/secure v1.17.0 + golang.org/x/crypto v0.37.0 gorm.io/driver/mysql v1.5.7 gorm.io/driver/postgres v1.5.11 gorm.io/driver/sqlite v1.5.7 @@ -35,45 +35,33 @@ require ( ) require ( - dario.cat/mergo v1.0.1 // indirect - github.com/AlecAivazis/survey/v2 v2.3.6 // indirect - github.com/BurntSushi/toml v1.3.2 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/BurntSushi/toml v1.5.0 // indirect github.com/KyleBanks/depth v1.2.1 // indirect - github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect - github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 // indirect github.com/andeya/ameda v1.5.3 // indirect github.com/andeya/goutil v1.0.1 // indirect - github.com/andygrunwald/go-jira v1.16.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect - github.com/bsm/redislock v0.9.4 // indirect - github.com/bytedance/sonic v1.11.6 // indirect - github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/bmatcuk/doublestar/v4 v4.8.1 // indirect + github.com/bytedance/sonic v1.13.2 // indirect + github.com/bytedance/sonic/loader v0.2.4 // indirect + github.com/casbin/gorm-adapter/v3 v3.32.0 // indirect github.com/casbin/govaluate v1.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chanxuehong/rand v0.0.0-20211009035549-2f07823e8e99 // indirect github.com/chanxuehong/wechat v0.0.0-20230222024006-36f0325263cd // indirect - github.com/cloudwego/base64x v0.1.4 // indirect - github.com/cloudwego/iasm v0.2.0 // indirect - github.com/coreos/go-semver v0.3.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/fatih/color v1.15.0 // indirect - github.com/fatih/structs v1.1.0 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/cloudwego/base64x v0.1.5 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/fsnotify/fsnotify v1.9.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.8 // indirect github.com/gammazero/toposort v0.1.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/git-chglog/git-chglog v0.15.4 // indirect - github.com/go-admin-team/go-admin-core/plugins/logger/zap v1.3.5-rc.0.0.20231103105142-2d9e40ec6f71 // indirect - github.com/go-admin-team/gorm-adapter/v3 v3.7.8-0.20220809100335-eaf9f67b3d21 // indirect - github.com/go-admin-team/redis-watcher/v2 v2.0.0-20231102130416-bfe327cac940 // indirect - github.com/go-admin-team/redisqueue/v2 v2.0.1-0.20231102124201-508101cc789a // indirect + github.com/gin-contrib/sse v1.1.0 // indirect + github.com/glebarez/go-sqlite v1.22.0 // indirect + github.com/glebarez/sqlite v1.11.0 // indirect + github.com/go-admin-team/go-admin-core/plugins/logger/zap v1.5.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.6 // indirect @@ -81,92 +69,77 @@ require ( github.com/go-openapi/swag v0.19.15 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.20.0 // indirect - github.com/go-sql-driver/mysql v1.7.0 // indirect - github.com/goccy/go-json v0.10.2 // indirect + github.com/go-playground/validator/v10 v10.26.0 // indirect + github.com/go-sql-driver/mysql v1.9.2 // indirect + github.com/goccy/go-json v0.10.5 // indirect github.com/gofrs/flock v0.8.1 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang-jwt/jwt/v5 v5.2.2 // indirect github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/go-querystring v1.1.0 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/huandu/xstrings v1.3.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/pgx/v5 v5.5.5 // indirect - github.com/jackc/puddle/v2 v2.2.1 // indirect + github.com/jackc/pgx/v5 v5.7.4 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.17.11 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect - github.com/kyokomi/emoji/v2 v2.2.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/mailru/easyjson v0.7.6 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect - github.com/mattn/goveralls v0.0.12 // indirect - github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect - github.com/microsoft/go-mssqldb v1.7.2 // indirect - github.com/mitchellh/copystructure v1.0.0 // indirect - github.com/mitchellh/reflectwalk v1.0.0 // indirect + github.com/microsoft/go-mssqldb v1.8.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/mojocn/base64Captcha v1.3.5 // indirect + github.com/mojocn/base64Captcha v1.3.8 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nsqio/go-nsq v1.1.0 // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect github.com/nyaruka/phonenumbers v1.0.55 // indirect - github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect - github.com/redis/go-redis/v9 v9.3.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/shamsher31/goimgext v1.0.0 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shopspring/decimal v1.2.0 // indirect - github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/cast v1.7.1 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect - github.com/trivago/tgo v1.0.7 // indirect - github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.12 // indirect - github.com/urfave/cli/v2 v2.24.3 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.uber.org/multierr v1.10.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/arch v0.8.0 // indirect - golang.org/x/image v0.13.0 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect - golang.org/x/text v0.21.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/arch v0.16.0 // indirect + golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect + golang.org/x/image v0.26.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/text v0.24.0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/protobuf v1.36.1 // indirect + golang.org/x/tools v0.32.0 // indirect + google.golang.org/protobuf v1.36.6 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gorm.io/plugin/dbresolver v1.4.7 // indirect - modernc.org/fileutil v1.0.0 // indirect + gorm.io/plugin/dbresolver v1.5.3 // indirect + modernc.org/fileutil v1.3.0 // indirect + modernc.org/libc v1.62.1 // indirect + modernc.org/mathutil v1.7.1 // indirect + modernc.org/memory v1.9.1 // indirect + modernc.org/sqlite v1.37.0 // indirect ) //replace ( -// github.com/go-admin-team/go-admin-core v1.4.0 => ../../go-admin-core -// github.com/go-admin-team/go-admin-core/sdk v1.4.0 => ../../go-admin-core/sdk +// github.com/go-admin-team/go-admin-core v1.5.2-0.20231103105356-84418ed9252c => ../go-admin-core +// github.com/go-admin-team/go-admin-core/sdk v1.5.2-0.20231103105356-84418ed9252c => ../go-admin-core/sdk //) From 4ac68323da70aed0c4a10105aff7c6fade9ba98d Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 8 Apr 2025 20:23:23 +0800 Subject: [PATCH 225/238] fix: improve error logging in jobbase.go for better clarity --- app/jobs/jobbase.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jobs/jobbase.go b/app/jobs/jobbase.go index ea6fe3df3..2ec5d94fb 100644 --- a/app/jobs/jobbase.go +++ b/app/jobs/jobbase.go @@ -77,8 +77,8 @@ LOOP: str, err = pkg.Get(h.InvokeTarget) if err != nil { // 如果失败暂停一段时间重试 - fmt.Println(time.Now().Format(timeFormat), " [ERROR] mission failed! ", err) - fmt.Printf(time.Now().Format(timeFormat)+" [INFO] Retry after the task fails %d seconds! %s \n", (count+1)*5, str) + log.Warnf("[Job] mission failed! %v", err) + log.Warnf("[Job] Retry after the task fails %d seconds! %s \n", (count+1)*5, str) time.Sleep(time.Duration(count+1) * 5 * time.Second) count = count + 1 goto LOOP From db422785fc08933b7ead127d127d3c1a1d2f0aeb Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 8 Apr 2025 20:29:38 +0800 Subject: [PATCH 226/238] =?UTF-8?q?fix=F0=9F=90=9B:=20include=20captcha=20?= =?UTF-8?q?answer=20in=20GenerateCaptchaHandler=20for=20improved=20logging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/captcha.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/admin/apis/captcha.go b/app/admin/apis/captcha.go index bd918a927..e884e24a5 100644 --- a/app/admin/apis/captcha.go +++ b/app/admin/apis/captcha.go @@ -21,12 +21,13 @@ func (e System) GenerateCaptchaHandler(c *gin.Context) { e.Error(500, err, "服务初始化失败!") return } - id, b64s, err := captcha.DriverDigitFunc() + id, b64s, answer, err := captcha.DriverDigitFunc() if err != nil { e.Logger.Errorf("DriverDigitFunc error, %s", err.Error()) e.Error(500, err, "验证码获取失败") return } + e.Logger.Infof("DriverDigitFunc answer: %s", answer) e.Custom(gin.H{ "code": 200, "data": b64s, From afe5efbe36320a533b7f6d1de91eccadb67381bb Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 8 Apr 2025 20:30:05 +0800 Subject: [PATCH 227/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20remove=20unused?= =?UTF-8?q?=20distributed=20lock=20setup=20code=20in=20initialize.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/storage/initialize.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/common/storage/initialize.go b/common/storage/initialize.go index 6fa323dc9..0617af842 100644 --- a/common/storage/initialize.go +++ b/common/storage/initialize.go @@ -40,13 +40,4 @@ func Setup() { go queueAdapter.Run() }() } - - //7. 设置分布式锁 - if !config.LockerConfig.Empty() { - lockerAdapter, err := config.LockerConfig.Setup() - if err != nil { - log.Fatalf("locker setup error, %s\n", err.Error()) - } - sdk.Runtime.SetLockerAdapter(lockerAdapter) - } } From 54943532297ca398ab8877e90f42e38f55819baf Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 8 Apr 2025 20:30:24 +0800 Subject: [PATCH 228/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=AC=E5=9C=B0=E4=B8=BB=E6=9C=BAIP?= =?UTF-8?q?=E7=9A=84=E5=87=BD=E6=95=B0=E8=B0=83=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/other/apis/sys_server_monitor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/other/apis/sys_server_monitor.go b/app/other/apis/sys_server_monitor.go index 9423d9cd6..c5236db07 100644 --- a/app/other/apis/sys_server_monitor.go +++ b/app/other/apis/sys_server_monitor.go @@ -78,7 +78,7 @@ func (e ServerMonitor) ServerInfo(c *gin.Context) { osDic["compiler"] = runtime.Compiler osDic["version"] = runtime.Version() osDic["numGoroutine"] = runtime.NumGoroutine() - osDic["ip"] = pkg.GetLocaHonst() + osDic["ip"] = pkg.GetLocalHost() osDic["projectDir"] = pkg.GetCurrentPath() osDic["hostName"] = sysInfo.Hostname osDic["time"] = time.Now().Format("2006-01-02 15:04:05") From 76411f80bc2c5c56c4a84c7220958da412d7c1d6 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 8 Apr 2025 20:30:35 +0800 Subject: [PATCH 229/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=20log.Info=20?= =?UTF-8?q?=E6=9B=BF=E4=BB=A3=20log.Println?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/api/server.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/api/server.go b/cmd/api/server.go index e1cb0a932..3f922e8a2 100644 --- a/cmd/api/server.go +++ b/cmd/api/server.go @@ -3,8 +3,6 @@ package api import ( "context" "fmt" - "github.com/pkg/errors" - "log" "net/http" "os" "os/signal" @@ -12,10 +10,12 @@ import ( "github.com/gin-gonic/gin" "github.com/go-admin-team/go-admin-core/config/source/file" + log "github.com/go-admin-team/go-admin-core/logger" "github.com/go-admin-team/go-admin-core/sdk" "github.com/go-admin-team/go-admin-core/sdk/api" "github.com/go-admin-team/go-admin-core/sdk/config" "github.com/go-admin-team/go-admin-core/sdk/pkg" + "github.com/pkg/errors" "github.com/spf13/cobra" "go-admin/app/admin/models" @@ -73,7 +73,7 @@ func setup() { go queue.Run() usageStr := `starting api server...` - log.Println(usageStr) + log.Info(usageStr) } func run() error { @@ -104,12 +104,12 @@ func run() error { mp["List"] = routers message, err := sdk.Runtime.GetStreamMessage("", global.ApiCheck, mp) if err != nil { - log.Printf("GetStreamMessage error, %s \n", err.Error()) + log.Infof("GetStreamMessage error, %s \n", err.Error()) //日志报错错误,不中断请求 } else { err = q.Append(message) if err != nil { - log.Printf("Append message error, %s \n", err.Error()) + log.Infof("Append message error, %s \n", err.Error()) } } } @@ -130,10 +130,10 @@ func run() error { tip() fmt.Println(pkg.Green("Server run at:")) fmt.Printf("- Local: %s://localhost:%d/ \r\n", "http", config.ApplicationConfig.Port) - fmt.Printf("- Network: %s://%s:%d/ \r\n", "http", pkg.GetLocaHonst(), config.ApplicationConfig.Port) + fmt.Printf("- Network: %s://%s:%d/ \r\n", "http", pkg.GetLocalHost(), config.ApplicationConfig.Port) fmt.Println(pkg.Green("Swagger run at:")) fmt.Printf("- Local: http://localhost:%d/swagger/admin/index.html \r\n", config.ApplicationConfig.Port) - fmt.Printf("- Network: %s://%s:%d/swagger/admin/index.html \r\n", "http", pkg.GetLocaHonst(), config.ApplicationConfig.Port) + fmt.Printf("- Network: %s://%s:%d/swagger/admin/index.html \r\n", "http", pkg.GetLocalHost(), config.ApplicationConfig.Port) fmt.Printf("%s Enter Control + C Shutdown Server \r\n", pkg.GetCurrentTimeStr()) // 等待中断信号以优雅地关闭服务器(设置 5 秒的超时时间) quit := make(chan os.Signal, 1) @@ -142,12 +142,12 @@ func run() error { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() - fmt.Printf("%s Shutdown Server ... \r\n", pkg.GetCurrentTimeStr()) + log.Info("Shutdown Server ... ") if err := srv.Shutdown(ctx); err != nil { log.Fatal("Server Shutdown:", err) } - log.Println("Server exiting") + log.Info("Server exiting") return nil } From 364854eda0d5f0b3fe99dce80ebdf4bc1c5e4c51 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 8 Apr 2025 20:49:29 +0800 Subject: [PATCH 230/238] =?UTF-8?q?docs=F0=9F=93=9D:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20go-admin=20=E7=89=88=E6=9C=AC=E5=8F=B7=E8=87=B3=202.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/global/adm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/global/adm.go b/common/global/adm.go index 1344cac0f..6b19d7c6e 100644 --- a/common/global/adm.go +++ b/common/global/adm.go @@ -2,7 +2,7 @@ package global const ( // Version go-admin version info - Version = "2.1.2" + Version = "2.2.0" ) var ( From 8f8a197db1a50403d332519ad3caa743d65d5f1a Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Tue, 8 Apr 2025 20:49:36 +0800 Subject: [PATCH 231/238] =?UTF-8?q?delete=F0=9F=8E=89:=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E7=A4=BA=E4=BE=8B=E4=BB=A3=E7=A0=81=20run.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/run.go | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 examples/run.go diff --git a/examples/run.go b/examples/run.go deleted file mode 100644 index 2bb61e260..000000000 --- a/examples/run.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build examples - -package main - -import ( - "github.com/go-admin-team/go-admin-core/sdk" - "log" - - "github.com/gin-gonic/gin" - "gorm.io/gorm" - - myCasbin "github.com/go-admin-team/go-admin-core/sdk/pkg/casbin" - "gorm.io/driver/mysql" -) - -func main() { - db, err := gorm.Open(mysql.Open("root:123456@tcp/inmg?charset=utf8&parseTime=True&loc=Local"), &gorm.Config{}) - if err != nil { - panic(err) - } - syncEnforce := myCasbin.Setup(db, "sys_") - sdk.Runtime.SetDb("*", db) - sdk.Runtime.SetCasbin("*", syncEnforce) - - e := gin.Default() - sdk.Runtime.SetEngine(e) - log.Fatal(e.Run(":8000")) -} From e82128f67932e9b36009c11c63a454df4515be4d Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sun, 13 Apr 2025 22:00:04 +0800 Subject: [PATCH 232/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7=E7=AB=AF=20IP=20?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=20X-Forwarded-For=20=E5=92=8C=20X-Real-IP=20=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/ip.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/common/ip.go b/common/ip.go index bc4d9ef44..ec95a8b34 100644 --- a/common/ip.go +++ b/common/ip.go @@ -6,22 +6,23 @@ import ( ) func GetClientIP(c *gin.Context) string { - ClientIP := c.ClientIP() - //fmt.Println("ClientIP:", ClientIP) - RemoteIP := c.RemoteIP() - //fmt.Println("RemoteIP:", RemoteIP) + // 优先从 X-Forwarded-For 获取 IP ip := c.Request.Header.Get("X-Forwarded-For") - if strings.Contains(ip, "127.0.0.1") || ip == "" { + if ip == "" || strings.Contains(ip, "127.0.0.1") { + // 如果为空或为本地地址,则尝试从 X-Real-IP 获取 ip = c.Request.Header.Get("X-real-ip") } if ip == "" { - ip = "127.0.0.1" + // 如果仍为空,则使用 RemoteIP + ip = c.RemoteIP() } - if RemoteIP != "127.0.0.1" { - ip = RemoteIP + if ip == "" || ip == "127.0.0.1" { + // 如果仍为空或为本地地址,则使用 ClientIP + ip = c.ClientIP() } - if ClientIP != "127.0.0.1" { - ip = ClientIP + if ip == "" { + // 最后兜底为本地地址 + ip = "127.0.0.1" } return ip } From 762eba5af73001295ea66fbfc5d33acdbffb1e8f Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sun, 13 Apr 2025 22:04:12 +0800 Subject: [PATCH 233/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=20Setup=20=E5=87=BD=E6=95=B0=EF=BC=8C=E6=8B=86?= =?UTF-8?q?=E5=88=86=E4=B8=BA=E5=A4=9A=E4=B8=AA=E5=AD=90=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=BB=A5=E6=8F=90=E9=AB=98=E5=8F=AF=E8=AF=BB=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/storage/initialize.go | 47 +++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/common/storage/initialize.go b/common/storage/initialize.go index 0617af842..f1e6933c5 100644 --- a/common/storage/initialize.go +++ b/common/storage/initialize.go @@ -1,8 +1,8 @@ /* - * @Author: lwnmengjing - * @Date: 2021/6/10 3:39 下午 - * @Last Modified by: lwnmengjing - * @Last Modified time: 2021/6/10 3:39 下午 + * @Author: zhangwenjian + * @Date: 2025/04/13 22:03 + * @Last Modified by: zhangwenjian + * @Last Modified time: 2025/04/13 22:03 */ package storage @@ -17,27 +17,34 @@ import ( // Setup 配置storage组件 func Setup() { - //4. 设置缓存 + setupCache() + setupCaptcha() + setupQueue() +} + +func setupCache() { cacheAdapter, err := config.CacheConfig.Setup() if err != nil { log.Fatalf("cache setup error, %s\n", err.Error()) } sdk.Runtime.SetCacheAdapter(cacheAdapter) - //5. 设置验证码store - captcha.SetStore(captcha.NewCacheStore(cacheAdapter, 600)) +} + +func setupCaptcha() { + captcha.SetStore(captcha.NewCacheStore(sdk.Runtime.GetCacheAdapter(), 600)) +} - //6. 设置队列 - if !config.QueueConfig.Empty() { - if q := sdk.Runtime.GetQueueAdapter(); q != nil { - q.Shutdown() - } - queueAdapter, err := config.QueueConfig.Setup() - if err != nil { - log.Fatalf("queue setup error, %s\n", err.Error()) - } - sdk.Runtime.SetQueueAdapter(queueAdapter) - defer func() { - go queueAdapter.Run() - }() +func setupQueue() { + if config.QueueConfig.Empty() { + return + } + if q := sdk.Runtime.GetQueueAdapter(); q != nil { + q.Shutdown() + } + queueAdapter, err := config.QueueConfig.Setup() + if err != nil { + log.Fatalf("queue setup error, %s\n", err.Error()) } + sdk.Runtime.SetQueueAdapter(queueAdapter) + go queueAdapter.Run() } From 6b1e961a7f598c0746872d53b29de4bea4beef34 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sun, 13 Apr 2025 22:15:10 +0800 Subject: [PATCH 234/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E7=B3=BB=E7=BB=9F=E7=9B=91=E6=8E=A7=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E6=8B=86=E5=88=86=E5=8A=9F=E8=83=BD=E4=B8=BA=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E5=87=BD=E6=95=B0=E4=BB=A5=E6=8F=90=E9=AB=98=E5=8F=AF?= =?UTF-8?q?=E8=AF=BB=E6=80=A7=E5=92=8C=E7=BB=B4=E6=8A=A4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/other/apis/sys_server_monitor.go | 190 +++++++++++++-------------- 1 file changed, 94 insertions(+), 96 deletions(-) diff --git a/app/other/apis/sys_server_monitor.go b/app/other/apis/sys_server_monitor.go index c5236db07..95decc2e2 100644 --- a/app/other/apis/sys_server_monitor.go +++ b/app/other/apis/sys_server_monitor.go @@ -25,22 +25,9 @@ const ( GB = 1024 * MB ) -var ( - //Version string - //expectDiskFsTypes = []string{ - // "apfs", "ext4", "ext3", "ext2", "f2fs", "reiserfs", "jfs", "btrfs", - // "fuseblk", "zfs", "simfs", "ntfs", "fat32", "exfat", "xfs", "fuse.rclone", - //} - excludeNetInterfaces = []string{ - "lo", "tun", "docker", "veth", "br-", "vmbr", "vnet", "kube", - } - //getMacDiskNo = regexp.MustCompile(`\/dev\/disk(\d)s.*`) -) - -var ( - netInSpeed, netOutSpeed, netInTransfer, netOutTransfer, lastUpdateNetStats uint64 - cachedBootTime time.Time -) +var excludeNetInterfaces = []string{ + "lo", "tun", "docker", "veth", "br-", "vmbr", "vnet", "kube", +} type ServerMonitor struct { api.Api @@ -48,137 +35,148 @@ type ServerMonitor struct { // GetHourDiffer 获取相差时间 func GetHourDiffer(startTime, endTime string) int64 { - var hour int64 t1, err1 := time.ParseInLocation("2006-01-02 15:04:05", startTime, time.Local) t2, err2 := time.ParseInLocation("2006-01-02 15:04:05", endTime, time.Local) - if err1 == nil && err2 == nil && t1.Before(t2) { - diff := t2.Unix() - t1.Unix() // - hour = diff / 3600 - return hour - } else { - return hour + if err1 != nil || err2 != nil || !t1.Before(t2) { + return 0 } + return (t2.Unix() - t1.Unix()) / 3600 } // ServerInfo 获取系统信息 -// @Summary 系统信息 -// @Description 获取JSON -// @Tags 系统信息 -// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" -// @Router /api/v1/server-monitor [get] -// @Security Bearer func (e ServerMonitor) ServerInfo(c *gin.Context) { e.Context = c + osInfo := getOSInfo() + memInfo := getMemoryInfo() + swapInfo := getSwapInfo() + cpuInfo := getCPUInfo() + diskInfo := getDiskInfo() + netInfo := getNetworkInfo() + + bootTime, _ := host.BootTime() + cachedBootTime := time.Unix(int64(bootTime), 0) + + e.Custom(gin.H{ + "code": 200, + "os": osInfo, + "mem": memInfo, + "cpu": cpuInfo, + "disk": diskInfo, + "net": netInfo, + "swap": swapInfo, + "location": "Aliyun", + "bootTime": GetHourDiffer(cachedBootTime.Format("2006-01-02 15:04:05"), time.Now().Format("2006-01-02 15:04:05")), + }) +} + +func getOSInfo() map[string]interface{} { sysInfo, _ := host.Info() - osDic := make(map[string]interface{}, 0) - osDic["goOs"] = runtime.GOOS - osDic["arch"] = runtime.GOARCH - osDic["mem"] = runtime.MemProfileRate - osDic["compiler"] = runtime.Compiler - osDic["version"] = runtime.Version() - osDic["numGoroutine"] = runtime.NumGoroutine() - osDic["ip"] = pkg.GetLocalHost() - osDic["projectDir"] = pkg.GetCurrentPath() - osDic["hostName"] = sysInfo.Hostname - osDic["time"] = time.Now().Format("2006-01-02 15:04:05") + return map[string]interface{}{ + "goOs": runtime.GOOS, + "arch": runtime.GOARCH, + "mem": runtime.MemProfileRate, + "compiler": runtime.Compiler, + "version": runtime.Version(), + "numGoroutine": runtime.NumGoroutine(), + "ip": pkg.GetLocalHost(), + "projectDir": pkg.GetCurrentPath(), + "hostName": sysInfo.Hostname, + "time": time.Now().Format("2006-01-02 15:04:05"), + } +} +func getMemoryInfo() map[string]interface{} { memory, _ := mem.VirtualMemory() - memDic := make(map[string]interface{}, 0) - memDic["used"] = memory.Used / MB - memDic["total"] = memory.Total / MB - - fmt.Println("mem", int(memory.Total/memory.Used*100)) - memDic["percent"] = pkg.Round(memory.UsedPercent, 2) + return map[string]interface{}{ + "used": memory.Used / MB, + "total": memory.Total / MB, + "percent": pkg.Round(memory.UsedPercent, 2), + } +} - swapDic := make(map[string]interface{}, 0) - swapDic["used"] = memory.SwapTotal - memory.SwapFree - swapDic["total"] = memory.SwapTotal +func getSwapInfo() map[string]interface{} { + memory, _ := mem.VirtualMemory() + return map[string]interface{}{ + "used": memory.SwapTotal - memory.SwapFree, + "total": memory.SwapTotal, + } +} - cpuDic := make(map[string]interface{}, 0) - cpuDic["cpuInfo"], _ = cpu.Info() +func getCPUInfo() map[string]interface{} { + cpuInfo, _ := cpu.Info() percent, _ := cpu.Percent(0, false) - cpuDic["percent"] = pkg.Round(percent[0], 2) - cpuDic["cpuNum"], _ = cpu.Counts(false) + cpuNum, _ := cpu.Counts(false) + return map[string]interface{}{ + "cpuInfo": cpuInfo, + "percent": pkg.Round(percent[0], 2), + "cpuNum": cpuNum, + } +} - //服务器磁盘信息 - disklist := make([]disk.UsageStat, 0) - //所有分区 +func getDiskInfo() map[string]interface{} { var diskTotal, diskUsed, diskUsedPercent float64 + diskList := make([]disk.UsageStat, 0) + diskInfo, err := disk.Partitions(true) if err == nil { for _, p := range diskInfo { diskDetail, err := disk.Usage(p.Mountpoint) if err == nil { diskDetail.UsedPercent, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", diskDetail.UsedPercent), 64) - diskDetail.Total = diskDetail.Total / 1024 / 1024 - diskDetail.Used = diskDetail.Used / 1024 / 1024 - diskDetail.Free = diskDetail.Free / 1024 / 1024 - disklist = append(disklist, *diskDetail) - + diskDetail.Total /= MB + diskDetail.Used /= MB + diskDetail.Free /= MB + diskList = append(diskList, *diskDetail) } } } d, _ := disk.Usage("/") - diskTotal = float64(d.Total / GB) diskUsed = float64(d.Used / GB) diskUsedPercent, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", d.UsedPercent), 64) - diskDic := make(map[string]interface{}, 0) - diskDic["total"] = diskTotal - diskDic["used"] = diskUsed - diskDic["percent"] = diskUsedPercent - - bootTime, _ := host.BootTime() - cachedBootTime = time.Unix(int64(bootTime), 0) + return map[string]interface{}{ + "total": diskTotal, + "used": diskUsed, + "percent": diskUsedPercent, + } +} - TrackNetworkSpeed() - netDic := make(map[string]interface{}, 0) - netDic["in"] = pkg.Round(float64(netInSpeed/KB), 2) - netDic["out"] = pkg.Round(float64(netOutSpeed/KB), 2) - e.Custom(gin.H{ - "code": 200, - "os": osDic, - "mem": memDic, - "cpu": cpuDic, - "disk": diskDic, - "net": netDic, - "swap": swapDic, - "location": "Aliyun", - "bootTime": GetHourDiffer(cachedBootTime.Format("2006-01-02 15:04:05"), time.Now().Format("2006-01-02 15:04:05")), - }) +func getNetworkInfo() map[string]interface{} { + netInSpeed, netOutSpeed := trackNetworkSpeed() + return map[string]interface{}{ + "in": pkg.Round(float64(netInSpeed/KB), 2), + "out": pkg.Round(float64(netOutSpeed/KB), 2), + } } -func TrackNetworkSpeed() { - var innerNetInTransfer, innerNetOutTransfer uint64 +func trackNetworkSpeed() (uint64, uint64) { + var netInSpeed, netOutSpeed, netInTransfer, netOutTransfer, lastUpdateNetStats uint64 nc, err := net.IOCounters(true) if err == nil { for _, v := range nc { if isListContainsStr(excludeNetInterfaces, v.Name) { continue } - innerNetInTransfer += v.BytesRecv - innerNetOutTransfer += v.BytesSent + netInTransfer += v.BytesRecv + netOutTransfer += v.BytesSent } now := uint64(time.Now().Unix()) diff := now - lastUpdateNetStats if diff > 0 { - netInSpeed = (innerNetInTransfer - netInTransfer) / diff - fmt.Println("netInSpeed", netInSpeed) - netOutSpeed = (innerNetOutTransfer - netOutTransfer) / diff - fmt.Println("netOutSpeed", netOutSpeed) + netInSpeed = (netInTransfer - netInTransfer) / diff + netOutSpeed = (netOutTransfer - netOutTransfer) / diff } - netInTransfer = innerNetInTransfer - netOutTransfer = innerNetOutTransfer lastUpdateNetStats = now } + return netInSpeed, netOutSpeed } func isListContainsStr(list []string, str string) bool { - for i := 0; i < len(list); i++ { - if strings.Contains(str, list[i]) { + for _, item := range list { + if strings.Contains(str, item) { return true } } From 952cd92648fcff3daaa73ade2e36c3b094fde0a2 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sun, 13 Apr 2025 22:17:17 +0800 Subject: [PATCH 235/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E6=B8=85?= =?UTF-8?q?=E7=90=86=20sys=5Fserver=5Fmonitor.go=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E9=99=A4=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=B9=B6=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/other/apis/sys_server_monitor.go | 1 - 1 file changed, 1 deletion(-) diff --git a/app/other/apis/sys_server_monitor.go b/app/other/apis/sys_server_monitor.go index 95decc2e2..699b6337c 100644 --- a/app/other/apis/sys_server_monitor.go +++ b/app/other/apis/sys_server_monitor.go @@ -11,7 +11,6 @@ import ( "github.com/gin-gonic/gin" "github.com/go-admin-team/go-admin-core/sdk/api" "github.com/go-admin-team/go-admin-core/sdk/pkg" - _ "github.com/go-admin-team/go-admin-core/sdk/pkg/response" "github.com/shirou/gopsutil/v3/cpu" "github.com/shirou/gopsutil/v3/disk" "github.com/shirou/gopsutil/v3/host" From 817e34c6aaeac4f57ec66ec9c640eef9b5e4f866 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Sun, 13 Apr 2025 22:20:06 +0800 Subject: [PATCH 236/238] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E6=8B=86=E5=88=86=E5=A4=84=E7=90=86=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=BB=A5=E6=8F=90=E9=AB=98=E5=8F=AF=E8=AF=BB=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/other/apis/file.go | 155 ++++++++++++++++++++--------------------- 1 file changed, 74 insertions(+), 81 deletions(-) diff --git a/app/other/apis/file.go b/app/other/apis/file.go index e0d77f422..94d2ec76e 100644 --- a/app/other/apis/file.go +++ b/app/other/apis/file.go @@ -45,62 +45,60 @@ func (e File) UploadFile(c *gin.Context) { e.MakeContext(c) tag, _ := c.GetPostForm("type") urlPrefix := fmt.Sprintf("%s://%s/", "http", c.Request.Host) - var fileResponse FileResponse switch tag { case "1": // 单图 - var done bool - fileResponse, done = e.singleFile(c, fileResponse, urlPrefix) - if done { - return - } - e.OK(fileResponse, "上传成功") - return + e.handleSingleFile(c, urlPrefix) case "2": // 多图 - multipartFile := e.multipleFile(c, urlPrefix) - e.OK(multipartFile, "上传成功") - return + e.handleMultipleFiles(c, urlPrefix) case "3": // base64 - fileResponse = e.baseImg(c, fileResponse, urlPrefix) - e.OK(fileResponse, "上传成功") + e.handleBase64File(c, urlPrefix) default: - var done bool - fileResponse, done = e.singleFile(c, fileResponse, urlPrefix) - if done { - return - } - e.OK(fileResponse, "上传成功") + e.handleSingleFile(c, urlPrefix) + } +} + +func (e File) handleSingleFile(c *gin.Context, urlPrefix string) { + fileResponse, done := e.singleFile(c, FileResponse{}, urlPrefix) + if done { return } + e.OK(fileResponse, "上传成功") +} + +func (e File) handleMultipleFiles(c *gin.Context, urlPrefix string) { + multipartFile := e.multipleFile(c, urlPrefix) + e.OK(multipartFile, "上传成功") +} +func (e File) handleBase64File(c *gin.Context, urlPrefix string) { + fileResponse := e.baseImg(c, FileResponse{}, urlPrefix) + e.OK(fileResponse, "上传成功") } -func (e File) baseImg(c *gin.Context, fileResponse FileResponse, urlPerfix string) FileResponse { +func (e File) baseImg(c *gin.Context, fileResponse FileResponse, urlPrefix string) FileResponse { files, _ := c.GetPostForm("file") file2list := strings.Split(files, ",") - ddd, _ := base64.StdEncoding.DecodeString(file2list[1]) - guid := uuid.New().String() - fileName := guid + ".jpg" - err := utils.IsNotExistMkDir(path) - if err != nil { + decodedData, _ := base64.StdEncoding.DecodeString(file2list[1]) + fileName := uuid.New().String() + ".jpg" + + if err := utils.IsNotExistMkDir(path); err != nil { e.Error(500, errors.New(""), "初始化文件路径失败") + return fileResponse } + base64File := path + fileName - _ = ioutil.WriteFile(base64File, ddd, 0666) + _ = ioutil.WriteFile(base64File, decodedData, 0666) typeStr := strings.Replace(strings.Replace(file2list[0], "data:", "", -1), ";base64", "", -1) - fileResponse = FileResponse{ - Size: pkg.GetFileSize(base64File), - Path: base64File, - FullPath: urlPerfix + base64File, - Name: "", - Type: typeStr, - } + + fileResponse = e.buildFileResponse(base64File, urlPrefix, "", typeStr) source, _ := c.GetPostForm("source") - err = thirdUpload(source, fileName, base64File) - if err != nil { + + if err := thirdUpload(source, fileName, base64File); err != nil { e.Error(200, errors.New(""), "上传第三方失败") return fileResponse } + if source != "1" { fileResponse.Path = "/static/uploadfile/" + fileName fileResponse.FullPath = "/static/uploadfile/" + fileName @@ -108,81 +106,76 @@ func (e File) baseImg(c *gin.Context, fileResponse FileResponse, urlPerfix strin return fileResponse } -func (e File) multipleFile(c *gin.Context, urlPerfix string) []FileResponse { +func (e File) multipleFile(c *gin.Context, urlPrefix string) []FileResponse { files := c.Request.MultipartForm.File["file"] source, _ := c.GetPostForm("source") var multipartFile []FileResponse + for _, f := range files { - guid := uuid.New().String() - fileName := guid + utils.GetExt(f.Filename) + fileName := uuid.New().String() + utils.GetExt(f.Filename) - err := utils.IsNotExistMkDir(path) - if err != nil { + if err := utils.IsNotExistMkDir(path); err != nil { e.Error(500, errors.New(""), "初始化文件路径失败") + continue } + multipartFileName := path + fileName - err1 := c.SaveUploadedFile(f, multipartFileName) + if err := c.SaveUploadedFile(f, multipartFileName); err != nil { + continue + } + fileType, _ := utils.GetType(multipartFileName) - if err1 == nil { - err := thirdUpload(source, fileName, multipartFileName) - if err != nil { - e.Error(500, errors.New(""), "上传第三方失败") - } else { - fileResponse := FileResponse{ - Size: pkg.GetFileSize(multipartFileName), - Path: multipartFileName, - FullPath: urlPerfix + multipartFileName, - Name: f.Filename, - Type: fileType, - } - if source != "1" { - fileResponse.Path = "/static/uploadfile/" + fileName - fileResponse.FullPath = "/static/uploadfile/" + fileName - } - multipartFile = append(multipartFile, fileResponse) - } + if err := thirdUpload(source, fileName, multipartFileName); err != nil { + e.Error(500, errors.New(""), "上传第三方失败") + continue + } + + fileResponse := e.buildFileResponse(multipartFileName, urlPrefix, f.Filename, fileType) + if source != "1" { + fileResponse.Path = "/static/uploadfile/" + fileName + fileResponse.FullPath = "/static/uploadfile/" + fileName } + multipartFile = append(multipartFile, fileResponse) } return multipartFile } -func (e File) singleFile(c *gin.Context, fileResponse FileResponse, urlPerfix string) (FileResponse, bool) { +func (e File) singleFile(c *gin.Context, fileResponse FileResponse, urlPrefix string) (FileResponse, bool) { files, err := c.FormFile("file") - if err != nil { e.Error(200, errors.New(""), "图片不能为空") return FileResponse{}, true } - // 上传文件至指定目录 - guid := uuid.New().String() - - fileName := guid + utils.GetExt(files.Filename) - err = utils.IsNotExistMkDir(path) - if err != nil { + fileName := uuid.New().String() + utils.GetExt(files.Filename) + if err := utils.IsNotExistMkDir(path); err != nil { e.Error(500, errors.New(""), "初始化文件路径失败") + return FileResponse{}, true } + singleFile := path + fileName - _ = c.SaveUploadedFile(files, singleFile) - fileType, _ := utils.GetType(singleFile) - fileResponse = FileResponse{ - Size: pkg.GetFileSize(singleFile), - Path: singleFile, - FullPath: urlPerfix + singleFile, - Name: files.Filename, - Type: fileType, + if err := c.SaveUploadedFile(files, singleFile); err != nil { + e.Error(500, errors.New(""), "文件保存失败") + return FileResponse{}, true } - //source, _ := c.GetPostForm("source") - //err = thirdUpload(source, fileName, singleFile) - //if err != nil { - // e.Error(200, errors.New(""), "上传第三方失败") - // return FileResponse{}, true - //} + + fileType, _ := utils.GetType(singleFile) + fileResponse = e.buildFileResponse(singleFile, urlPrefix, files.Filename, fileType) fileResponse.Path = "/static/uploadfile/" + fileName fileResponse.FullPath = "/static/uploadfile/" + fileName return fileResponse, false } +func (e File) buildFileResponse(filePath, urlPrefix, fileName, fileType string) FileResponse { + return FileResponse{ + Size: pkg.GetFileSize(filePath), + Path: filePath, + FullPath: urlPrefix + filePath, + Name: fileName, + Type: fileType, + } +} + func thirdUpload(source string, name string, path string) error { switch source { case "2": From 8649d8d791d109ff17ed8e4d1286b46b874a6e4a Mon Sep 17 00:00:00 2001 From: Hosea <2937769974@qq.com> Date: Tue, 13 May 2025 15:48:45 +0800 Subject: [PATCH 237/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81=E6=97=B6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E4=B8=BA?= =?UTF-8?q?int64,=20=E5=89=8D=E7=AB=AF=E6=8F=90=E4=BA=A4=E8=BF=98=E6=98=AF?= =?UTF-8?q?string=20=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/vue.go.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/v4/vue.go.template b/template/v4/vue.go.template index ff700166b..a3f10c208 100644 --- a/template/v4/vue.go.template +++ b/template/v4/vue.go.template @@ -175,7 +175,7 @@ {{- else }} {{ if eq "input" .HtmlType -}} - {{- else if eq "select" .HtmlType -}} {{- if ne .FkTableName "" -}} From 98cf3ad95a504e4ae14217b9f9497a5ec16486c1 Mon Sep 17 00:00:00 2001 From: Hosea <2937769974@qq.com> Date: Tue, 20 May 2025 10:57:36 +0800 Subject: [PATCH 238/238] =?UTF-8?q?fix=F0=9F=90=9B:=20=20=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E5=BC=B9=E6=A1=86=E7=A1=AE=E8=AE=A4=EF=BC=8C?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E4=B8=8D=E5=8F=8B=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/v4/vue.go.template | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/template/v4/vue.go.template b/template/v4/vue.go.template index ff700166b..948f61ace 100644 --- a/template/v4/vue.go.template +++ b/template/v4/vue.go.template @@ -118,21 +118,15 @@ {{- end }}