package main import "github.com/go-chi/chi/v5" func (a *app) registerLearnerRoutes(r chi.Router) { r.Route("/learner/live-courses", func(r chi.Router) { r.Use(a.liveCourseLearnerMiddleware) r.Get("/", a.listLearnerLiveCourses) r.Get("/{id}", a.getLearnerLiveCourse) r.Get("/{id}/content", a.getLearnerCourseContent) r.Post("/{id}/lessons/{lessonId}/complete", a.completeLearnerCourseLesson) r.Get("/{id}/assets", a.listLearnerCourseAssets) r.Post("/{id}/assets/{assetId}/access", a.accessLearnerCourseAsset) r.Get("/{id}/sessions", a.listLearnerLiveCourseSessions) r.Get("/{id}/sessions/{sessionId}", a.getLearnerLiveCourseSession) r.Post("/{id}/sessions/{sessionId}/join", a.joinLearnerLiveCourseSession) }) r.Route("/learner/communities", func(r chi.Router) { r.Use(a.communityLearnerMiddleware) r.Get("/", a.listLearnerCommunities) r.Get("/{id}/channels", a.listLearnerCommunityChannels) r.Get("/{id}/channels/{channelId}/posts", a.listLearnerCommunityPosts) r.Post("/{id}/channels/{channelId}/posts", a.createLearnerCommunityPost) r.Get("/{id}/posts/{postId}/replies", a.listLearnerCommunityReplies) r.Post("/{id}/posts/{postId}/replies", a.createLearnerCommunityReply) r.Post("/{id}/join", a.joinLearnerCommunity) }) r.Route("/learner/scorm", func(r chi.Router) { r.Use(a.scormLearnerMiddleware) r.Get("/", a.listLearnerScormCourses) r.Get("/{id}/launch", a.getLearnerScormLaunch) r.Get("/{id}/runtime", a.getLearnerScormRuntime) r.Patch("/{id}/runtime", a.commitLearnerScormRuntime) }) }