guhongwei 2 năm trước cách đây
mục cha
commit
7cfcb0af31
2 tập tin đã thay đổi với 10 bổ sung3 xóa
  1. 5 2
      app/controller/config/.test.js
  2. 5 1
      app/model/test.js

+ 5 - 2
app/controller/config/.test.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ["name", "brief"],
+    requestBody: ["name", "brief", "path", "is_use"],
   },
   destroy: {
     params: ["!id"],
@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ["!id"],
-    requestBody: ["name", "brief"],
+    requestBody: ["name", "brief", "path", "is_use"],
   },
   show: {
     parameters: {
@@ -22,6 +22,9 @@ module.exports = {
         "meta.createdAt@start": "meta.createdAt@start",
         "meta.createdAt@end": "meta.createdAt@end",
         name: "name",
+        brief: "brief",
+        path: "path",
+        is_use: "is_use",
       },
       // options: {
       //   "meta.state": 0 // 默认条件

+ 5 - 1
app/model/test.js

@@ -7,12 +7,16 @@ const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
 const test = {
   name: { type: String, required: false, zh: '名称' }, //
   brief: { type: String, required: false, zh: '简介' }, //
+  path: { type: String, required: false, zh: '视频流' }, //
+  is_use: { type: String, required: false, zh: '是否启用', default: '0' }, //
 };
 const schema = new Schema(test, { toJSON: { getters: true, virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ name: 1 });
-
+schema.index({ brief: 1 });
+schema.index({ path: 1 });
+schema.index({ is_use: 1 });
 schema.plugin(metaPlugin);
 
 module.exports = app => {