yjyconnect.js 737 B

1234567891011121314151617181920
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 云就业关联
  5. const YjyconnectSchema = {
  6. ycode: { type: String, required: true, maxLength: 200 }, // 云就业标识
  7. yorg: { type: String, required: true, maxLength: 200 }, // 云就业机构
  8. ytype: { type: String, required: true }, // 云就业身份标识
  9. suid: { type: String, required: true, maxLength: 200 }, // 双困生用户表id
  10. };
  11. const schema = new Schema(YjyconnectSchema, { toJSON: { virtuals: true } });
  12. schema.index({ id: 1 });
  13. schema.plugin(metaPlugin);
  14. module.exports = app => {
  15. const { mongoose } = app;
  16. return mongoose.model('Yjyconnect', schema, 'yjyconnect');
  17. };