schtime.js 649 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.schtime.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 培训计划学校上报时间表管理
  7. class SchtimeController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.schtime;
  11. }
  12. async updateschtimes() {
  13. console.log(_.isArray(this.ctx.request.body));
  14. const res = await this.service.updateschtimes(this.ctx.request.body);
  15. this.ctx.ok({ msg: 'updated', data: res });
  16. }
  17. }
  18. module.exports = CrudController(SchtimeController, meta);