CourseService.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. package nju.seec.helper.service;
  2. import nju.seec.helper.dto.ChooseDTO;
  3. import nju.seec.helper.dto.CourseDTO;
  4. import nju.seec.helper.dto.LoginUser;
  5. import nju.seec.helper.dto.ModifyCourseDTO;
  6. import nju.seec.helper.vo.CourseVO;
  7. import org.springframework.data.domain.Page;
  8. import org.springframework.data.domain.Pageable;
  9. /**
  10. * @author cst
  11. */
  12. public interface CourseService {
  13. /**
  14. * 创建课程
  15. *
  16. * @param teacher
  17. * @param courseDTO
  18. * @return
  19. */
  20. CourseVO createCourse(LoginUser teacher, CourseDTO courseDTO);
  21. /**
  22. * 修改课程
  23. *
  24. * @param user
  25. * @param modifyCourseDTO
  26. * @return
  27. */
  28. CourseVO modifyCourse(LoginUser user, ModifyCourseDTO modifyCourseDTO);
  29. /**
  30. * 删除课程(伪删除)
  31. *
  32. * @param user
  33. * @param courseId
  34. */
  35. void removeCourse(LoginUser user, Integer courseId);
  36. /**
  37. * 学生选课
  38. *
  39. * @param student
  40. * @param chooseDTO
  41. */
  42. void chooseCourse(LoginUser student, ChooseDTO chooseDTO);
  43. /**
  44. * 退课
  45. *
  46. * @param user
  47. * @param courseId
  48. */
  49. void quitCourse(LoginUser user, Integer courseId);
  50. /**
  51. * 获取课程
  52. *
  53. * @param key
  54. * @param pageable
  55. * @return
  56. */
  57. Page<CourseVO> getCourses(String key, Pageable pageable);
  58. /**
  59. * 教师获取创建课程
  60. *
  61. * @param teacher
  62. * @param key
  63. * @param pageable
  64. * @return
  65. */
  66. Page<CourseVO> teacherGetCourses(LoginUser teacher, String key, Pageable pageable);
  67. /**
  68. * 学生获取已选课程
  69. *
  70. * @param student
  71. * @param key
  72. * @param pageable
  73. * @return
  74. */
  75. Page<CourseVO> studentGetCourses(LoginUser student, String key, Pageable pageable);
  76. /**
  77. * 获取课程选课码
  78. *
  79. * @param user
  80. * @param courseId
  81. * @return
  82. */
  83. String getCourseCode(LoginUser user, Integer courseId);
  84. /**
  85. * 取得某课程
  86. *
  87. * @param courseId
  88. * @return
  89. */
  90. CourseVO getOneCourse(Integer courseId);
  91. }