This commit is contained in:
@@ -386,4 +386,100 @@ router.put('/:id', storyController.updateStory);
|
||||
*/
|
||||
router.delete('/:id', storyController.deleteStory);
|
||||
|
||||
// ============ Nested Lesson Routes ============
|
||||
/**
|
||||
* @swagger
|
||||
* /api/stories/{storyId}/lessons:
|
||||
* get:
|
||||
* tags: [Stories]
|
||||
* summary: Lấy danh sách lessons sử dụng story này
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: storyId
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* format: uuid
|
||||
* - in: query
|
||||
* name: page
|
||||
* schema:
|
||||
* type: integer
|
||||
* default: 1
|
||||
* - in: query
|
||||
* name: limit
|
||||
* schema:
|
||||
* type: integer
|
||||
* default: 20
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Danh sách lessons sử dụng story
|
||||
*/
|
||||
router.get('/:storyId/lessons', storyController.getLessonsByStory);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/stories/{storyId}/lessons:
|
||||
* post:
|
||||
* tags: [Stories]
|
||||
* summary: Thêm lesson vào story (alternative way)
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: storyId
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* format: uuid
|
||||
* requestBody:
|
||||
* required: true
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - lesson_id
|
||||
* properties:
|
||||
* lesson_id:
|
||||
* type: string
|
||||
* format: uuid
|
||||
* display_order:
|
||||
* type: integer
|
||||
* default: 0
|
||||
* is_required:
|
||||
* type: boolean
|
||||
* default: true
|
||||
* responses:
|
||||
* 201:
|
||||
* description: Lesson đã được thêm vào story
|
||||
*/
|
||||
router.post('/:storyId/lessons', storyController.addLessonToStory);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/stories/{storyId}/lessons/{lessonId}:
|
||||
* delete:
|
||||
* tags: [Stories]
|
||||
* summary: Xóa lesson khỏi story
|
||||
* security:
|
||||
* - bearerAuth: []
|
||||
* parameters:
|
||||
* - in: path
|
||||
* name: storyId
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* format: uuid
|
||||
* - in: path
|
||||
* name: lessonId
|
||||
* required: true
|
||||
* schema:
|
||||
* type: string
|
||||
* format: uuid
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Lesson đã được xóa khỏi story
|
||||
*/
|
||||
router.delete('/:storyId/lessons/:lessonId', storyController.removeLessonFromStory);
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user