lesson.js 741 B

123456789101112131415161718192021222324252627282930
  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. // 根据计划id与教师id查出班级和课程信息
  18. async classbyteaid() {
  19. const data = await this.service.classbyteaid(this.ctx.request.query);
  20. this.ctx.ok({ data });
  21. }
  22. }
  23. module.exports = CrudController(LessonController, meta);