| | |
| | | public R<IPage<ProblemType>> list(String name, Integer pageNum, Integer pageSize){ |
| | | Integer id = this.getLoginUserInfoWest().getId(); |
| | | SystemUser systemUser = systemUserService.getById(id); |
| | | if(systemUser.getAccountLevel() != 1){ |
| | | if(systemUser.getAccountLevel() != 2){ |
| | | return R.ok(); |
| | | } |
| | | IPage<ProblemType> list = problemTypeService.list(name, pageNum, pageSize); |
| | |
| | | public R add(@RequestBody ProblemType problemType){ |
| | | Integer id = this.getLoginUserInfoWest().getId(); |
| | | SystemUser systemUser = systemUserService.getById(id); |
| | | if(systemUser.getAccountLevel() != 1){ |
| | | if(systemUser.getAccountLevel() != 2){ |
| | | return R.fail("添加失败"); |
| | | } |
| | | long count = problemTypeService.count(new LambdaQueryWrapper<ProblemType>().eq(ProblemType::getName, problemType.getName()).eq(ProblemType::getDel, 0)); |
| | |
| | | public R edit(@RequestBody ProblemType problemType){ |
| | | Integer id = this.getLoginUserInfoWest().getId(); |
| | | SystemUser systemUser = systemUserService.getById(id); |
| | | if(systemUser.getAccountLevel() != 1){ |
| | | if(systemUser.getAccountLevel() != 2){ |
| | | return R.fail("编辑失败"); |
| | | } |
| | | long count = problemTypeService.count(new LambdaQueryWrapper<ProblemType>().eq(ProblemType::getName, problemType.getName()).eq(ProblemType::getDel, 0).ne(ProblemType::getId, problemType.getId())); |
| | |
| | | public R delete(@PathVariable("id") Integer id){ |
| | | Integer userid = this.getLoginUserInfoWest().getId(); |
| | | SystemUser systemUser = systemUserService.getById(userid); |
| | | if(systemUser.getAccountLevel() != 1){ |
| | | if(systemUser.getAccountLevel() != 2){ |
| | | return R.fail("删除失败"); |
| | | } |
| | | String name = problemTypeService.getById(id).getName(); |