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