guhongwei 4 years ago
parent
commit
8423c4ebe0
2 changed files with 12 additions and 8 deletions
  1. 3 4
      app/controller/.imgtxtdock.js
  2. 9 4
      app/model/imgtxtdock.js

+ 3 - 4
app/controller/.imgtxtdock.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ["!name", "type", "dock_id"],
+    requestBody: ["!dock_id", "user_name", "brief", "image", "file_path"],
   },
   destroy: {
     params: ["!id"],
@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ["!id"],
-    requestBody: ["name", "type", "dock_id"],
+    requestBody: ["!dock_id", "user_name", "brief", "image", "file_path"],
   },
   show: {
     parameters: {
@@ -19,9 +19,8 @@ module.exports = {
   index: {
     parameters: {
       query: {
-        name: "name",
-        type: "type",
         dock_id: "dock_id",
+        user_name: "user_name",
       },
     },
     service: "query",

+ 9 - 4
app/model/imgtxtdock.js

@@ -2,11 +2,16 @@
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 
-// 栏目表
+const images = new Schema({
+  url: { type: String, required: true, maxLength: 500 }, // 图片路径
+});
+// 展会信息表
 const ImgtxtdockSchema = {
-  name: { type: String, required: true, maxLength: 500 }, // 名称
-  type: { type: String, required: false, maxLength: 500 }, // 类别
-  dock_id: { type: String, required: false, maxLength: 500 }, // 展会id
+  dock_id: { type: String, required: true, maxLength: 500 }, // 展会id
+  user_name: { type: String, required: false, maxLength: 500 }, // 姓名
+  brief: { type: String, required: false, maxLength: 500 }, // 信息内容
+  image: { type: [ images ], select: false }, // 图片
+  file_path: { type: String, required: false }, // 视频路径
 };