提交 7ff8c9dc 编写于 作者: cxt104926's avatar cxt104926

优化

上级 26166920
...@@ -53,6 +53,7 @@ public class MyShiroConfig { ...@@ -53,6 +53,7 @@ public class MyShiroConfig {
filterChainDefinitionMap.put("/getVerify", "anon"); filterChainDefinitionMap.put("/getVerify", "anon");
filterChainDefinitionMap.put("/register", "anon"); filterChainDefinitionMap.put("/register", "anon");
filterChainDefinitionMap.put("/favicon.ico", "anon"); filterChainDefinitionMap.put("/favicon.ico", "anon");
filterChainDefinitionMap.put("/stu/class/get/treeData", "anon");
filterChainDefinitionMap.put("/v2/api-docs/**", "anon"); filterChainDefinitionMap.put("/v2/api-docs/**", "anon");
filterChainDefinitionMap.put("/swagger-ui.html", "anon"); filterChainDefinitionMap.put("/swagger-ui.html", "anon");
......
...@@ -51,7 +51,7 @@ public class StuClassController { ...@@ -51,7 +51,7 @@ public class StuClassController {
return ApiResult.success(); return ApiResult.success();
} }
@ApiOperation("查询所有班级id、名字") @ApiOperation("树形班级结构")
@GetMapping("/get/treeData") @GetMapping("/get/treeData")
public List<Object> getStuClassTreeData() { public List<Object> getStuClassTreeData() {
return this.stuClassService.getStuClassTreeData(); return this.stuClassService.getStuClassTreeData();
......
...@@ -47,7 +47,10 @@ public class TreeModelUtil { ...@@ -47,7 +47,10 @@ public class TreeModelUtil {
} }
// 查找child // 查找child
String id = (String) mapArr.get("id"); String id = (String) mapArr.get("id");
mapArr.put("child", getTreeList(id, tm, pid)); List<?> treeList = getTreeList(id, tm, pid);
if (treeList.size() != 0) {
mapArr.put("child", treeList);
}
list.add(mapArr); list.add(mapArr);
} }
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
...@@ -79,7 +82,10 @@ public class TreeModelUtil { ...@@ -79,7 +82,10 @@ public class TreeModelUtil {
} }
// 查找child // 查找child
String childId = (String) mapArr.get("id"); String childId = (String) mapArr.get("id");
mapArr.put("child", getTreeList(childId, treeModels, pid)); List<?> treeList = getTreeList(childId, treeModels, pid);
if (treeList.size() != 0) {
mapArr.put("child", treeList);
}
lists.add(mapArr); lists.add(mapArr);
} }
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册