'use strict';

const _ = require('lodash');
const meta = require('./.class.js');
const Controller = require('egg').Controller;
const { CrudController } = require('naf-framework-mongoose/lib/controller');

// 班级管理
class ClassController extends Controller {

  constructor(ctx) {
    super(ctx);
    this.service = this.ctx.service.class;
  }

  async divide() {
    const res = await this.service.divide(this.ctx.request.body);
    this.ctx.ok({ data: res });
  }

  async notice() {
    const res = await this.service.notice(this.ctx.request.body);
    this.ctx.ok({ data: res });
  }

}

module.exports = CrudController(ClassController, meta);