lrf402788946 5 年之前
父节点
当前提交
dfcfc51313
共有 2 个文件被更改,包括 21 次插入10 次删除
  1. 19 10
      app/controller/.dock.js
  2. 2 0
      app/model/dock.js

+ 19 - 10
app/controller/.dock.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ["title", "desc"],
+    requestBody: ["title", "desc", "start_time", "join_end"],
   },
   destroy: {
     params: ["!id"],
@@ -18,7 +18,7 @@ module.exports = {
   },
   index: {
     parameters: {
-      query: ["title", "desc"],
+      query: ["title", "desc", "start_time", "join_end"],
     },
     service: "query",
     options: {
@@ -28,14 +28,23 @@ module.exports = {
       count: true,
     },
   },
-  apply:{
+  apply: {
     params: ["!id"],
-    requestBody:['user_id','user_name','buyer', 'goodsList', 'contact', 'contact_tel', 'email', 'company'],
-    service: 'apply',
+    requestBody: [
+      "user_id",
+      "user_name",
+      "buyer",
+      "goodsList",
+      "contact",
+      "contact_tel",
+      "email",
+      "company",
+    ],
+    service: "apply",
+  },
+  check: {
+    params: ["!id", "!dock_id"],
+    requestBody: ["status"],
+    service: "check",
   },
-  check:{
-    params: ["!id","!dock_id"],
-    requestBody:['status'],
-    service:'check',
-  }
 };

+ 2 - 0
app/model/dock.js

@@ -20,6 +20,8 @@ const Dock = {
   title: { type: String, required: true, maxLength: 200 }, // 对接会标题
   desc: { type: String, maxLength: 1000 }, // 简介
   status: { type: String, default: '0', maxLength: 1 }, // 状态:0准备中;1已开始;2已结束
+  start_time: { type: String, required: true, maxLength: 200 }, // 开始时间
+  join_end: { type: String, required: true, maxLength: 200 }, // 报名截止时间
   apply: { type: [ apply ], default: [] },
 };
 const schema = new Schema(Dock, { toJSON: { virtuals: true } });