Browse Source

优化顶部菜单配置接口

test
smallchill 5 years ago
parent
commit
7a6bdf87a5
  1. 3
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantVO.java
  2. 7
      blade-service/blade-system/src/main/java/org/springblade/system/controller/TopMenuController.java

3
blade-service-api/blade-system-api/src/main/java/org/springblade/system/vo/GrantVO.java

@ -37,6 +37,9 @@ public class GrantVO implements Serializable {
@ApiModelProperty(value = "menuIds集合")
private List<Long> menuIds;
@ApiModelProperty(value = "topMenuIds集合")
private List<Long> topMenuIds;
@ApiModelProperty(value = "dataScopeIds集合")
private List<Long> dataScopeIds;

7
blade-service/blade-system/src/main/java/org/springblade/system/controller/TopMenuController.java

@ -33,6 +33,7 @@ import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.TopMenu;
import org.springblade.system.service.ITopMenuService;
import org.springblade.system.vo.GrantVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -124,14 +125,14 @@ public class TopMenuController extends BladeController {
@PostMapping("/grant")
@ApiOperationSupport(order = 8)
@ApiOperation(value = "顶部菜单配置", notes = "传入topMenuId集合以及menuId集合")
public R grant(@ApiParam(value = "topMenuId集合", required = true) @RequestParam String topMenuIds,
@ApiParam(value = "menuId集合", required = true) @RequestParam String menuIds) {
public R grant(@RequestBody GrantVO grantVO) {
CacheUtil.clear(SYS_CACHE);
CacheUtil.clear(MENU_CACHE);
CacheUtil.clear(MENU_CACHE, Boolean.FALSE);
boolean temp = topMenuService.grant(Func.toLongList(topMenuIds), Func.toLongList(menuIds));
boolean temp = topMenuService.grant(grantVO.getTopMenuIds(), grantVO.getMenuIds());
return R.status(temp);
}
}

Loading…
Cancel
Save