1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const { Secret } = require('naf-framework-mongoose/lib/model/schema');
- // const image = new Schema({
- // });
- // image.index({ id: 1 });
- // 产品
- const goods = new Schema({
- totaltype: { type: String, required: false, maxLength: 5 }, // 产品类型
- name: { type: String, required: false, maxLength: 200 }, // 产品名称
- product_type_id: { type: Object, required: false, maxLength: 200 }, // 类型
- introduction: { type: String, required: false, maxLength: 1000 }, // 产品简介
- phase: { type: String, required: false, maxLength: 200 }, // 研发阶段
- price: { type: String, required: false, maxLength: 200 }, // 产品单价
- priceunit: { type: String, required: false, maxLength: 200 }, // 产品单位
- image: { type: [ Object ], required: false }, // 产品图片
- field: { type: String, maxLength: 200 }, // 所属领域
- scope: { type: String, maxLength: 200 }, // 服务范围
- coopermode: { type: String, maxLength: 200 }, // 合作方式
- business: { type: String, maxLength: 200 }, // 交易方式
- budget: { type: String, maxLength: 200 }, // 投入预算
- end_date: { type: String, maxLength: 200 }, // 需求截止日期
- difficult_problem: { type: String, maxLength: 500 }, // 难题或瓶颈问题
- demand: { type: String, maxLength: 500 }, // 企业解决技术需求已具备的条件
- company: { type: String, maxLength: 200 }, // 企业名称
- address: { type: String, maxLength: 200 }, // 企业地址
- team: { type: String, maxLength: 200 }, // 技术团队情况
- property: { type: String, maxLength: 200 }, // 知识产权情况
- mature: { type: String, maxLength: 200 }, // 技术成熟度
- coopercompany: { type: String, maxLength: 200 }, // 是否拟有合同
- other: { type: String, maxLength: 200 }, // 其他需求
- contact_user: { type: String, maxLength: 200 }, // 联系人
- contact_tel: { type: String, maxLength: 200 }, // 联系电话
- dockStatus: { type: String, default: '0', maxLength: 5 }, // 0未审核,1已通过,2已拒绝
- });
- goods.index({ id: 1 });
- // 申请用户
- const apply = new Schema({
- user_id: { type: String, required: true, maxLength: 200 }, // 用户id
- user_name: { type: String, required: true, maxLength: 200 }, // 用户名称
- goodsList: { type: [ goods ], default: [] }, // 产品列表
- contact_tel: { type: String, required: false, maxLength: 200 }, // 联系人电话
- apply_time: { type: String, maxLength: 200 }, // 申请时间
- role: { type: String, maxLength: 200 }, // 申请人类型
- status: { type: String, default: '0', maxLength: 1 }, // 申请状态 (0未审核;1已通过;2已拒绝)
- });
- apply.index({ id: 1 });
- apply.index({ userid: 1 });
- // vip用户
- const vipuser = new Schema({
- uid: { type: String, required: false, maxLength: 200 }, // 用户id
- vipname: { type: String, required: false, maxLength: 200 }, // 用户名称
- vipphone: { type: String, required: false, maxLength: 200 }, // 联系人手机
- role: { type: String, required: false, maxLength: 200 }, // 申请人类型
- company: { type: String, required: false, maxLength: 500 }, // 单位名称
- email: { type: String, required: false, maxLength: 20 }, // 郵箱
- content: { type: String, required: false }, // 内容
- });
- vipuser.index({ id: 1 });
- const Dock = {
- room_id: { type: String, required: true, maxLength: 10 }, // 房间号
- password: { type: Secret, select: false }, // 密码
- title: { type: String, required: false, 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 }, // 开始时间
- end_time: { type: String, required: true, maxLength: 200 }, // 结束时间
- join_end: { type: String, required: true, maxLength: 200 }, // 报名截止时间
- apply: { type: [ apply ], default: [] }, // 申请用户
- user_id: { type: String, required: false, maxLength: 200 }, // 创建人id
- province: { type: String, required: false }, // 省
- place: { type: String, required: false }, // 市
- file_path: { type: String, required: false }, // 视频路径
- adminuser: { type: String, required: false, maxLength: 200 }, // 用户姓名
- phone: { type: String, required: false, maxLength: 200 }, // 电话
- vipuser: { type: [ vipuser ], default: [] }, // vip用户
- role: { type: String, default: '3', maxLength: 20 }, // 展会角色
- // is_allowed: { type: String, default: '0', maxLength: 1 }, // 0未审核;1已允许;2已拒绝
- // reason: { type: String, required: false, maxLength: 200 }, // 拒绝理由
- // roomname: { type: String, required: false }, // 房间名称
- // uid: { type: String, required: false, maxLength: 200 }, // 所属用户
- openid: { type: String, maxLength: 200 }, // openid
- };
- 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');
- };
|