Browse Source

教师表增加字段

reloaded 5 years ago
parent
commit
417956b225
1 changed files with 7 additions and 1 deletions
  1. 7 1
      app/model/teacher.js

+ 7 - 1
app/model/teacher.js

@@ -3,9 +3,15 @@ const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 const { Secret } = require('naf-framework-mongoose/lib/model/schema');
 
+// 资料路径详情
+const urlInfo = new Schema({
+  uri: { type: String, required: false, maxLength: 200 }, // 路径
+  name: { type: String, required: false, maxLength: 200 }, // 名称
+});
+
 // 资料信息
 const FileInfo = new Schema({
-  url: { type: String, required: false, maxLength: 200 }, // 资料地址
+  url: { type: [ urlInfo ], select: true }, // 资料路径
   filename: { type: String, required: false, maxLength: 200 }, // 资料名称
   type: { type: String, required: false, maxLength: 200 }, // 资料类别
 });