|
@@ -20,6 +20,7 @@ import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
|
|
|
|
|
@@ -50,7 +51,7 @@ public class MenuController {
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
@Operation(summary = "删除菜单")
|
|
|
- @Parameter(name = "id", description = "角色编号", required= true, example = "1024")
|
|
|
+ @Parameter(name = "id", description = "角色编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('system:menu:delete')")
|
|
|
public CommonResult<Boolean> deleteMenu(@RequestParam("id") Long id) {
|
|
|
menuService.deleteMenu(id);
|
|
@@ -69,10 +70,13 @@ public class MenuController {
|
|
|
@GetMapping({"/list-all-simple", "simple-list"})
|
|
|
@Operation(summary = "获取菜单精简信息列表", description = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。" +
|
|
|
"在多租户的场景下,会只返回租户所在套餐有的菜单")
|
|
|
- public CommonResult<List<MenuSimpleRespVO>> getSimpleMenuList() {
|
|
|
+ public CommonResult<List<MenuSimpleRespVO>> getSimpleMenuList(@RequestParam("categoryId") Long categoryId) {
|
|
|
List<MenuDO> list = menuService.getMenuListByTenant(
|
|
|
new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
|
|
|
list.sort(Comparator.comparing(MenuDO::getSort));
|
|
|
+ if (categoryId != null) {
|
|
|
+ list = list.stream().filter(k -> k.getCategoryId().equals(categoryId)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
return success(BeanUtils.toBean(list, MenuSimpleRespVO.class));
|
|
|
}
|
|
|
|