feat: Add ERD documentation and refactor API endpoint paths for student and instructor specific routes.
This commit is contained in:
parent
93027ef243
commit
7ebe33d920
3 changed files with 325 additions and 7 deletions
|
|
@ -65,7 +65,7 @@ Authorization: Bearer <token>
|
|||
### Student Endpoints
|
||||
| Method | Endpoint | Auth | Description |
|
||||
|--------|----------|------|-------------|
|
||||
| POST | `/courses/:courseId/enroll` | 👨🎓 Student | Enroll in course |
|
||||
| POST | `/students/courses/:courseId/enroll` | 👨🎓 Student | Enroll in course |
|
||||
| GET | `/students/courses` | 👨🎓 Student | Get my enrolled courses |
|
||||
| GET | `/students/courses/:courseId/learn` | 👨🎓 Student | Get course learning page (with lock status) |
|
||||
| GET | `/students/courses/:courseId/lessons/:lessonId` | 👨🎓 Student | Get lesson content (checks prerequisites) |
|
||||
|
|
@ -114,7 +114,7 @@ Authorization: Bearer <token>
|
|||
| PUT | `/instructor/courses/:courseId/lessons/:lessonId/attachments/:attachmentId` | 👨🏫 Instructor | Update attachment info |
|
||||
| DELETE | `/instructor/courses/:courseId/lessons/:lessonId/attachments/:attachmentId` | 👨🏫 Instructor | Delete attachment |
|
||||
| PUT | `/instructor/courses/:courseId/lessons/:lessonId/attachments/reorder` | 👨🏫 Instructor | Reorder attachments |
|
||||
| GET | `/lessons/:lessonId/attachments/:attachmentId/download` | ✅ | Download attachment |
|
||||
| GET | `/students/lessons/:lessonId/attachments/:attachmentId/download` | 👨🎓 Student | Download attachment |
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -142,14 +142,20 @@ Authorization: Bearer <token>
|
|||
|
||||
## 6. Announcements
|
||||
|
||||
### Student Endpoints
|
||||
| Method | Endpoint | Auth | Description |
|
||||
|--------|----------|------|-------------|
|
||||
| GET | `/courses/:courseId/announcements` | ✅ | Get course announcements |
|
||||
| GET | `/courses/:courseId/announcements/:announcementId` | ✅ | Get announcement details |
|
||||
| GET | `/students/courses/:courseId/announcements` | 👨🎓 Student | Get course announcements |
|
||||
| GET | `/students/courses/:courseId/announcements/:announcementId` | 👨🎓 Student | Get announcement details |
|
||||
| GET | `/students/announcements/:announcementId/attachments/:attachmentId/download` | 👨🎓 Student | Download attachment |
|
||||
|
||||
### Instructor Endpoints
|
||||
| Method | Endpoint | Auth | Description |
|
||||
|--------|----------|------|-------------|
|
||||
| GET | `/instructor/courses/:courseId/announcements` | 👨🏫 Instructor | List announcements |
|
||||
| POST | `/instructor/courses/:courseId/announcements` | 👨🏫 Instructor | Create announcement |
|
||||
| PUT | `/instructor/courses/:courseId/announcements/:announcementId` | 👨🏫 Instructor | Update announcement |
|
||||
| DELETE | `/instructor/courses/:courseId/announcements/:announcementId` | 👨🏫 Instructor | Delete announcement |
|
||||
| GET | `/announcements/:announcementId/attachments/:attachmentId/download` | ✅ | Download attachment |
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -305,7 +311,7 @@ Authorization: Bearer <token>
|
|||
|
||||
---
|
||||
|
||||
## Total Endpoints: **95+**
|
||||
## Total Endpoints: **96+**
|
||||
|
||||
- Authentication: 6
|
||||
- User Management: 4
|
||||
|
|
@ -313,7 +319,7 @@ Authorization: Bearer <token>
|
|||
- Courses: 14 (+2)
|
||||
- Chapters & Lessons: 16
|
||||
- Quizzes: 10
|
||||
- Announcements: 6
|
||||
- Announcements: 7 (+1)
|
||||
- Reports: 11
|
||||
- Orders & Payments: 7 (อนาคต)
|
||||
- Earnings & Withdrawals: 8 (อนาคต)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue