|
@@ -0,0 +1,28 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+
|
|
|
+// 信息表
|
|
|
+const NewsguidanceSchema = {
|
|
|
+ dock_id: { type: String, required: false, maxLength: 500 }, // 栏目id
|
|
|
+ title: { type: String, required: false, maxLength: 500 }, // 标题
|
|
|
+ titlejj: { type: String, required: false, maxLength: 500 }, // 标题简介
|
|
|
+ orgin: { type: String, required: false, maxLength: 500 }, // 来源
|
|
|
+ publish: { type: String, required: false, maxLength: 500 }, // 发布者
|
|
|
+ publish_time: { type: String, required: false, maxLength: 500 }, // 发布时间
|
|
|
+ uid: { type: String, required: false, maxLength: 500 }, // 用户id
|
|
|
+ content: { type: String, required: false }, // 正文
|
|
|
+ picture: { type: String, required: false }, // 图片路径
|
|
|
+ filepath: { type: String, required: false }, // 文件路径
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+const schema = new Schema(NewsguidanceSchema, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.index({ dock_id: 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Newsguidance', schema, 'live_news_guidance');
|
|
|
+};
|