'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 images = new Schema({ url: { type: String, required: true, maxLength: 500 }, // 图片路径 }); // 展会视频表 const videos = new Schema({ file_path: { type: String, required: true }, // 视频路径 videointro: { type: String, required: false, maxLength: 200 }, // 视频文件标题 videointroinfo: { type: String, required: false, maxLength: 200 }, // 视频文件简介 }); // const image = new Schema({ // }); // image.index({ id: 1 }); // 产品 const goods = new Schema({ userid: { type: String, required: false, maxLength: 500 }, // 创建人id is_del: { type: String, required: false, maxLength: 200 }, // 是否删除,0-否,1-是 type: { type: String, required: false, maxLength: 200 }, // 类型: 0-技术;1-成果;2-服务 name: { type: String, required: false, maxLength: 200 }, // 名称 contacts: { type: String, required: false, maxLength: 200 }, // 联系人 phone: { type: String, required: false, maxLength: 11 }, // 联系电话 qqwx: { type: String, required: false, maxLength: 200 }, // qq&微信 email: { type: String, required: false, maxLength: 200 }, // 邮箱 // 技术方面字段 degreeurgency: { type: String, required: false, maxLength: 200 }, // 需求紧急程度 requirementdesc: { type: String, required: false, maxLength: 500 }, // 及时难题&需求说明 expect: { type: String, required: false, maxLength: 300 }, // 预期技术目标描述 budget: { type: String, required: false, maxLength: 300 }, // 投资预算, companytype: { type: String, required: false, maxLength: 300 }, // 注册类型 zzjgdm: { type: String, required: false, maxLength: 300 }, // 组织机构代码 companydate: { type: String, required: false, maxLength: 300 }, // 注册时间 companycapital: { type: String, required: false, maxLength: 300 }, // 注册资金 companyperson: { type: String, required: false, maxLength: 300 }, // 企业法人 sndqyzsr: { type: String, required: false, maxLength: 300 }, // 上年度企业总收入 sndyffy: { type: String, required: false, maxLength: 300 }, // 上年度研发费用 companytotal: { type: String, required: false, maxLength: 300 }, // 企业总人数 zjzyfrs: { type: String, required: false, maxLength: 300 }, // 专&兼职研发人数 mainproduct: { type: String, required: false, maxLength: 300 }, // 主要产品 qualifications: { type: String, required: false, maxLength: 300 }, // 企业资质&荣誉 // 产品方面字段 achievebrief: { type: String, required: false, maxLength: 200 }, // 成果简介, features: { type: String, required: false, maxLength: 200 }, // 技术特点, team: { type: String, required: false, maxLength: 300 }, // 技术团队, achievestatus: { type: String, required: false, maxLength: 200 }, // 成果状态, achieveown: { type: String, required: false, maxLength: 200 }, // 成果权属, achievesource: { type: String, required: false, maxLength: 200 }, // 成果来源, patentinfo: { type: String, required: false, maxLength: 200 }, // 专利信息, patentstatus: { type: String, required: false, maxLength: 200 }, // 专利状态, expectations: { type: String, required: false, maxLength: 300 }, // 商业预期, roadshow: { type: String, required: false, maxLength: 200 }, // 项目路演, intentionprice: { type: String, required: false, maxLength: 200 }, // 意向价格, // 技术,产品方面共同字段 field: { type: String, required: false, maxLength: 500 }, // 所属领域 cooperation: { type: String, required: false, maxLength: 500 }, // 合作方式 company: { type: String, required: false, maxLength: 500 }, // 单位名称 companybrief: { type: String, required: false }, // 企业简介 companyweb: { type: String, required: false, maxLength: 2000 }, // 企业网站 condition: { type: String, required: false, maxLength: 300 }, // 合作条件及要求 // image: { type: [ String ], required: false, maxLength: 200 }, // 图片 image: { type: [ images ], select: true }, // 图片 // 商务方面字段 messattribute: { type: String, required: false, maxLength: 200 }, // 信息属性 demand: { type: String, required: false, maxLength: 200 }, // 需求程度 informationdesc: { type: String, required: false, maxLength: 200 }, // 信息描述 coreelements: { type: String, required: false, maxLength: 200 }, // 核心要素 priceinfo: { type: String, required: false, maxLength: 200 }, // 价格信息 businessexpect: { type: String, required: false, 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 }, // 申请人类型 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 }, // 市 videodata: { type: [ videos ], select: true }, // 视频路径 adminuser: { type: String, required: false, maxLength: 200 }, // 用户姓名 phone: { type: String, required: false, maxLength: 200 }, // 电话 vipuser: { type: [ vipuser ], default: [] }, // vip用户 sponsor: { type: String, required: false, maxLength: 200 }, // 主办方 organizer: { type: String, required: false, maxLength: 200 }, // 承办方 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'); };