Browse Source

Merge branch 'master' of http://git.cc-lotus.info/new_train/service-center

liuyu 5 years ago
parent
commit
efa19bd51f
2 changed files with 12 additions and 0 deletions
  1. 9 0
      app/controller/.material.js
  2. 3 0
      app/model/material.js

+ 9 - 0
app/controller/.material.js

@@ -1,8 +1,11 @@
 module.exports = {
   create: {
     requestBody: [
+      '!title',
       '!url',
       '!type',
+      'content',
+      'tags',
       'score'
     ]
   },
@@ -13,8 +16,11 @@ module.exports = {
   update: {
     params: ['!id'],
     requestBody: [
+      'title',
       'url',
       'type',
+      'content',
+      'tags',
       'score'
     ]
   },
@@ -27,8 +33,11 @@ module.exports = {
   index: {
     parameters: {
       query: {
+        title:'title',
         url :'url',
         type :'type',
+        content:'content',
+        tags:'tags',
         score :'score'
       }
     },

+ 3 - 0
app/model/material.js

@@ -4,8 +4,11 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 
 // 上传资料表
 const MaterialSchema = {
+  title: { type: String, required: true, maxLength: 200 }, // 标题
   url: { type: String, required: true, maxLength: 200 }, // 资料链接
   type: { type: String, required: true, maxLength: 200 }, // 资料类型,0-学生学习资料,1-教师学习资料
+  content: { type: String, required: false, maxLength: 2000 }, // 简介
+  tags: [ String ], // 标签
   score: { type: String, required: false, maxLength: 200 }, // 资料得分
 };