1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- '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 });
- }
- async uptea() {
- const res = await this.service.uptea(this.ctx.request.body);
- this.ctx.ok({ data: res });
- }
- // 根据班级id与学生id修改学生班级
- async studentupclass() {
- const res = await this.service.studentupclass(
- this.ctx.params,
- this.ctx.request.body
- );
- this.ctx.ok({ data: res });
- }
- async upclasses() {
- const res = await this.service.upclasses(this.ctx.request.body);
- this.ctx.ok({ msg: 'ok', data: res });
- }
- async classinfo() {
- const res = await this.service.classinfo(this.ctx.params);
- this.ctx.ok({ msg: 'ok', data: res });
- }
- }
- module.exports = CrudController(ClassController, meta);
|