viewnews.js 764 B

123456789101112131415161718192021
  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 ViewnewsSchema = {
  7. title: { type: String, required: true, maxLength: 200 }, // 标题
  8. news: { type: String, required: true, maxLength: 200 }, // 信息内容
  9. status: { type: String, maxLength: 200,default:'0'},//0未读 1已读
  10. qyid: { type: String, required: true, maxLength: 200} // 企业ID
  11. };
  12. const schema = new Schema(ViewnewsSchema, { toJSON: { virtuals: true } });
  13. schema.plugin(metaPlugin);
  14. module.exports = app => {
  15. const { mongoose } = app;
  16. return mongoose.model('Viewnews', schema, 'viewnews');
  17. };