guhongwei 3 年之前
父節點
當前提交
2f3d389544

+ 0 - 58
app/controller/patent/.patent_room.js

@@ -1,58 +0,0 @@
-module.exports = {
-  create: {
-    requestBody: [
-      "time_id",
-      "p1_id",
-      "p1",
-      "p2_id",
-      "p2",
-      "create_time",
-      "last_time",
-    ],
-  },
-  destroy: {
-    params: ["!id"],
-    service: "delete",
-  },
-  update: {
-    params: ["!id"],
-    requestBody: [
-      "time_id",
-      "p1_id",
-      "p1",
-      "p2_id",
-      "p2",
-      "create_time",
-      "last_time",
-    ],
-  },
-  show: {
-    parameters: {
-      params: ["!id"],
-    },
-    service: "fetch",
-  },
-  index: {
-    parameters: {
-      query: {
-        time_id: "time_id",
-        p1_id: "p1_id",
-        p1: "p1",
-        p2_id: "p2_id",
-        p2: "p2",
-        create_time: "create_time",
-        last_time: "last_time",
-      },
-      // options: {
-      //   "meta.state": 0 // 默认条件
-      // },
-    },
-    service: "query",
-    options: {
-      query: ["skip", "limit"],
-      sort: ["meta.createdAt"],
-      desc: true,
-      count: true,
-    },
-  },
-};

+ 0 - 13
app/controller/patent/patent_room.js

@@ -1,13 +0,0 @@
-'use strict';
-const meta = require('./.patent_room.js');
-const Controller = require('egg').Controller;
-const { CrudController } = require('naf-framework-mongoose/lib/controller');
-
-// 房间表
-class Patent_roomController extends Controller {
-  constructor(ctx) {
-    super(ctx);
-    this.service = this.ctx.service.Patent.PatentRoom;
-  }
-}
-module.exports = CrudController(Patent_roomController, meta);

+ 0 - 27
app/model/patent/patent_room.js

@@ -1,27 +0,0 @@
-'use strict';
-const Schema = require('mongoose').Schema;
-const moment = require('moment');
-const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
-const { Secret } = require('naf-framework-mongoose/lib/model/schema');
-const { ObjectId } = require('mongoose').Types;
-// 专利资讯服务房间表
-const patent_room = {
-  time_id: { type: ObjectId }, // 时间id
-  p1_id: { type: ObjectId, required: true }, // 第一个人id
-  p1: { type: String, required: false }, // 第一个人名
-  p2_id: { type: ObjectId, required: true }, // 第二个人id
-  p2: { type: String, required: false }, // 第二个人名
-  create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
-  last_time: { type: String }, // 最后发言时间
-};
-const schema = new Schema(patent_room, { toJSON: { virtuals: true } });
-schema.index({ id: 1 });
-schema.index({ time_id: 1 });
-schema.index({ p1_id: 1 });
-schema.index({ p2_id: 1 });
-schema.index({ 'meta.createdAt': 1 });
-schema.plugin(metaPlugin);
-module.exports = app => {
-  const { mongoose } = app;
-  return mongoose.model('Patent_room', schema, 'patent_room');
-};

+ 0 - 2
app/router.js

@@ -77,6 +77,4 @@ module.exports = app => {
   require('./router/patent/purchase')(app); // 求购
   require('./router/patent/tradeorder')(app); // 交易订单
   // 2021-08-20-重定义
-  require('./router/patent/patent_room')(app); // 房间表
-
 };

+ 0 - 13
app/router/patent/patent_room.js

@@ -1,13 +0,0 @@
-'use strict';
-
-
-module.exports = app => {
-  const { router, controller } = app;
-  const profix = '/api/live/';
-  const vision = 'v0';
-  const index = 'patent';
-  const target = 'patentRoom';
-  const metaTime = app.middleware.createTime();
-  router.resources(target, `${profix}${vision}/${index}/${target}`, metaTime, controller[index][target]); // index、create、show、destroy
-  router.post(target, `${profix}${vision}/${index}/${target}/update/:id`, controller[index][target].update);
-};

+ 0 - 15
app/service/patent/patent_room.js

@@ -1,15 +0,0 @@
-'use strict';
-const { CrudService } = require('naf-framework-mongoose/lib/service');
-const { BusinessError, ErrorCode } = require('naf-core').Error;
-const _ = require('lodash');
-const assert = require('assert');
-
-// 房间表
-class Patent_roomService extends CrudService {
-  constructor(ctx) {
-    super(ctx, 'patent_room');
-    this.model = this.ctx.model.Patent.PatentRoom;
-  }
-}
-
-module.exports = Patent_roomService;