tCooperativeOrganization.js 759 B

1234567891011121314151617181920
  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 TCooperativeOrganizationSchema = {
  7. type: { type: String, required: true }, // 类型,1-银行,2-担保,3-创投,4-协会,5-金融科技,6-非银行金融机构
  8. image: { type: String, required: true }, // 图片
  9. };
  10. const schema = new Schema(TCooperativeOrganizationSchema, { toJSON: { virtuals: true } });
  11. schema.index({ id: 1 });
  12. schema.plugin(metaPlugin);
  13. module.exports = app => {
  14. const { mongoose } = app;
  15. return mongoose.model('TCooperativeOrganization', schema, 't_cooperative_organization');
  16. };