guhongwei 4 years ago
parent
commit
af37974b1d

+ 0 - 34
app/controller/.imgtxtdocks.js

@@ -1,34 +0,0 @@
-module.exports = {
-  create: {
-    requestBody: ["!dock_id", "user_name", "brief", "image"],
-  },
-  destroy: {
-    params: ["!id"],
-    service: "delete",
-  },
-  update: {
-    params: ["!id"],
-    requestBody: ["!dock_id", "user_name", "brief", "image"],
-  },
-  show: {
-    parameters: {
-      params: ["!id"],
-    },
-    service: "fetch",
-  },
-  index: {
-    parameters: {
-      query: {
-        dock_id: "dock_id",
-        user_name: "user_name",
-      },
-    },
-    service: "query",
-    options: {
-      query: ["skip", "limit"],
-      sort: ["meta.createdAt"],
-      desc: true,
-      count: true,
-    },
-  },
-};

+ 0 - 16
app/controller/imgtxtdocks.js

@@ -1,16 +0,0 @@
-'use strict';
-
-const _ = require('lodash');
-const meta = require('./.imgtxtdocks.js');
-const Controller = require('egg').Controller;
-const { CrudController } = require('naf-framework-mongoose/lib/controller');
-
-// 科目管理
-class ImgtxtdocksController extends Controller {
-  constructor(ctx) {
-    super(ctx);
-    this.service = this.ctx.service.imgtxtdocks;
-  }
-}
-
-module.exports = CrudController(ImgtxtdocksController, meta);

+ 0 - 24
app/model/imgtxtdocks.js

@@ -1,24 +0,0 @@
-'use strict';
-const Schema = require('mongoose').Schema;
-const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
-// 图片数组
-const images = new Schema({
-  url: { type: String, required: true }, // 图片路径
-});
-// 展会信息表
-const ImgtxtdocksSchema = {
-  dock_id: { type: String, required: true, maxLength: 500 }, // 展会id
-  user_name: { type: String, required: false, maxLength: 500 }, // 发言人
-  brief: { type: String, required: false, maxLength: 500 }, // 发言文字内容
-  image: { type: [ images ], select: true }, // 图片
-};
-
-
-const schema = new Schema(ImgtxtdocksSchema, { toJSON: { virtuals: true } });
-schema.index({ id: 1 });
-schema.plugin(metaPlugin);
-
-module.exports = app => {
-  const { mongoose } = app;
-  return mongoose.model('Imgtxtdocks', schema, 'imgtxtdocks');
-};

+ 0 - 4
app/router.js

@@ -110,8 +110,4 @@ module.exports = app => {
   router.resources('flower', '/api/live/flower', controller.flower); // index、create、show、destroy
   router.post('flower', '/api/live/flower/update/:id', controller.flower.update);
 
-  // 展会图文直播表
-  router.resources('imgtxtdocks', '/api/live/imgtxtdocks', controller.imgtxtdocks); // index、create、show、destroy
-  router.post('imgtxtdocks', '/api/live/imgtxtdocks/update/:id', controller.imgtxtdocks.update);
-
 };

+ 0 - 17
app/service/imgtxtdocks.js

@@ -1,17 +0,0 @@
-'use strict';
-
-
-const assert = require('assert');
-const _ = require('lodash');
-const { ObjectId } = require('mongoose').Types;
-const { CrudService } = require('naf-framework-mongoose/lib/service');
-const { BusinessError, ErrorCode } = require('naf-core').Error;
-
-class ImgtxtdocksService extends CrudService {
-  constructor(ctx) {
-    super(ctx, 'imgtxtdocks');
-    this.model = this.ctx.model.Imgtxtdocks;
-  }
-}
-
-module.exports = ImgtxtdockServices;