This commit is contained in:
silverpro89
2026-01-20 20:29:07 +07:00
parent 97e2e8402e
commit 53d97ba5db
12 changed files with 3461 additions and 20 deletions

View File

@@ -169,6 +169,105 @@ const options = {
},
},
},
Lesson: {
type: 'object',
properties: {
id: {
type: 'string',
format: 'uuid',
},
chapter_id: {
type: 'string',
format: 'uuid',
},
lesson_number: {
type: 'integer',
example: 1,
},
lesson_title: {
type: 'string',
example: 'Đếm từ 1 đến 5',
},
lesson_type: {
type: 'string',
enum: ['json_content', 'url_content'],
example: 'json_content',
},
lesson_description: {
type: 'string',
},
content_json: {
type: 'object',
description: 'Nội dung bài học dạng JSON',
},
content_url: {
type: 'string',
description: 'URL nội dung (video, PDF, etc.)',
},
content_type: {
type: 'string',
example: 'youtube',
},
duration_minutes: {
type: 'integer',
example: 15,
},
is_published: {
type: 'boolean',
example: true,
},
is_free: {
type: 'boolean',
example: true,
},
display_order: {
type: 'integer',
example: 1,
},
},
},
Game: {
type: 'object',
properties: {
id: {
type: 'string',
format: 'uuid',
},
title: {
type: 'string',
example: 'Trò chơi đếm số',
},
description: {
type: 'string',
},
url: {
type: 'string',
example: 'https://games.senaai.tech/counting/',
},
thumbnail: {
type: 'string',
},
type: {
type: 'string',
example: 'counting_quiz',
},
config: {
type: 'object',
},
is_active: {
type: 'boolean',
example: true,
},
is_premium: {
type: 'boolean',
example: false,
},
difficulty_level: {
type: 'string',
enum: ['easy', 'medium', 'hard'],
},
},
},
},
},
tags: [
@@ -188,6 +287,18 @@ const options = {
name: 'Teachers',
description: 'Teacher management endpoints',
},
{
name: 'Lessons',
description: 'Lesson management endpoints',
},
{
name: 'Chapter Lessons',
description: 'Get lessons by chapter',
},
{
name: 'Games',
description: 'Game engine management',
},
],
},
apis: ['./controllers/*.js', './routes/*.js'], // Path to the API docs