liuyu %!s(int64=4) %!d(string=hai) anos
pai
achega
f109840a48
Modificáronse 3 ficheiros con 21 adicións e 2 borrados
  1. 2 2
      app/controller/.room.js
  2. 18 0
      app/model/lookuser.js
  3. 1 0
      app/model/room.js

+ 2 - 2
app/controller/.room.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ["title","name", "type", "filedir", "url", "anchorid","username","status"],
+    requestBody: ["title","name", "type", "filedir", "url", "anchorid","username","status","content"],
   },
   destroy: {
     params: ["!id"],
@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ["!id"],
-    requestBody: ["title","name", "type", "filedir", "url", "anchorid","username","status"],
+    requestBody: ["title","name", "type", "filedir", "url", "anchorid","username","status","content"],
   },
   show: {
     parameters: {

+ 18 - 0
app/model/lookuser.js

@@ -0,0 +1,18 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
+
+const LookuserSchema = {
+  roomid: { type: String, required: false, maxLength: 200 }, // 房间名称
+  roomname: { type: String, required: false, maxLength: 200 }, // 房间号
+  userid: { type: String, required: false, maxLength: 200 }, // 观看用户id
+};
+
+const schema = new Schema(LookuserSchema, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.plugin(metaPlugin);
+
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Lookuser', schema, 'lookuser');
+};

+ 1 - 0
app/model/room.js

@@ -8,6 +8,7 @@ const RoomSchema = {
   type: { type: String, required: false, maxLength: 64 }, // 类型0、直播1、会议
   filedir: { type: String, required: false, maxLength: 200 }, // 封面图片
   url: { type: String, required: false, maxLength: 200 }, // 房间地址
+  content: { type: String, required: false }, // 直播简介
   anchorid: { type: String, required: false, maxLength: 200 }, // 主播id
   username: { type: String, required: false, maxLength: 200 }, // 主播名称
   status: { type: String, required: false, maxLength: 64, default: '0' }, // 状态0、开启1、关闭