release.js 920 B

12345678910111213141516171819202122232425
  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 ReleaseSchema = {
  7. review_id: { type: String, required: true, maxLength: 200 }, // 审核人id
  8. product_id: { type: String, required: true, maxLength: 100 }, // 产品id
  9. type: { type: String, required: true, maxLength: 200 }, // 审核产品类型,0-债权产品,1-股权产品,2-债权需求,3-股权需求
  10. status: { type: String, required: true, maxLength: 200 }, // 0:取消发布;1:发布
  11. };
  12. const schema = new Schema(ReleaseSchema, { toJSON: { virtuals: true } });
  13. schema.index({ uid: 1 });
  14. schema.index({ id: 1 });
  15. schema.plugin(metaPlugin);
  16. module.exports = app => {
  17. const { mongoose } = app;
  18. return mongoose.model('Release', schema, 'release');
  19. };