lesson.js 552 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.lesson.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 课程表管理
  7. class LessonController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.lesson;
  11. }
  12. // 自动排课
  13. async autolesson() {
  14. const res = await this.service.autolesson(this.ctx.params);
  15. this.ctx.ok({ res });
  16. }
  17. }
  18. module.exports = CrudController(LessonController, meta);