12345678910111213141516171819202122232425 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const { Secret } = require('naf-framework-mongoose/lib/model/schema');
- // 发布审核表
- const ReleaseSchema = {
- review_id: { type: String, required: true, maxLength: 200 }, // 审核人id
- product_id: { type: String, required: true, maxLength: 100 }, // 产品id
- type: { type: String, required: true, maxLength: 200 }, // 审核产品类型,0-债权产品,1-股权产品,2-债权需求,3-股权需求
- status: { type: String, required: true, maxLength: 200 }, // 0:取消发布;1:发布
- };
- const schema = new Schema(ReleaseSchema, { toJSON: { virtuals: true } });
- schema.index({ uid: 1 });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Release', schema, 'release');
- };
|