guhongwei 4 年之前
父节点
当前提交
9fabdeed57
共有 2 个文件被更改,包括 10 次插入8 次删除
  1. 3 3
      app/controller/.channel.js
  2. 7 5
      app/model/channel.js

+ 3 - 3
app/controller/.channel.js

@@ -9,7 +9,7 @@ module.exports = {
       "sponsor",
       "organizer",
       "image_path",
-      "video_path",
+      "videodata",
     ],
   },
   destroy: {
@@ -27,7 +27,7 @@ module.exports = {
       "sponsor",
       "organizer",
       "image_path",
-      "video_path",
+      "videodata",
     ],
   },
   show: {
@@ -47,7 +47,7 @@ module.exports = {
         sponsor: "sponsor",
         organizer: "organizer",
         image_path: "image_path",
-        video_path: "video_path",
+        videodata: "videodata",
       },
     },
     service: "query",

+ 7 - 5
app/model/channel.js

@@ -2,10 +2,12 @@
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 const { Secret } = require('naf-framework-mongoose/lib/model/schema');
-// // 产品图片表
-// const images = new Schema({
-//   url: { type: String, required: true, maxLength: 500 }, // 图片路径
-// });
+// 产品图片表
+const videos = new Schema({
+  start_time: { type: String, required: true, maxLength: 200 }, // 开始时间
+  end_time: { type: String, required: true, maxLength: 200 }, // 结束时间
+  url: { type: String, required: true, maxLength: 500 }, // 视频路径
+});
 
 const Channel = {
   user_id: { type: String, required: false, maxLength: 200 }, // 创建人id
@@ -16,7 +18,7 @@ const Channel = {
   sponsor: { type: String, required: false, maxLength: 200 }, // 主办方
   organizer: { type: String, required: false, maxLength: 200 }, // 承办方
   image_path: { type: String, required: false }, // 图片路径
-  video_path: { type: String, required: false }, // 视频路径
+  videodata: { type: [ videos ], default: [] }, // vip用户
 };
 const schema = new Schema(Channel, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });