guhongwei před 3 roky
rodič
revize
ec5a2ba66d

+ 0 - 43
app/controller/patent/.patent_order.js

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

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

@@ -1,13 +0,0 @@
-'use strict';
-const meta = require('./.patent_order.js');
-const Controller = require('egg').Controller;
-const { CrudController } = require('naf-framework-mongoose/lib/controller');
-
-// 交易订单
-class PatentorderController extends Controller {
-  constructor(ctx) {
-    super(ctx);
-    this.service = this.ctx.service.patent.patent_order;
-  }
-}
-module.exports = CrudController(PatentorderController, meta);

+ 0 - 21
app/model/patent/patent_order.js

@@ -1,21 +0,0 @@
-'use strict';
-const Schema = require('mongoose').Schema;
-const moment = require('moment');
-const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
-const { ObjectId } = require('mongoose').Types;
-// 交易订单表
-const patentorder = {
-  user_id: { type: ObjectId }, // 用户id
-  status: { type: String }, // 状态
-  remark: { type: String },
-};
-const schema = new Schema(patentorder, { toJSON: { virtuals: true } });
-schema.index({ id: 1 });
-schema.index({ user_id: 1 });
-schema.index({ status: 1 });
-schema.index({ 'meta.createdAt': 1 });
-schema.plugin(metaPlugin);
-module.exports = app => {
-  const { mongoose } = app;
-  return mongoose.model('PatentOrder', schema, 'patent_order');
-};

+ 0 - 1
app/router.js

@@ -75,5 +75,4 @@ module.exports = app => {
   require('./router/patent/notice')(app); // 消息通知
   require('./router/patent/sell')(app); // 交易
   require('./router/patent/purchase')(app); // 求购
-  require('./router/patent/patent_order')(app); // 交易订单
 };

+ 0 - 16
app/service/patent/patent_order.js

@@ -1,16 +0,0 @@
-'use strict';
-const { CrudService } = require('naf-framework-mongoose/lib/service');
-const { BusinessError, ErrorCode } = require('naf-core').Error;
-const { ObjectId } = require('mongoose').Types;
-const _ = require('lodash');
-const assert = require('assert');
-
-// 交易订单
-class PatentorderService extends CrudService {
-  constructor(ctx) {
-    super(ctx, 'patent_order');
-    this.model = this.ctx.model.Patent.patent_order;
-  }
-}
-
-module.exports = PatentorderService;