ExamSubjectSongController.java 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package com.keao.edu.user.controller;
  2. import com.keao.edu.common.controller.BaseController;
  3. import com.keao.edu.common.entity.HttpResponseResult;
  4. import com.keao.edu.common.page.PageInfo;
  5. import com.keao.edu.user.dto.ExamSubjectSongDto;
  6. import com.keao.edu.user.entity.ExamSong;
  7. import com.keao.edu.user.entity.ExamSubjectSong;
  8. import com.keao.edu.user.page.ExamSubjectSongQueryInfo;
  9. import com.keao.edu.user.service.ExamSubjectSongService;
  10. import io.swagger.annotations.Api;
  11. import io.swagger.annotations.ApiImplicitParam;
  12. import io.swagger.annotations.ApiImplicitParams;
  13. import io.swagger.annotations.ApiOperation;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.*;
  16. import java.util.List;
  17. /**
  18. * @Author Joburgess
  19. * @Date 2020.06.18
  20. */
  21. @RestController
  22. @RequestMapping("examSubjectSong")
  23. @Api(tags = "考级内容服务")
  24. public class ExamSubjectSongController extends BaseController {
  25. @Autowired
  26. private ExamSubjectSongService examSubjectSongService;
  27. @ApiOperation("分页查询")
  28. @GetMapping(value = "/list")
  29. public HttpResponseResult<PageInfo<ExamSubjectSongDto>> getList(ExamSubjectSongQueryInfo queryInfo) {
  30. return succeed(examSubjectSongService.queryExamSubjectSongs(queryInfo));
  31. }
  32. @ApiOperation("添加考试内容")
  33. @PostMapping(value = "/addExamSubjects")
  34. public HttpResponseResult addExamSubjects(@RequestBody List<ExamSubjectSong> examSubjectSongs) {
  35. examSubjectSongService.addExamSubjects(examSubjectSongs);
  36. return succeed();
  37. }
  38. @ApiOperation("更新考试内容")
  39. @PostMapping(value = "/update")
  40. public HttpResponseResult update(@RequestBody ExamSubjectSong examSubjectSong) {
  41. examSubjectSongService.update(examSubjectSong);
  42. return succeed();
  43. }
  44. @ApiOperation(value = "删除考试内容")
  45. @PostMapping(value = "del")
  46. public HttpResponseResult del(Long id) {
  47. examSubjectSongService.deleteExamSubjectSong(id);
  48. return succeed();
  49. }
  50. @ApiOperation("获取考级专业相应级别列表-报名")
  51. @ApiImplicitParams({
  52. @ApiImplicitParam(name = "examinationBasicId", value = "项目id", required = true, dataType = "Integer"),
  53. @ApiImplicitParam(name = "examSubjectId", value = "考试项目专业id", required = true, dataType = "Integer")})
  54. @GetMapping(value = "/getExamSubjectLevel")
  55. public HttpResponseResult<List<ExamSubjectSong>> getExamSubjectLevel(Integer examinationBasicId, Long examSubjectId) {
  56. return succeed(examSubjectSongService.getExamSubjectLevels(examinationBasicId, examSubjectId));
  57. }
  58. @ApiOperation("获取考级专业相应级别的曲目-报名")
  59. @ApiImplicitParams({
  60. @ApiImplicitParam(name = "examinationBasicId", value = "项目id", required = true, dataType = "Integer"),
  61. @ApiImplicitParam(name = "examSubjectId", value = "考试项目专业id", required = true, dataType = "Integer"),
  62. @ApiImplicitParam(name = "level", value = "级别", required = true, dataType = "Integer")})
  63. @GetMapping(value = "/getExamSubjectSong")
  64. public HttpResponseResult<List<ExamSong>> getExamSubjectSong(Integer examinationBasicId, Long examSubjectId, Integer level) {
  65. return succeed(examSubjectSongService.getExamSubjectSong(examinationBasicId, examSubjectId, level));
  66. }
  67. }