dock.js 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 goods = new Schema({
  7. totaltype: { type: String, required: false, maxLength: 5 }, // 产品类型
  8. name: { type: String, required: false, maxLength: 200 }, // 产品名称
  9. product_type_id: { type: Object, required: false, maxLength: 200 }, // 类型
  10. introduction: { type: String, required: false, maxLength: 1000 }, // 产品简介
  11. phase: { type: String, required: false, maxLength: 200 }, // 研发阶段
  12. price: { type: String, required: false, maxLength: 200 }, // 产品单价
  13. priceunit: { type: String, required: false, maxLength: 200 }, // 产品单位
  14. image: { type: String, required: false, maxLength: 200 }, // 产品图片
  15. field: { type: String, maxLength: 200 }, // 所属领域
  16. scope: { type: String, maxLength: 200 }, // 服务范围
  17. coopermode: { type: String, maxLength: 200 }, // 合作方式
  18. business: { type: String, maxLength: 200 }, // 交易方式
  19. budget: { type: String, default: 0, maxLength: 200 }, // 投入预算
  20. end_date: { type: String, default: 0, maxLength: 200 }, // 需求截止日期
  21. difficult_problem: { type: String, default: 0, maxLength: 500 }, // 难题或瓶颈问题
  22. demand: { type: String, default: 0, maxLength: 500 }, // 企业解决技术需求已具备的条件
  23. company: { type: String, default: 0, maxLength: 200 }, // 企业名称
  24. address: { type: String, default: 0, maxLength: 200 }, // 企业地址
  25. team: { type: String, default: 0, maxLength: 200 }, // 技术团队情况
  26. property: { type: String, default: 0, maxLength: 200 }, // 知识产权情况
  27. mature: { type: String, default: 0, maxLength: 200 }, // 技术成熟度
  28. coopercompany: { type: String, default: 0, maxLength: 200 }, // 是否拟有合同
  29. other: { type: String, default: 0, maxLength: 200 }, // 其他需求
  30. contact_user: { type: String, default: 0, maxLength: 200 }, // 联系人
  31. contact_tel: { type: String, default: 0, maxLength: 200 }, // 联系电话
  32. });
  33. goods.index({ id: 1 });
  34. // 申请用户
  35. const apply = new Schema({
  36. user_id: { type: String, required: true, maxLength: 200 }, // 用户id
  37. user_name: { type: String, required: true, maxLength: 200 }, // 用户名称
  38. buyer: { type: String, required: true, maxLength: 1 }, // 买家/卖家 0/1
  39. goodsList: { type: [ goods ], default: [] }, // 产品列表
  40. contact: { type: String, required: false, maxLength: 200 }, // 联系人
  41. contact_tel: { type: String, required: false, maxLength: 200 }, // 联系人电话
  42. email: { type: String, maxLength: 200 }, // 邮箱
  43. company: { type: String, maxLength: 200 }, // 单位名称
  44. apply_time: { type: String, maxLength: 200 }, // 申请时间
  45. role: { type: String, maxLength: 200 }, // 申请人类型
  46. status: { type: String, default: 0, maxLength: 1 }, // 申请状态 (0未审核;1已通过;2已拒绝)
  47. });
  48. apply.index({ id: 1 });
  49. apply.index({ userid: 1 });
  50. // vip用户
  51. const vipuser = new Schema({
  52. uid: { type: String, required: false, maxLength: 200 }, // 用户id
  53. vipname: { type: String, required: false, maxLength: 200 }, // 用户名称
  54. vipphone: { type: String, required: false, maxLength: 200 }, // 联系人手机
  55. role: { type: String, required: false, maxLength: 200 }, // 申请人类型
  56. company: { type: String, required: false, maxLength: 500 }, // 单位名称
  57. email: { type: String, required: false, maxLength: 20 }, // 单位名称
  58. content: { type: String, required: false }, // 单位名称
  59. });
  60. vipuser.index({ id: 1 });
  61. const Dock = {
  62. room_id: { type: String, required: true, maxLength: 10 }, // 房间号
  63. password: { type: Secret, select: false }, // 密码
  64. title: { type: String, required: false, maxLength: 200 }, // 对接会标题
  65. desc: { type: String, maxLength: 1000 }, // 简介
  66. status: { type: String, default: '0', maxLength: 1 }, // 状态:0准备中;1已开始;2已结束
  67. start_time: { type: String, required: true, maxLength: 200 }, // 开始时间
  68. end_time: { type: String, required: true, maxLength: 200 }, // 结束时间
  69. join_end: { type: String, required: true, maxLength: 200 }, // 报名截止时间
  70. apply: { type: [ apply ], default: [] }, // 申请用户
  71. user_id: { type: String, required: false, maxLength: 200 }, // 创建人id
  72. province: { type: String, required: false }, // 省
  73. place: { type: String, required: false }, // 市
  74. file_path: { type: String, required: false }, // 视频路径
  75. adminuser: { type: String, required: false, maxLength: 200 }, // 用户姓名
  76. phone: { type: String, required: false, maxLength: 200 }, // 电话
  77. vipuser: { type: [ vipuser ], default: [] }, // vip用户
  78. role: { type: String, default: '3', maxLength: 20 }, // 展会角色
  79. // is_allowed: { type: String, default: '0', maxLength: 1 }, // 0未审核;1已允许;2已拒绝
  80. // reason: { type: String, required: false, maxLength: 200 }, // 拒绝理由
  81. // roomname: { type: String, required: false }, // 房间名称
  82. // uid: { type: String, required: false, maxLength: 200 }, // 所属用户
  83. };
  84. const schema = new Schema(Dock, { toJSON: { virtuals: true } });
  85. schema.index({ id: 1 });
  86. schema.plugin(metaPlugin);
  87. module.exports = app => {
  88. const { mongoose } = app;
  89. return mongoose.model('dock', schema, 'dock');
  90. };