| | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.interfaces.OperLog; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.sangeshenbian.annotation.SysLog; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemRole; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemRoleMenu; |
| | | import com.panzhihua.sangeshenbian.service.ISystemRoleMenuService; |
| | |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "添加角色", tags = {"三个身边后台-角色管理"}) |
| | | @OperLog(operModul = "三个身边后台",operType = 1,businessType = "添加角色") |
| | | @SysLog(operatorCategory = "添加角色",operId = 3) |
| | | public R add(@RequestBody AddSystemRole addSystemRole){ |
| | | long count = systemRoleService.count(new LambdaQueryWrapper<SystemRole>().eq(SystemRole::getDel, 0).eq(SystemRole::getName, addSystemRole.getName())); |
| | | if(0 < count){ |
| | |
| | | |
| | | @PostMapping("/edit") |
| | | @ApiOperation(value = "编辑角色", tags = {"三个身边后台-角色管理"}) |
| | | @OperLog(operModul = "三个身边后台",operType = 2,businessType = "编辑角色") |
| | | @SysLog(operatorCategory = "编辑角色",operId = 3) |
| | | public R edit(@RequestBody EditSystemRole editSystemRole){ |
| | | long count = systemRoleService.count(new LambdaQueryWrapper<SystemRole>().eq(SystemRole::getDel, 0) |
| | | .eq(SystemRole::getName, editSystemRole.getName()).ne(SystemRole::getId, editSystemRole.getId())); |
| | |
| | | |
| | | @DeleteMapping("/delete/{id}") |
| | | @ApiOperation(value = "删除角色", tags = {"三个身边后台-角色管理"}) |
| | | @OperLog(operModul = "三个身边后台",operType = 3,businessType = "删除角色") |
| | | @SysLog(operatorCategory = "删除角色",operId = 3) |
| | | public R delete(@PathVariable("id") Integer id){ |
| | | SystemRole systemRole = systemRoleService.getById(id); |
| | | systemRole.setDel(1); |
| | | systemRoleService.updateById(systemRole); |
| | | //删除角色菜单权限 |
| | | systemRoleMenuService.remove(new LambdaQueryWrapper<SystemRoleMenu>().eq(SystemRoleMenu::getSystemRoleId, id)); |
| | | return R.ok(); |
| | | return R.ok(systemRole.getName()); |
| | | } |
| | | |
| | | |