ExamMusicTheoryController.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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.common.tenant.TenantContextHolder;
  6. import com.keao.edu.user.entity.ExamMusicTheory;
  7. import com.keao.edu.user.page.ExamMusicTheoryQueryInfo;
  8. import com.keao.edu.user.service.ExamMusicTheoryService;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.*;
  13. import java.util.Date;
  14. import java.util.List;
  15. /**
  16. * @Author Joburgess
  17. * @Date 2020.07.01
  18. */
  19. @RestController
  20. @RequestMapping("examMusicTheory")
  21. @Api(tags = "考级乐理")
  22. public class ExamMusicTheoryController extends BaseController {
  23. @Autowired
  24. private ExamMusicTheoryService examMusicTheoryService;
  25. @ApiOperation("分页查询")
  26. @GetMapping(value = "/list")
  27. public HttpResponseResult<PageInfo<ExamMusicTheory>> getList(ExamMusicTheoryQueryInfo queryInfo) {
  28. return succeed(examMusicTheoryService.queryPage(queryInfo));
  29. }
  30. @ApiOperation("新增")
  31. @PostMapping(value = "/add")
  32. public HttpResponseResult add(ExamMusicTheory examMusicTheory) {
  33. examMusicTheory.setTenantId(TenantContextHolder.getTenantId());
  34. examMusicTheoryService.insert(examMusicTheory);
  35. return succeed();
  36. }
  37. @ApiOperation("更新")
  38. @PostMapping(value = "/update")
  39. public HttpResponseResult update(ExamMusicTheory examMusicTheory) {
  40. examMusicTheory.setUpdateTime(new Date());
  41. examMusicTheoryService.update(examMusicTheory);
  42. return succeed();
  43. }
  44. @ApiOperation("删除")
  45. @PostMapping(value = "/del/{id}")
  46. public HttpResponseResult add(@PathVariable("id") Integer id) {
  47. return succeed(examMusicTheoryService.delete(id));
  48. }
  49. @ApiOperation("获取项目乐理级别列表")
  50. @GetMapping(value = "/getTheoryLevelList")
  51. public HttpResponseResult<List<ExamMusicTheory>> getTheoryLevelList(Integer examId) {
  52. return succeed(examMusicTheoryService.getTheoryLevelList(examId));
  53. }
  54. }