chore: 后端首次基线提交
运行必须源码:app/(controller/model/service/middleware/lib/utils/validate/router)、config/、database/(migrations/seeders/sql)、启动脚本、app/public/templates 模板。 已忽略运行非必须:node_modules/、logs/、run/、app/public 运行时上传数据、.env*、构建/缓存产物。
This commit is contained in:
67
app/model/wordQuestion.js
Normal file
67
app/model/wordQuestion.js
Normal file
@@ -0,0 +1,67 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Word操作题模型 - WordQuestion
|
||||
*
|
||||
* 对应 word_questions 表,存储所有组别的 Word 操作题。
|
||||
* 通过 group 字段区分中职组(zhongzhi)和高职组(gaozhi)。
|
||||
*/
|
||||
module.exports = app => {
|
||||
const { STRING, INTEGER, DATE, TEXT } = app.Sequelize;
|
||||
|
||||
return app.model.define('WordQuestion', {
|
||||
id: {
|
||||
type: INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
comment: '主键ID',
|
||||
},
|
||||
group: {
|
||||
type: STRING(20),
|
||||
allowNull: false,
|
||||
comment: '组别:zhongzhi/gaozhi',
|
||||
},
|
||||
title: {
|
||||
type: STRING(200),
|
||||
allowNull: false,
|
||||
comment: '题目标题',
|
||||
},
|
||||
description: {
|
||||
type: TEXT,
|
||||
allowNull: true,
|
||||
comment: '题目描述/操作要求',
|
||||
},
|
||||
score: {
|
||||
type: INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 30,
|
||||
comment: '分值',
|
||||
},
|
||||
sort_order: {
|
||||
type: INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 0,
|
||||
comment: '排序',
|
||||
},
|
||||
template_path: {
|
||||
type: STRING(500),
|
||||
allowNull: true,
|
||||
comment: 'Word 模板文件路径',
|
||||
},
|
||||
created_at: {
|
||||
type: DATE,
|
||||
defaultValue: app.Sequelize.NOW,
|
||||
comment: '创建时间',
|
||||
},
|
||||
updated_at: {
|
||||
type: DATE,
|
||||
defaultValue: app.Sequelize.NOW,
|
||||
comment: '更新时间',
|
||||
},
|
||||
}, {
|
||||
tableName: 'word_questions',
|
||||
timestamps: true,
|
||||
createdAt: 'created_at',
|
||||
updatedAt: 'updated_at',
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user