From 6b8a9a7f34a64cabdcc0e00dd3d1699919fe2db2 Mon Sep 17 00:00:00 2001 From: HuangZhi Date: Fri, 7 Jul 2023 15:49:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bean/entity/system_menu.go | 1 + src/bean/vo/request/system_menu.go | 1 + src/bean/vo/response/system_menu.go | 2 ++ src/service/system_menu.go | 4 +++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bean/entity/system_menu.go b/src/bean/entity/system_menu.go index a22664c..076c2c9 100644 --- a/src/bean/entity/system_menu.go +++ b/src/bean/entity/system_menu.go @@ -22,4 +22,5 @@ type SystemMenu struct { Source string `json:"source"` NewWindow int `json:"new_window"` Remark string `json:"remark"` + SystemType string `json:"system_type"` //系统类型 } diff --git a/src/bean/vo/request/system_menu.go b/src/bean/vo/request/system_menu.go index 9dd4de5..27f6ccc 100644 --- a/src/bean/vo/request/system_menu.go +++ b/src/bean/vo/request/system_menu.go @@ -13,6 +13,7 @@ type SystemMenuReq struct { Source string `json:"source"` NewWindow int `json:"new_window"` Remark string `json:"remark"` + SystemType string `json:"system_type"` //系统类型 } // 组织排序参数 diff --git a/src/bean/vo/response/system_menu.go b/src/bean/vo/response/system_menu.go index 1bacca2..750f410 100644 --- a/src/bean/vo/response/system_menu.go +++ b/src/bean/vo/response/system_menu.go @@ -22,6 +22,7 @@ type SystemMenuTree struct { MenuId string `json:"menu_id" xorm:"menu_id"` //菜单id PMenuId string `json:"p_menu_id" xorm:"p_menu_id"` //上级菜单id Source string `json:"source" xorm:"source"` //源 + SystemType string `json:"system_type"` //系统类型 Child []SystemMenuTree `xorm:"-"` } @@ -38,5 +39,6 @@ type SystemMenuTreePer struct { Icon string `json:"icon" xorm:"menu_logo"` //菜单图标 MenuId string `json:"menu_id" xorm:"menu_id"` //菜单id PMenuId string `json:"p_menu_id" xorm:"p_menu_id"` //上级菜单id + SystemType string `json:"system_type"` //系统类型 Children []SystemMenuTreePer `json:"children" xorm:"-"` } diff --git a/src/service/system_menu.go b/src/service/system_menu.go index f8ce2f6..29fe1e8 100644 --- a/src/service/system_menu.go +++ b/src/service/system_menu.go @@ -235,7 +235,7 @@ func (s *SystemMenu) UpdateMenu(id int64, input request.SystemMenuReq) error { if !has { return resp.DbSelectError.ErrorDetail(errors.New("该菜单不存在")) } - if _, err := db.Table("system_menu").Cols("menu_name, dict_group_id, state, menu_url, menu_logo, updated_by, updated_time", "source", "new_window", "remark"). + if _, err := db.Table("system_menu").Cols("menu_name, dict_group_id, state, menu_url, menu_logo, updated_by, updated_time", "source", "new_window", "remark", "system_type"). Where("id = ?", id).Update(&entity.SystemMenu{ MenuName: input.MenuName, DictGroupId: input.DictGroupId, @@ -247,6 +247,7 @@ func (s *SystemMenu) UpdateMenu(id int64, input request.SystemMenuReq) error { Source: input.Source, NewWindow: input.NewWindow, Remark: input.Remark, + SystemType: input.SystemType, }); err != nil { conf.Logger.Error("更新菜单失败", zap.Error(err)) return resp.DbUpdateError.ErrorDetail(err) @@ -348,6 +349,7 @@ func (s *SystemMenu) GetInputToEntityMenu(input request.SystemMenuReq) (res enti Source: input.Source, NewWindow: input.NewWindow, Remark: input.Remark, + SystemType: input.SystemType, } return res } -- 2.26.0