dengzedong
2024-12-24 76743b009ca5ea67557fcab597b332f8d1947813
提交 | 用户 | 时间
818a01 1 //package com.iailab.module.system.controller.admin.app;
H 2 //
3 //import com.iailab.framework.common.enums.CommonStatusEnum;
4 //import com.iailab.framework.common.pojo.CommonResult;
5 //import com.iailab.framework.common.util.object.BeanUtils;
6 //import com.iailab.module.system.controller.admin.app.vo.AppMenuRespVO;
7 //import com.iailab.module.system.controller.admin.permission.vo.menu.MenuListReqVO;
8 //import com.iailab.module.system.controller.admin.permission.vo.menu.MenuSaveVO;
9 //import com.iailab.module.system.controller.admin.permission.vo.menu.MenuSimpleRespVO;
10 //import com.iailab.module.system.dal.dataobject.app.AppMenuDO;
11 //import com.iailab.module.system.service.app.AppMenuService;
12 //import io.swagger.v3.oas.annotations.Operation;
13 //import io.swagger.v3.oas.annotations.Parameter;
14 //import io.swagger.v3.oas.annotations.tags.Tag;
15 //import org.springframework.security.access.prepost.PreAuthorize;
16 //import org.springframework.validation.annotation.Validated;
17 //import org.springframework.web.bind.annotation.*;
18 //
19 //import javax.annotation.Resource;
20 //import javax.validation.Valid;
21 //import java.util.Comparator;
22 //import java.util.List;
23 //
24 //import static com.iailab.framework.common.pojo.CommonResult.success;
25 //
26 //@Tag(name = "应用菜单")
27 //@RestController
28 //@RequestMapping("/system/app-menu")
29 //@Validated
30 //public class AppMenuController {
31 //
32 //    @Resource
33 //    private AppMenuService appMenuService;
34 //
35 //    @PostMapping("/create")
36 //    @Operation(summary = "创建菜单")
37 //    @PreAuthorize("@ss.hasPermission('system:app-menu:create')")
38 //    public CommonResult<Long> createMenu(@Valid @RequestBody MenuSaveVO createReqVO) {
39 //        Long menuId = appMenuService.createMenu(createReqVO);
40 //        return success(menuId);
41 //    }
42 //
43 //    @PutMapping("/update")
44 //    @Operation(summary = "修改菜单")
45 //    @PreAuthorize("@ss.hasPermission('system:app-menu:update')")
46 //    public CommonResult<Boolean> updateMenu(@Valid @RequestBody MenuSaveVO updateReqVO) {
47 //        appMenuService.updateMenu(updateReqVO);
48 //        return success(true);
49 //    }
50 //
51 //    @DeleteMapping("/delete")
52 //    @Operation(summary = "删除菜单")
53 //    @Parameter(name = "id", description = "菜单编号", required= true, example = "1024")
54 //    @PreAuthorize("@ss.hasPermission('system:app-menu:delete')")
55 //    public CommonResult<Boolean> deleteMenu(@RequestParam("id") Long id) {
56 //        appMenuService.deleteMenu(id);
57 //        return success(true);
58 //    }
59 //
60 //    @GetMapping("/list")
61 //    @Operation(summary = "获取菜单列表", description = "用于【菜单管理】界面")
62 //    @PreAuthorize("@ss.hasPermission('system:app-menu:query')")
63 //    public CommonResult<List<AppMenuRespVO>> getMenuList(MenuListReqVO reqVO) {
64 //        List<AppMenuDO> list = appMenuService.getMenuList(reqVO);
65 //        list.sort(Comparator.comparing(AppMenuDO::getSort));
66 //        return success(BeanUtils.toBean(list, AppMenuRespVO.class));
67 //    }
68 //
69 //    @GetMapping({"/list-all-simple", "simple-list"})
70 //    @Operation(summary = "获取菜单精简信息列表", description = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。" +
71 //            "在多租户的场景下,会只返回租户所在套餐有的菜单")
72 //    public CommonResult<List<MenuSimpleRespVO>> getSimpleMenuList() {
73 //        List<AppMenuDO> list = appMenuService.getMenuListByTenant(
74 //                new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
75 //        list.sort(Comparator.comparing(AppMenuDO::getSort));
76 //        return success(BeanUtils.toBean(list, MenuSimpleRespVO.class));
77 //    }
78 //
79 //    @GetMapping("/get")
80 //    @Operation(summary = "获取菜单信息")
81 //    @PreAuthorize("@ss.hasPermission('system:app-menu:query')")
82 //    public CommonResult<AppMenuRespVO> getMenu(Long id) {
83 //        AppMenuDO menu = appMenuService.getMenu(id);
84 //        return success(BeanUtils.toBean(menu, AppMenuRespVO.class));
85 //    }
86 //
87 //}