dock.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const { Secret } = require('naf-framework-mongoose/lib/model/schema');
  5. // 产品图片表
  6. const images = new Schema({
  7. url: { type: String, required: true, maxLength: 500 }, // 图片路径
  8. });
  9. // 展会视频表
  10. const videos = new Schema({
  11. file_path: { type: String, required: true }, // 视频路径
  12. videointro: { type: String, required: false, maxLength: 200 }, // 视频文件标题
  13. videointroinfo: { type: String, required: false, maxLength: 200 }, // 视频文件简介
  14. });
  15. // const image = new Schema({
  16. // });
  17. // image.index({ id: 1 });
  18. // 产品
  19. const goods = new Schema({
  20. userid: { type: String, required: false, maxLength: 500 }, // 创建人id
  21. is_del: { type: String, required: false, maxLength: 200 }, // 是否删除,0-否,1-是
  22. type: { type: String, required: false, maxLength: 200 }, // 类型: 0-技术;1-成果;2-服务
  23. name: { type: String, required: false, maxLength: 200 }, // 名称
  24. contacts: { type: String, required: false, maxLength: 200 }, // 联系人
  25. phone: { type: String, required: false, maxLength: 11 }, // 联系电话
  26. qqwx: { type: String, required: false, maxLength: 200 }, // qq&微信
  27. email: { type: String, required: false, maxLength: 200 }, // 邮箱
  28. // 技术方面字段
  29. degreeurgency: { type: String, required: false, maxLength: 200 }, // 需求紧急程度
  30. requirementdesc: { type: String, required: false, maxLength: 500 }, // 及时难题&需求说明
  31. expect: { type: String, required: false, maxLength: 300 }, // 预期技术目标描述
  32. budget: { type: String, required: false, maxLength: 300 }, // 投资预算,
  33. companytype: { type: String, required: false, maxLength: 300 }, // 注册类型
  34. zzjgdm: { type: String, required: false, maxLength: 300 }, // 组织机构代码
  35. companydate: { type: String, required: false, maxLength: 300 }, // 注册时间
  36. companycapital: { type: String, required: false, maxLength: 300 }, // 注册资金
  37. companyperson: { type: String, required: false, maxLength: 300 }, // 企业法人
  38. sndqyzsr: { type: String, required: false, maxLength: 300 }, // 上年度企业总收入
  39. sndyffy: { type: String, required: false, maxLength: 300 }, // 上年度研发费用
  40. companytotal: { type: String, required: false, maxLength: 300 }, // 企业总人数
  41. zjzyfrs: { type: String, required: false, maxLength: 300 }, // 专&兼职研发人数
  42. mainproduct: { type: String, required: false, maxLength: 300 }, // 主要产品
  43. qualifications: { type: String, required: false, maxLength: 300 }, // 企业资质&荣誉
  44. // 产品方面字段
  45. achievebrief: { type: String, required: false, maxLength: 200 }, // 成果简介,
  46. features: { type: String, required: false, maxLength: 200 }, // 技术特点,
  47. team: { type: String, required: false, maxLength: 300 }, // 技术团队,
  48. achievestatus: { type: String, required: false, maxLength: 200 }, // 成果状态,
  49. achieveown: { type: String, required: false, maxLength: 200 }, // 成果权属,
  50. achievesource: { type: String, required: false, maxLength: 200 }, // 成果来源,
  51. patentinfo: { type: String, required: false, maxLength: 200 }, // 专利信息,
  52. patentstatus: { type: String, required: false, maxLength: 200 }, // 专利状态,
  53. expectations: { type: String, required: false, maxLength: 300 }, // 商业预期,
  54. roadshow: { type: String, required: false, maxLength: 200 }, // 项目路演,
  55. intentionprice: { type: String, required: false, maxLength: 200 }, // 意向价格,
  56. // 技术,产品方面共同字段
  57. field: { type: String, required: false, maxLength: 500 }, // 所属领域
  58. cooperation: { type: String, required: false, maxLength: 500 }, // 合作方式
  59. company: { type: String, required: false, maxLength: 500 }, // 单位名称
  60. companybrief: { type: String, required: false }, // 企业简介
  61. companyweb: { type: String, required: false, maxLength: 2000 }, // 企业网站
  62. condition: { type: String, required: false, maxLength: 300 }, // 合作条件及要求
  63. // image: { type: [ String ], required: false, maxLength: 200 }, // 图片
  64. image: { type: [ images ], select: true }, // 图片
  65. // 商务方面字段
  66. messattribute: { type: String, required: false, maxLength: 200 }, // 信息属性
  67. demand: { type: String, required: false, maxLength: 200 }, // 需求程度
  68. informationdesc: { type: String, required: false, maxLength: 200 }, // 信息描述
  69. coreelements: { type: String, required: false, maxLength: 200 }, // 核心要素
  70. priceinfo: { type: String, required: false, maxLength: 200 }, // 价格信息
  71. businessexpect: { type: String, required: false, maxLength: 200 }, // 商务预期
  72. dockStatus: { type: String, default: '0', maxLength: 5 }, // 0未审核,1已通过,2已拒绝
  73. });
  74. goods.index({ id: 1 });
  75. // 申请用户
  76. const apply = new Schema({
  77. user_id: { type: String, required: true, maxLength: 200 }, // 用户id
  78. user_name: { type: String, required: true, maxLength: 200 }, // 用户名称
  79. goodsList: { type: [ goods ], default: [] }, // 产品列表
  80. contact_tel: { type: String, required: false, maxLength: 200 }, // 联系人电话
  81. apply_time: { type: String, maxLength: 200 }, // 申请时间
  82. role: { type: String, maxLength: 200 }, // 申请人类型
  83. status: { type: String, default: '0', maxLength: 1 }, // 申请状态 (0未审核;1已通过;2已拒绝)
  84. });
  85. apply.index({ id: 1 });
  86. apply.index({ userid: 1 });
  87. // vip用户
  88. const vipuser = new Schema({
  89. uid: { type: String, required: false, maxLength: 200 }, // 用户id
  90. vipname: { type: String, required: false, maxLength: 200 }, // 用户名称
  91. vipphone: { type: String, required: false, maxLength: 200 }, // 联系人手机
  92. role: { type: String, required: false, maxLength: 200 }, // 申请人类型
  93. email: { type: String, required: false, maxLength: 20 }, // 郵箱
  94. content: { type: String, required: false }, // 内容
  95. });
  96. vipuser.index({ id: 1 });
  97. const Dock = {
  98. room_id: { type: String, required: true, maxLength: 10 }, // 房间号
  99. password: { type: Secret, select: false }, // 密码
  100. title: { type: String, required: false, maxLength: 200 }, // 对接会标题
  101. desc: { type: String, maxLength: 1000 }, // 简介
  102. status: { type: String, default: '0', maxLength: 1 }, // 状态:0准备中;1已开始;2已结束
  103. start_time: { type: String, required: true, maxLength: 200 }, // 开始时间
  104. end_time: { type: String, required: true, maxLength: 200 }, // 结束时间
  105. join_end: { type: String, required: true, maxLength: 200 }, // 报名截止时间
  106. apply: { type: [ apply ], default: [] }, // 申请用户
  107. user_id: { type: String, required: false, maxLength: 200 }, // 创建人id
  108. province: { type: String, required: false }, // 省
  109. place: { type: String, required: false }, // 市
  110. videodata: { type: [ videos ], select: true }, // 视频路径
  111. adminuser: { type: String, required: false, maxLength: 200 }, // 用户姓名
  112. phone: { type: String, required: false, maxLength: 200 }, // 电话
  113. vipuser: { type: [ vipuser ], default: [] }, // vip用户
  114. sponsor: { type: String, required: false, maxLength: 200 }, // 主办方
  115. organizer: { type: String, required: false, maxLength: 200 }, // 承办方
  116. role: { type: String, default: '3', maxLength: 20 }, // 展会角色
  117. // is_allowed: { type: String, default: '0', maxLength: 1 }, // 0未审核;1已允许;2已拒绝
  118. // reason: { type: String, required: false, maxLength: 200 }, // 拒绝理由
  119. // roomname: { type: String, required: false }, // 房间名称
  120. // uid: { type: String, required: false, maxLength: 200 }, // 所属用户
  121. openid: { type: String, maxLength: 200 }, // openid
  122. };
  123. const schema = new Schema(Dock, { toJSON: { virtuals: true } });
  124. schema.index({ id: 1 });
  125. schema.plugin(metaPlugin);
  126. module.exports = app => {
  127. const { mongoose } = app;
  128. return mongoose.model('dock', schema, 'dock');
  129. };