Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nanMoMentorPlatform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
nanMoMentorPlatform
Commits
7f858e77
Commit
7f858e77
authored
May 29, 2026
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
21bc7814
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
mysqlTableConfig.ts
src/config/mysqlTableConfig.ts
+67
-0
No files found.
src/config/mysqlTableConfig.ts
View file @
7f858e77
...
...
@@ -419,5 +419,72 @@ export const TablesConfig = [
},
association
:
[]
},
// 1. 测评活动表(一次测评的整体配置)
{
tableNameCn
:
'测评活动表'
,
tableName
:
'survey'
,
schema
:
{
id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
primaryKey
:
true
,
autoIncrement
:
true
,
comment
:
'测评活动ID'
},
semester_id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
comment
:
'所属学期ID,关联semester.id'
},
name
:
{
type
:
DataTypes
.
STRING
(
100
),
allowNull
:
false
,
comment
:
'测评活动名称,如“2024学年第一学期导师满意度测评”'
},
description
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
'测评说明/引导语'
},
start_time
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
'答题开始时间,为空表示无限制'
},
end_time
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
true
,
comment
:
'答题结束时间,为空表示无限制'
},
is_open
:
{
type
:
DataTypes
.
BOOLEAN
,
allowNull
:
false
,
defaultValue
:
false
,
comment
:
'是否开放答题(管理员手动开启/关闭)'
},
created_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
DataTypes
.
NOW
},
updated_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
DataTypes
.
NOW
}
},
association
:
[]
},
// 2. 测评题目表(属于某个测评活动)
{
tableNameCn
:
'测评题目表'
,
tableName
:
'survey_question'
,
schema
:
{
id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
primaryKey
:
true
,
autoIncrement
:
true
,
comment
:
'题目ID'
},
survey_id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
comment
:
'所属测评活动ID,关联survey.id'
},
question_code
:
{
type
:
DataTypes
.
STRING
(
10
),
allowNull
:
false
,
comment
:
'题目编号,如Q1、Q2'
},
question_text
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
false
,
comment
:
'题目文本内容'
},
question_type
:
{
type
:
DataTypes
.
ENUM
(
'single_choice'
,
'multiple_choice'
,
'text'
),
allowNull
:
false
,
comment
:
'题目类型:单选/多选/文本'
},
options
:
{
type
:
DataTypes
.
JSON
,
allowNull
:
true
,
comment
:
'选项列表,JSON格式:[{"key":"A","value":"0次"},{"key":"B","value":"1-2次"}],仅选择题使用'
},
is_required
:
{
type
:
DataTypes
.
BOOLEAN
,
allowNull
:
false
,
defaultValue
:
true
,
comment
:
'是否必填'
},
sort_order
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
defaultValue
:
0
,
comment
:
'排序序号,从小到大排列'
},
created_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
DataTypes
.
NOW
},
updated_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
DataTypes
.
NOW
}
},
association
:
[]
},
// 3. 测评提交主表(记录学生针对某个测评活动的整体提交)
{
tableNameCn
:
'测评提交表'
,
tableName
:
'survey_submission'
,
schema
:
{
id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
primaryKey
:
true
,
autoIncrement
:
true
,
comment
:
'提交记录ID'
},
survey_id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
comment
:
'所属测评活动ID,关联survey.id'
},
student_id
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
false
,
comment
:
'学生user_id,关联uac_user.user_id'
},
teacher_id
:
{
type
:
DataTypes
.
STRING
(
20
),
allowNull
:
false
,
comment
:
'被测评的导师user_id,关联uac_user.user_id'
},
submit_time
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
DataTypes
.
NOW
,
comment
:
'提交时间'
},
created_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
DataTypes
.
NOW
}
},
association
:
[]
},
// 4. 测评答案表(不变,关联 submission_id 和 question_id)
{
tableNameCn
:
'测评答案表'
,
tableName
:
'survey_answer'
,
schema
:
{
id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
primaryKey
:
true
,
autoIncrement
:
true
,
comment
:
'答案ID'
},
submission_id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
comment
:
'关联survey_submission.id'
},
question_id
:
{
type
:
DataTypes
.
INTEGER
,
allowNull
:
false
,
comment
:
'关联survey_question.id'
},
answer_text
:
{
type
:
DataTypes
.
TEXT
,
allowNull
:
true
,
comment
:
'文本答案,用于文本题(如建议)'
},
answer_option_keys
:
{
type
:
DataTypes
.
JSON
,
allowNull
:
true
,
comment
:
'选择题答案,单选存字符串如"A",多选存数组如["A","C","E"]'
},
created_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
DataTypes
.
NOW
},
updated_at
:
{
type
:
DataTypes
.
DATE
,
allowNull
:
false
,
defaultValue
:
DataTypes
.
NOW
}
},
association
:
[]
}
];
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment