1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- package com.ims.eval.controller;
- import com.alibaba.fastjson.JSONObject;
- import com.ims.eval.entity.custom.Menu;
- import com.ims.eval.entity.dto.result.R;
- import com.ims.eval.service.custom.impl.MenuOperationService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import javax.servlet.http.HttpServletRequest;
- import java.util.List;
- /**
- * <p>
- * 工作流前端控制器
- * </p>
- *
- * @author wang
- * @since 2023-03-03
- */
- @Slf4j
- @RestController
- @RequestMapping("//menu")
- public class MenuOperationController {
- @Autowired
- private MenuOperationService menuOperationService;
- @Autowired
- private HttpServletRequest request;
- /**
- * 获取菜单
- * @param parentId
- * @return
- */
- @PostMapping(value = "menuList")
- public R menuList(@RequestParam(value = "parentId", required = false) String parentId) {
- List<Menu> getTree = null;
- try {
- getTree = menuOperationService.getMenuTree(parentId,request);
- } catch (Exception e) {
- log.error("错误",e);
- return R.error().customError("获取菜单获取失败");
- }
- return R.ok().data(getTree);
- }
- /**
- * 获取用户权限
- * @return
- */
- @PostMapping(value = "getPrivilegesOfCurrentUserAll")
- public R getPrivilegesOfCurrentUserAll() {
- JSONObject json = null;
- try {
- json = menuOperationService.getPrivilegesOfCurrentUserAll(request);
- } catch (Exception e) {
- log.error("错误",e);
- return R.error().customError("获取用户权限获取失败");
- }
- return R.ok().data(json);
- }
- }
|