mission.js 649 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.mission.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 教师申请讲课表管理
  7. class MissionController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.mission;
  11. }
  12. async count() {
  13. const res = await this.service.count(this.ctx.query);
  14. this.ctx.ok({ total: res });
  15. }
  16. async progress() {
  17. await this.service.updateProgress(this.ctx.request.body);
  18. this.ctx.ok();
  19. }
  20. }
  21. module.exports = CrudController(MissionController, meta);