jiangping
2024-10-28 a22fa65d1027f8500c0494e97ff2232f70e9ca93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.doumee.api.system;
 
import com.doumee.api.BaseController;
import com.doumee.biz.system.SystemMenuBiz;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.constants.OperaType;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.utils.Constants;
import com.doumee.dao.system.dto.UpdateSystemMenuSortDTO;
import com.doumee.dao.system.model.SystemMenu;
import com.doumee.dao.system.vo.SystemMenuListVO;
import com.doumee.dao.system.vo.SystemMenuNodeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * @author Eva.Caesar Liu
 * @date 2023/03/21 14:49
 */
@Api(tags = "系统菜单")
@RestController
@RequestMapping("/system/menu")
public class SystemMenuController extends BaseController {
 
    @Autowired
    private SystemMenuBiz systemMenuBiz;
 
    @ApiOperation("查询菜单树")
    @GetMapping("/treeNodes")
    public ApiResponse<List<SystemMenuNodeVO>> getTreeMenu() {
        LoginUserInfo loginUserInfo = this.getLoginUser();
        return ApiResponse.success(systemMenuBiz.findTree(loginUserInfo.getId(), Constants.TWO));
    }
 
    @ApiOperation("查询列表树")
    @PostMapping("/treeList/{type}")
    @RequiresPermissions("system:menu:query")
    public ApiResponse<List<SystemMenuListVO>> treeList(@PathVariable Integer type) {
        type = Constants.TWO;//商户菜单
        return ApiResponse.success(systemMenuBiz.findTreeByType(type));
    }
}