| | |
| | | |
| | | |
| | | @PostMapping("/subjectList") |
| | | @ApiOperation(value = "列表查询", tags = {"题目管理"}) |
| | | // @ApiOperation(value = "列表查询", tags = {"题目管理"}) |
| | | public R<PageInfo<SubjectVO>> subjectList(@RequestBody SubjectQuery query) { |
| | | PageInfo<SubjectVO> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | List<SubjectVO> list = subjectService.listAll(query); |
| | |
| | | return R.ok(res); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation(value = "添加", tags = {"题目管理"}) |
| | | // @ApiOperation(value = "添加", tags = {"题目管理"}) |
| | | public R add(@RequestBody SubjectDTO dto) { |
| | | TSubject tSubject = new TSubject(); |
| | | BeanUtils.copyProperties(dto,tSubject); |
| | |
| | | return R.ok("添加成功"); |
| | | } |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "编辑", tags = {"题目管理"}) |
| | | // @ApiOperation(value = "编辑", tags = {"题目管理"}) |
| | | public R update(@RequestBody SubjectDTO dto) { |
| | | TSubject tSubject = new TSubject(); |
| | | // 判断当前题目有没有被使用 |
| | |
| | | } |
| | | |
| | | @PostMapping("/getInfo") |
| | | @ApiOperation(value = "查看详情", tags = {"题目管理"}) |
| | | // @ApiOperation(value = "查看详情", tags = {"题目管理"}) |
| | | public R<SubjectDTO> getInfo(@RequestParam("id") Integer id) { |
| | | TSubject byId = subjectService.getById(id); |
| | | SubjectDTO subjectDTO = new SubjectDTO(); |
| | |
| | | return R.ok(subjectDTO); |
| | | } |
| | | @PostMapping("/updateState/{id}/{state}") |
| | | @ApiOperation(value = "修改状态", tags = {"题目管理"}) |
| | | // @ApiOperation(value = "修改状态", tags = {"题目管理"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "题目id", required = true), |
| | | @ApiImplicitParam(name = "state", value = "1上架2下架3删除", required = true), |