lesson.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. // 根据计划id与教师id查出班级和课程信息
  23. async teaclass() {
  24. const data = await this.service.teaclass(this.ctx.request.query);
  25. this.ctx.ok({ data });
  26. }
  27. async uplessones() {
  28. const res = await this.service.uplessones(this.ctx.request.body);
  29. this.ctx.ok({ msg: "ok", data: res });
  30. }
  31. }
  32. module.exports = CrudController(LessonController, meta);