|
@@ -0,0 +1,21 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
+const { ObjectId } = require('mongoose').Types;
|
|
|
+// 版本表
|
|
|
+const version = {
|
|
|
+ name: { type: String }, // 名称
|
|
|
+ place_id: { type: String }, // 场馆id
|
|
|
+ points: { type: Array, default: [] }, // 标记列表
|
|
|
+ floor: { type: Array, deafult: [] }, // 楼层,室内外列表,手动编辑,供标记列表选择,页面选择性渲染
|
|
|
+ remark: { type: String },
|
|
|
+};
|
|
|
+const schema = new Schema(version, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.index({ place_id: 1 });
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Version', schema, 'version');
|
|
|
+};
|