dock.js 7.7 KB

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