applymmoney.js 874 B

123456789101112131415161718192021222324252627
  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 ApplyMmoneySchema = {
  7. qyid: { type: String, required: true, maxLength: 100}, //企业ID(企业用户的UID)
  8. jgid: { type: String, required: true,maxLength: 200 }, //金融机构ID
  9. mid: { type: String, required: true,maxLength: 200 }, //理财产品ID
  10. status: { type: String, maxLength: 200,default:'0'},//0-未关注,1-已关注,2-下架
  11. };
  12. const schema = new Schema(ApplyMmoneySchema, { toJSON: { virtuals: true } });
  13. schema.index({ qyid: 1 });
  14. schema.index({ mid: 1 });
  15. schema.plugin(metaPlugin);
  16. module.exports = app => {
  17. const { mongoose } = app;
  18. return mongoose.model('Applymmoney', schema, 'apply_mmoney');
  19. };