stockneed.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  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 StockNeedSchema = {
  7. title: { type: String, required: true, maxLength: 200 }, // 项目名称
  8. stock_give: { type: String, required: true, maxLength: 100}, //让出股权
  9. stock_money: { type: Number, required: true, maxLength: 200 }, // 融资金额
  10. rz_id: { type: String, required: true, maxLength: 200 }, // 融资轮次id
  11. persion_name: { type: String, required: true, maxLength: 500 }, //联系人姓名
  12. persion_phone: { type: String, required: true, maxLength: 500 }, //联系人手机号码
  13. work_id: { type: String, required: true, maxLength: 200 }, //所属行业ID
  14. stock_news: { type: String}, //需求详情
  15. pro_book: { type: String,required: true, maxLength: 200} , //商业规划书(上传文件URL)
  16. jg_id: { type: String, maxLength: 200 ,default:'0'}, //金融机构ID(非定向默认为:0)
  17. userid: { type: String, required: true, maxLength: 200},//企业表种的UID
  18. status: { type: String, maxLength: 200,default:'0'}//0 存在 1 删除
  19. };
  20. const schema = new Schema(StockNeedSchema, { toJSON: { virtuals: true } });
  21. schema.index({ userid: 1 });
  22. schema.index({ work_id: 1 });
  23. schema.index({ jg_id: 1 });
  24. schema.plugin(metaPlugin);
  25. module.exports = app => {
  26. const { mongoose } = app;
  27. return mongoose.model('Stockneed', schema, 'stock_need');
  28. };