Package com.ericbouchut.learndev.course
Class CourseService
java.lang.Object
com.ericbouchut.learndev.course.CourseService
Read side of the course catalogue, applying the student visibility rule:
a student sees
PUBLISHED courses; a student who is enrolled keeps
read access to the course and its published lessons if the course is later
ARCHIVED (content continuity); DRAFT content is never
visible to students. Invisible content surfaces as 404, not 403, so the
URL space does not leak which drafts exist.-
Constructor Summary
ConstructorsConstructorDescriptionCourseService(CourseRepository courses, LessonRepository lessons, EnrollmentRepository enrollments) -
Method Summary
Modifier and TypeMethodDescriptionThe public catalogue: published courses only.publishedLesson(Course course, Long lessonId) One published lesson of the given course, or 404 when the lesson does not exist, is not published, or belongs to another course.publishedLessons(Course course) The lessons of a course a student may read, in reading order.visibleCourse(Long courseId, User student) The course as visible to the given student, or 404 when the course does not exist or the visibility rule (see class Javadoc) hides it.
-
Constructor Details
-
CourseService
public CourseService(CourseRepository courses, LessonRepository lessons, EnrollmentRepository enrollments)
-
-
Method Details
-
catalogue
The public catalogue: published courses only. -
visibleCourse
The course as visible to the given student, or 404 when the course does not exist or the visibility rule (see class Javadoc) hides it. -
publishedLessons
The lessons of a course a student may read, in reading order. -
publishedLesson
One published lesson of the given course, or 404 when the lesson does not exist, is not published, or belongs to another course.
-