Browse Source

Merge branch 'master' of http://git.cc-lotus.info/service-platform/service-live

liuyu 5 years ago
parent
commit
d14b1676b0
5 changed files with 34 additions and 13 deletions
  1. 26 12
      app/controller/.dock.js
  2. 1 0
      app/controller/.room.js
  3. 1 1
      app/controller/room.js
  4. 5 0
      app/model/dock.js
  5. 1 0
      app/model/room.js

+ 26 - 12
app/controller/.dock.js

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

+ 1 - 0
app/controller/.room.js

@@ -1,3 +1,4 @@
+//弃用
 module.exports = {
   create: {
     requestBody: [

+ 1 - 1
app/controller/room.js

@@ -1,5 +1,5 @@
 'use strict';
-
+// 弃用
 // const _ = require('lodash');
 const meta = require('./.room.js');
 const Controller = require('egg').Controller;

+ 5 - 0
app/model/dock.js

@@ -20,7 +20,12 @@ 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: [] },
+  is_allowed: { type: String, default: '0', maxLength: 1 }, // 0未审核;1已允许;2已拒绝
+  reason: { type: String, required: true, maxLength: 200 }, // 拒绝理由
+  user_id: { type: String, required: true, maxLength: 200 }, // 申请用户
 };
 const schema = new Schema(Dock, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });

+ 1 - 0
app/model/room.js

@@ -1,4 +1,5 @@
 'use strict';
+// 弃用
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');