'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 FinanceFollowSchema = { finceType: { type: String, required: true, maxLength: 200 }, //0:债权;1:股权 finceId: { type: String, required: true, maxLength: 100}, //需求ID userid: { type: String, required: true, maxLength: 200 }, //金融机构ID uuid: { type: String, maxLength: 200 }, //客户经理ID accept_time: { type: Number, maxLength: 200 }, //受理时间(授信时间-创建时间) 期望利率范围(大) credit_money: { type: Number, maxLength: 200 }, //授信额度 credit_time: { type: Number}, //授信时间(时间戳) orcredit: { type: String, required: true},//是否授信(0:未授信已关注;1:已授信; 2:审核; 3:尽调) senhemessage: { type: String,maxLength: 200 }, //审核信息 jindiaomessage: { type: String,maxLength: 200 }, //拒绝信息 sxcpname: { type: String,maxLength: 200 }, //授信产品名称 sxhowlong: { type: String,maxLength: 200 }, //授信期限 sxcplilue: { type: String,maxLength: 200 }, //授信产品利率 }; const schema = new Schema(FinanceFollowSchema, { toJSON: { virtuals: true } }); schema.index({ userid: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Financefollow', schema, 't_finance_follow'); };