From a1c49b712f2bfc5f23c50b12ca24cf233a5d2939 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Thu, 13 Apr 2023 16:47:13 +0800
Subject: [PATCH] 巡查记录sql修改,添加app菜单权限控制

---
 skjcmanager/skjcmanager-service/skjcmanager-system/src/main/java/cn/gistack/system/controller/MenuController.java |   33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/skjcmanager/skjcmanager-service/skjcmanager-system/src/main/java/cn/gistack/system/controller/MenuController.java b/skjcmanager/skjcmanager-service/skjcmanager-system/src/main/java/cn/gistack/system/controller/MenuController.java
index dfe346e..50cb047 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-system/src/main/java/cn/gistack/system/controller/MenuController.java
+++ b/skjcmanager/skjcmanager-service/skjcmanager-system/src/main/java/cn/gistack/system/controller/MenuController.java
@@ -43,6 +43,7 @@
 import springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -68,7 +69,7 @@
 	 * 详情
 	 */
 	@GetMapping("/detail")
-	@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入menu")
 	public R<MenuVO> detail(Menu menu) {
@@ -84,7 +85,7 @@
 		@ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"),
 		@ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string")
 	})
-	@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
 	@ApiOperationSupport(order = 2)
 	@ApiOperation(value = "列表", notes = "传入menu")
 	public R<List<MenuVO>> list(@ApiIgnore @RequestParam Map<String, Object> menu) {
@@ -100,7 +101,7 @@
 		@ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"),
 		@ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string")
 	})
-	@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "懒加载列表", notes = "传入menu")
 	public R<List<MenuVO>> lazyList(Long parentId, @ApiIgnore @RequestParam Map<String, Object> menu) {
@@ -116,7 +117,7 @@
 		@ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"),
 		@ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string")
 	})
-	@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
 	@ApiOperationSupport(order = 4)
 	@ApiOperation(value = "菜单列表", notes = "传入menu")
 	public R<List<MenuVO>> menuList(@ApiIgnore @RequestParam Map<String, Object> menu) {
@@ -132,7 +133,7 @@
 		@ApiImplicitParam(name = "code", value = "菜单编号", paramType = "query", dataType = "string"),
 		@ApiImplicitParam(name = "name", value = "菜单名称", paramType = "query", dataType = "string")
 	})
-	@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "懒加载菜单列表", notes = "传入menu")
 	public R<List<MenuVO>> lazyMenuList(Long parentId, @ApiIgnore @RequestParam Map<String, Object> menu) {
@@ -144,7 +145,7 @@
 	 * 新增或修改
 	 */
 	@PostMapping("/submit")
-	@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
 	@ApiOperationSupport(order = 6)
 	@ApiOperation(value = "新增或修改", notes = "传入menu")
 	public R submit(@Valid @RequestBody Menu menu) {
@@ -163,7 +164,7 @@
 	 * 删除
 	 */
 	@PostMapping("/remove")
-	@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
+	@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
@@ -184,6 +185,24 @@
 	}
 
 	/**
+	 * 动态获取菜单数据
+	 */
+	@GetMapping("/dynamicMenu")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "动态获取菜单数据", notes = "动态获取菜单数据")
+	public R dynamicMenu(String roleId,String flag){
+		List<MenuVO> list = new ArrayList<>();
+		if (flag.equals("web")){
+			list = menuService.getWebMenu(roleId);
+		}
+
+		if (flag.equals("app")){
+			list =  menuService.getAppMenu(roleId);
+		}
+		return R.data(list);
+	}
+
+	/**
 	 * 前端按钮数据
 	 */
 	@GetMapping("/buttons")

--
Gitblit v1.9.3