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

This commit is contained in:
silverpro89
2026-02-09 23:17:03 +07:00
parent f91cda796e
commit 5957636b07
101 changed files with 6998 additions and 1996 deletions

View File

@@ -14,6 +14,10 @@ const Vocab = sequelize.define('Vocab', {
allowNull: false,
index: true
},
ipa : {
type: DataTypes.STRING(100),
comment: 'International Phonetic Alphabet representation'
},
// Từ gốc để nhóm lại (wash, eat...)
base_word: {
type: DataTypes.STRING(100),
@@ -22,37 +26,55 @@ const Vocab = sequelize.define('Vocab', {
},
// Đã xuất hiện trong khối nào, bài học nào, lesson nào
// Ví dụ 111 là grade 1, unit 1, lesson 1
location: {
grade: {
type: DataTypes.INTEGER,
defaultValue: 100,
defaultValue: 0,
comment: 'It is number of gradeX100 + unitX10 + lesson (e.g., Grade 1 Unit 2 Lesson 3 = 123)'
},
// Loại biến thể (V1, V2, V3, V_ing, Noun_Form...)
form_key: {
type: DataTypes.STRING(20),
defaultValue: 'base'
type: DataTypes.JSON,
defaultValue: 'base',
comment: 'Form key indicating the type of word form (e.g., base, V1, V2, V3, V_ing, Noun_Form)'
},
// Nội dung dùng chung (có thể lưu JSON để dễ quản lý hoặc dùng chung cho cả group)
translation: {
type: DataTypes.STRING(200)
},
difficulty_score: {
type: DataTypes.INTEGER,
defaultValue: 1,
comment: 'Difficulty level (1-10)'
vi: {
type: DataTypes.TEXT,
defaultValue: '',
comment: 'Vietnamese meaning'
},
category: {
type: DataTypes.STRING(100),
comment: 'Category of the word (e.g., Action Verbs, Nouns)'
},
etc : {
type: DataTypes.TEXT,
comment: 'Book or additional reference'
},
topic: {
type: DataTypes.STRING(100),
comment: 'Topic of the word (e.g., Food, Travel, Education)'
},
images: {
image_small: {
type: DataTypes.JSON,
comment: 'Array of image URLs'
},
image_square: {
type: DataTypes.JSON,
comment: 'Array of image URLs'
},
image_normal: {
type: DataTypes.JSON,
comment: 'Array of image URLs'
},
audio : {
type: DataTypes.JSON,
comment: 'Array of audio URLs'
},
example_sentences: {
type: DataTypes.JSON,
comment: 'Array of example sentences'
},
tags: {
type: DataTypes.JSON,
comment: 'Array of tags for categorization'
@@ -101,8 +123,8 @@ const Vocab = sequelize.define('Vocab', {
fields: ['category']
},
{
name: 'idx_location',
fields: ['location']
name: 'idx_grade',
fields: ['grade']
}
]
});