update context API
All checks were successful
Deploy to Production / deploy (push) Successful in 19s
All checks were successful
Deploy to Production / deploy (push) Successful in 19s
This commit is contained in:
@@ -15,11 +15,18 @@ const Context = sequelize.define('Context', {
|
||||
},
|
||||
context: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: false,
|
||||
allowNull: true,
|
||||
comment: 'Context description'
|
||||
},
|
||||
grade : {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 100,
|
||||
comment: 'It is number of gradeX100 + unitX10 + lesson (e.g., Grade 1 Unit 2 Lesson 3 = 123)'
|
||||
},
|
||||
knowledge: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true,
|
||||
comment: 'Additional knowledge or information'
|
||||
},
|
||||
type: {
|
||||
@@ -31,7 +38,7 @@ const Context = sequelize.define('Context', {
|
||||
type: DataTypes.TEXT,
|
||||
comment: 'Detailed description or requirement'
|
||||
},
|
||||
prompt: {
|
||||
img_prompt: {
|
||||
type: DataTypes.JSON,
|
||||
comment: 'Prompt configuration object'
|
||||
},
|
||||
@@ -39,30 +46,15 @@ const Context = sequelize.define('Context', {
|
||||
type: DataTypes.JSON,
|
||||
comment: 'Array of image URLs'
|
||||
},
|
||||
difficulty: {
|
||||
type: DataTypes.INTEGER,
|
||||
defaultValue: 1,
|
||||
comment: 'Difficulty level (1-10)'
|
||||
},
|
||||
max: {
|
||||
type: DataTypes.INTEGER,
|
||||
defaultValue: 0,
|
||||
defaultValue: 1,
|
||||
comment: 'Maximum number of images or items'
|
||||
},
|
||||
isPrompt: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: false,
|
||||
comment: 'Prompt created (0/1)'
|
||||
},
|
||||
isList: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: false,
|
||||
comment: 'Waiting for more images (0/1)'
|
||||
},
|
||||
isApprove: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: false,
|
||||
comment: 'Teacher approval status (0/1)'
|
||||
status: {
|
||||
type: DataTypes.INTEGER, // Hoặc DataTypes.ENUM('DRAFT', 'ENRICHED', 'PENDING_IMAGE', ...)
|
||||
defaultValue: 0,
|
||||
comment: '0: Draft, 1: Enriched, 2: Prompt_Ready, 3: Generating, 4: Image_Ready, 5: Approved'
|
||||
},
|
||||
created_at: {
|
||||
type: DataTypes.DATE,
|
||||
@@ -75,6 +67,7 @@ const Context = sequelize.define('Context', {
|
||||
}, {
|
||||
tableName: 'context',
|
||||
timestamps: true,
|
||||
underscored: false,
|
||||
createdAt: 'created_at',
|
||||
updatedAt: 'updated_at',
|
||||
indexes: [
|
||||
|
||||
@@ -24,7 +24,8 @@ const Vocab = sequelize.define('Vocab', {
|
||||
// Ví dụ 111 là grade 1, unit 1, lesson 1
|
||||
location: {
|
||||
type: DataTypes.INTEGER,
|
||||
comment: 'Location or source of the vocabulary'
|
||||
defaultValue: 100,
|
||||
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: {
|
||||
|
||||
Reference in New Issue
Block a user