123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- '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 searchDate() {
- const res = await this.service.searchDate(this.ctx.query);
- this.ctx.ok({ data: res });
- }
- }
- module.exports = CrudController(ClassController, meta);
|