//package com.iailab.module.system.controller.admin.app;
|
//
|
//import com.iailab.framework.common.enums.CommonStatusEnum;
|
//import com.iailab.framework.common.pojo.CommonResult;
|
//import com.iailab.framework.common.util.object.BeanUtils;
|
//import com.iailab.module.system.controller.admin.app.vo.AppMenuRespVO;
|
//import com.iailab.module.system.controller.admin.permission.vo.menu.MenuListReqVO;
|
//import com.iailab.module.system.controller.admin.permission.vo.menu.MenuSaveVO;
|
//import com.iailab.module.system.controller.admin.permission.vo.menu.MenuSimpleRespVO;
|
//import com.iailab.module.system.dal.dataobject.app.AppMenuDO;
|
//import com.iailab.module.system.service.app.AppMenuService;
|
//import io.swagger.v3.oas.annotations.Operation;
|
//import io.swagger.v3.oas.annotations.Parameter;
|
//import io.swagger.v3.oas.annotations.tags.Tag;
|
//import org.springframework.security.access.prepost.PreAuthorize;
|
//import org.springframework.validation.annotation.Validated;
|
//import org.springframework.web.bind.annotation.*;
|
//
|
//import javax.annotation.Resource;
|
//import javax.validation.Valid;
|
//import java.util.Comparator;
|
//import java.util.List;
|
//
|
//import static com.iailab.framework.common.pojo.CommonResult.success;
|
//
|
//@Tag(name = "应用菜单")
|
//@RestController
|
//@RequestMapping("/system/app-menu")
|
//@Validated
|
//public class AppMenuController {
|
//
|
// @Resource
|
// private AppMenuService appMenuService;
|
//
|
// @PostMapping("/create")
|
// @Operation(summary = "创建菜单")
|
// @PreAuthorize("@ss.hasPermission('system:app-menu:create')")
|
// public CommonResult<Long> createMenu(@Valid @RequestBody MenuSaveVO createReqVO) {
|
// Long menuId = appMenuService.createMenu(createReqVO);
|
// return success(menuId);
|
// }
|
//
|
// @PutMapping("/update")
|
// @Operation(summary = "修改菜单")
|
// @PreAuthorize("@ss.hasPermission('system:app-menu:update')")
|
// public CommonResult<Boolean> updateMenu(@Valid @RequestBody MenuSaveVO updateReqVO) {
|
// appMenuService.updateMenu(updateReqVO);
|
// return success(true);
|
// }
|
//
|
// @DeleteMapping("/delete")
|
// @Operation(summary = "删除菜单")
|
// @Parameter(name = "id", description = "菜单编号", required= true, example = "1024")
|
// @PreAuthorize("@ss.hasPermission('system:app-menu:delete')")
|
// public CommonResult<Boolean> deleteMenu(@RequestParam("id") Long id) {
|
// appMenuService.deleteMenu(id);
|
// return success(true);
|
// }
|
//
|
// @GetMapping("/list")
|
// @Operation(summary = "获取菜单列表", description = "用于【菜单管理】界面")
|
// @PreAuthorize("@ss.hasPermission('system:app-menu:query')")
|
// public CommonResult<List<AppMenuRespVO>> getMenuList(MenuListReqVO reqVO) {
|
// List<AppMenuDO> list = appMenuService.getMenuList(reqVO);
|
// list.sort(Comparator.comparing(AppMenuDO::getSort));
|
// return success(BeanUtils.toBean(list, AppMenuRespVO.class));
|
// }
|
//
|
// @GetMapping({"/list-all-simple", "simple-list"})
|
// @Operation(summary = "获取菜单精简信息列表", description = "只包含被开启的菜单,用于【角色分配菜单】功能的选项。" +
|
// "在多租户的场景下,会只返回租户所在套餐有的菜单")
|
// public CommonResult<List<MenuSimpleRespVO>> getSimpleMenuList() {
|
// List<AppMenuDO> list = appMenuService.getMenuListByTenant(
|
// new MenuListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
|
// list.sort(Comparator.comparing(AppMenuDO::getSort));
|
// return success(BeanUtils.toBean(list, MenuSimpleRespVO.class));
|
// }
|
//
|
// @GetMapping("/get")
|
// @Operation(summary = "获取菜单信息")
|
// @PreAuthorize("@ss.hasPermission('system:app-menu:query')")
|
// public CommonResult<AppMenuRespVO> getMenu(Long id) {
|
// AppMenuDO menu = appMenuService.getMenu(id);
|
// return success(BeanUtils.toBean(menu, AppMenuRespVO.class));
|
// }
|
//
|
//}
|