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