|
@@ -1,25 +1,30 @@
|
|
|
-'use strict';
|
|
|
-
|
|
|
-const _ = require('lodash');
|
|
|
-const meta = require('./.apply.js');
|
|
|
-const Controller = require('egg').Controller;
|
|
|
-const { CrudController } = require('naf-framework-mongoose/lib/controller');
|
|
|
-
|
|
|
-
|
|
|
-class ApplyController extends Controller {
|
|
|
- constructor(ctx) {
|
|
|
- super(ctx);
|
|
|
- this.service = this.ctx.service.apply;
|
|
|
- }
|
|
|
-
|
|
|
- async queryteacher() {
|
|
|
- const data = await this.service.queryteacher(this.ctx.request.query);
|
|
|
- this.ctx.ok({ data });
|
|
|
- }
|
|
|
- async arrange() {
|
|
|
- const data = await this.service.arrangeteacher(this.ctx.request.body);
|
|
|
- this.ctx.ok({ data });
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-module.exports = CrudController(ApplyController, meta);
|
|
|
+'use strict';
|
|
|
+
|
|
|
+const _ = require('lodash');
|
|
|
+const meta = require('./.apply.js');
|
|
|
+const Controller = require('egg').Controller;
|
|
|
+const { CrudController } = require('naf-framework-mongoose/lib/controller');
|
|
|
+
|
|
|
+
|
|
|
+class ApplyController extends Controller {
|
|
|
+ constructor(ctx) {
|
|
|
+ super(ctx);
|
|
|
+ this.service = this.ctx.service.apply;
|
|
|
+ }
|
|
|
+
|
|
|
+ async queryteacher() {
|
|
|
+ const data = await this.service.queryteacher(this.ctx.request.query);
|
|
|
+ this.ctx.ok({ data });
|
|
|
+ }
|
|
|
+ async arrange() {
|
|
|
+ const data = await this.service.arrangeteacher(this.ctx.request.body);
|
|
|
+ this.ctx.ok({ data });
|
|
|
+ }
|
|
|
+
|
|
|
+ async clearArrange() {
|
|
|
+ const data = await this.service.clearArrange(this.ctx.request.body);
|
|
|
+ this.ctx.ok({ data });
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+module.exports = CrudController(ApplyController, meta);
|