update sentences API
All checks were successful
Deploy to Production / deploy (push) Successful in 22s

This commit is contained in:
silverpro89
2026-02-24 14:29:23 +07:00
parent cfc83c983c
commit d3da098f6f
10 changed files with 1447 additions and 19 deletions

View File

@@ -35,34 +35,16 @@ const Lesson = sequelize.define('lessons', {
type: DataTypes.TEXT,
comment: 'Mô tả bài học'
},
// Dạng 1: JSON Content - Nội dung học tập dạng JSON
// Cấu trúc content_json phụ thuộc vào lesson_content_type:
// - vocabulary: { type: "vocabulary", vocabulary_ids: [uuid1, uuid2, ...], exercises: [...] }
// - grammar: { type: "grammar", grammar_ids: [uuid1, uuid2, ...], examples: [...], exercises: [...] }
// - phonics: { type: "phonics", phonics_rules: [{ipa: "/æ/", words: [...]}], exercises: [...] }
// - review: { type: "review", sections: [{type: "vocabulary", ...}, {type: "grammar", ...}, {type: "phonics", ...}] }
content_json: {
type: DataTypes.JSON,
comment: 'Nội dung học tập dạng JSON: vocabulary, grammar, phonics, review'
},
// Loại nội dung của bài học (để query dễ dàng)
lesson_content_type: {
type: DataTypes.ENUM('vocabulary', 'grammar', 'phonics', 'review', 'mixed'),
allowNull: true,
comment: 'Loại nội dung: vocabulary, grammar, phonics, review, mixed'
},
// Dạng 2: URL Content - Chứa link external
content_url: {
type: DataTypes.STRING(500),
comment: 'URL nội dung: video, audio, document, external link'
},
content_type: {
type: DataTypes.STRING(50),
comment: 'Loại content cho URL: video, audio, pdf, external_link, youtube, etc.'
},
duration_minutes: {
type: DataTypes.INTEGER,
comment: 'Thời lượng (phút)'
@@ -83,7 +65,7 @@ const Lesson = sequelize.define('lessons', {
comment: 'Thứ tự hiển thị'
},
thumbnail_url: {
type: DataTypes.STRING(500),
type: DataTypes.TEXT,
comment: 'URL ảnh thumbnail'
},
created_at: {