|
@@ -0,0 +1,21 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+
|
|
|
+const NewsSchema = {
|
|
|
+ title: { type: String, required: false, maxLength: 200 }, // 标题
|
|
|
+ content: { type: String, required: false }, // 内容
|
|
|
+ filedir: { type: String, required: false }, // 封面图片
|
|
|
+ publish_time: { type: String, required: false, maxLength: 200 }, // 发布时间
|
|
|
+ type: { type: String, required: false, maxLength: 200 }, // 类型 0、会议简介 1、会议日程2、主办方介绍、3、协办方介绍4、专家介绍5、继续再教育申请表6、温馨提示
|
|
|
+ status: { type: String, required: false, maxLength: 200 }, // 0、开启1、禁用
|
|
|
+};
|
|
|
+
|
|
|
+const schema = new Schema(NewsSchema, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('News', schema, 'news');
|
|
|
+};
|