|
@@ -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 },
|
|
|
+ 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 },
|
|
|
+ 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');
|
|
|
+};
|