set.js 555 B

12345678910111213141516171819
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 站点信息表
  5. const SetSchema = {
  6. logourl: { type: String, required: true, maxLength: 500 }, // logo图片路径
  7. content: { type: String, required: true }, // 联系信息
  8. };
  9. const schema = new Schema(SetSchema, { toJSON: { virtuals: true } });
  10. schema.index({ id: 1 });
  11. schema.plugin(metaPlugin);
  12. module.exports = app => {
  13. const { mongoose } = app;
  14. return mongoose.model('Set', schema, 'setting_set');
  15. };