|
@@ -0,0 +1,32 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+
|
|
|
+const apply = new Schema({
|
|
|
+ user_id: { type: String, required: true, maxLength: 200 }, // 用户id
|
|
|
+ user_name: { type: String, required: true, maxLength: 200 }, // 用户名称
|
|
|
+ buyer: { type: String, required: true, maxLength: 1 }, // 买家/卖家 0/1
|
|
|
+ goodsList: [ Object ],
|
|
|
+ contact: { type: String, required: true, maxLength: 200 }, // 联系人
|
|
|
+ contact_tel: { type: String, required: true, maxLength: 200 }, // 联系人电话
|
|
|
+ email: { type: String, maxLength: 200 }, // 邮箱
|
|
|
+ company: { type: String, maxLength: 200 }, // 单位名称
|
|
|
+ apply_time: { type: String, maxLength: 200 }, // 申请时间
|
|
|
+ status: { type: String, default: 0, maxLength: 1 }, // 申请状态 (0未审核;1已通过;2已拒绝)
|
|
|
+});
|
|
|
+apply.index({ id: 1 });
|
|
|
+apply.index({ userid: 1 });
|
|
|
+const Dock = {
|
|
|
+ title: { type: String, required: true, maxLength: 200 }, // 对接会标题
|
|
|
+ desc: { type: String, maxLength: 1000 }, // 简介
|
|
|
+ status: { type: String, default: '0', maxLength: 1 }, // 状态:0准备中;1已开始;2已结束
|
|
|
+ apply: { type: [ apply ], default: [] },
|
|
|
+};
|
|
|
+const schema = new Schema(Dock, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('dock', schema, 'dock');
|
|
|
+};
|