|
@@ -0,0 +1,22 @@
|
|
|
+'use strict';
|
|
|
+
|
|
|
+const _ = require('lodash');
|
|
|
+const Controller = require('egg').Controller;
|
|
|
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
|
|
|
+
|
|
|
+// 共通方法管理
|
|
|
+class CommonController extends Controller {
|
|
|
+
|
|
|
+ constructor(ctx) {
|
|
|
+ super(ctx);
|
|
|
+ this.service = this.ctx.service.util;
|
|
|
+ }
|
|
|
+
|
|
|
+ async findone() {
|
|
|
+ const data = await this.service.findone(this.ctx.params, this.ctx.request.query);
|
|
|
+ this.ctx.ok({ data });
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+module.exports = CommonController;
|