| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | * @author Lion Li |
| | | */ |
| | | @Validated |
| | | @Tag(name = "菜单信息控制器", description = "菜单信息管理") |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/system/menu") |
| | |
| | | @DeleteMapping("/{menuId}") |
| | | public R<Void> remove(@PathVariable("menuId") Long menuId) { |
| | | if (menuService.hasChildByMenuId(menuId)) { |
| | | return R.fail("存在子菜单,不允许删除"); |
| | | return R.warn("存在子菜单,不允许删除"); |
| | | } |
| | | if (menuService.checkMenuExistRole(menuId)) { |
| | | return R.fail("菜单已分配,不允许删除"); |
| | | return R.warn("菜单已分配,不允许删除"); |
| | | } |
| | | return toAjax(menuService.deleteMenuById(menuId)); |
| | | } |