|
@@ -3,15 +3,16 @@ const Schema = require('mongoose').Schema;
|
|
|
const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
|
|
|
|
|
|
-// 测试接口
|
|
|
-const test = {
|
|
|
+// 节目表
|
|
|
+const program = {
|
|
|
+ type: { type: String, required: false, zh: '节目类型' }, //
|
|
|
name: { type: String, required: false, zh: '名称' }, //
|
|
|
brief: { type: String, required: false, zh: '简介' }, //
|
|
|
path: { type: String, required: false, zh: '视频流' }, //
|
|
|
is_use: { type: String, required: false, zh: '是否启用', default: '0' }, //
|
|
|
sort: { type: Number, required: false, zh: '排序', default: 1 }, //
|
|
|
};
|
|
|
-const schema = new Schema(test, { toJSON: { getters: true, virtuals: true } });
|
|
|
+const schema = new Schema(program, { toJSON: { getters: true, virtuals: true } });
|
|
|
schema.index({ id: 1 });
|
|
|
schema.index({ 'meta.createdAt': 1 });
|
|
|
schema.index({ name: 1 });
|
|
@@ -23,5 +24,5 @@ schema.plugin(metaPlugin);
|
|
|
|
|
|
module.exports = app => {
|
|
|
const { mongoose } = app;
|
|
|
- return mongoose.model('Test', schema, 'test');
|
|
|
+ return mongoose.model('Program', schema, 'program');
|
|
|
};
|