CourseService.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. package nju.seec.helper.service;
  2. import nju.seec.helper.dto.course.ChooseDTO;
  3. import nju.seec.helper.dto.course.CourseDTO;
  4. import nju.seec.helper.dto.user.LoginUser;
  5. import nju.seec.helper.vo.CourseVO;
  6. import nju.seec.helper.vo.UserVO;
  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 courseId
  26. * @param courseDTO
  27. * @return
  28. */
  29. CourseVO modifyCourse(LoginUser user, Long courseId, CourseDTO courseDTO);
  30. /**
  31. * 删除课程(伪删除)
  32. *
  33. * @param user
  34. * @param courseId
  35. */
  36. void removeCourse(LoginUser user, Long courseId);
  37. /**
  38. * 学生选课
  39. *
  40. * @param student
  41. * @param courseId
  42. * @param chooseDTO
  43. */
  44. void chooseCourse(LoginUser student, Long courseId, ChooseDTO chooseDTO);
  45. /**
  46. * 退课
  47. *
  48. * @param user
  49. * @param courseId
  50. */
  51. void quitCourse(LoginUser user, Long courseId);
  52. /**
  53. * 获取课程
  54. *
  55. * @param key
  56. * @param pageable
  57. * @return
  58. */
  59. Page<CourseVO> getCourses(String key, Pageable pageable);
  60. /**
  61. * 教师获取创建课程
  62. *
  63. * @param teacher
  64. * @param key
  65. * @param pageable
  66. * @return
  67. */
  68. Page<CourseVO> teacherGetCourses(LoginUser teacher, String key, Pageable pageable);
  69. /**
  70. * 学生获取已选课程
  71. *
  72. * @param student
  73. * @param key
  74. * @param pageable
  75. * @return
  76. */
  77. Page<CourseVO> studentGetCourses(LoginUser student, String key, Pageable pageable);
  78. /**
  79. * 获取课程选课码
  80. *
  81. * @param user
  82. * @param courseId
  83. * @return
  84. */
  85. String getCourseCode(LoginUser user, Long courseId);
  86. /**
  87. * 取得某课程
  88. *
  89. * @param courseId
  90. * @return
  91. */
  92. CourseVO getOneCourse(Long courseId);
  93. /**
  94. * 获取选课名单
  95. *
  96. * @param user
  97. * @param courseId
  98. * @param key
  99. * @param pageable
  100. * @return
  101. */
  102. Page<UserVO> getChooseStudents(LoginUser user, Long courseId, String key, Pageable pageable);
  103. }