'use strict'; const _ = require('lodash'); const meta = require('./.student.js'); const Controller = require('egg').Controller; const { CrudController } = require('naf-framework-mongoose/lib/controller'); // 学生管理 class StudentController extends Controller { constructor(ctx) { super(ctx); this.service = this.ctx.service.student; } // GET // 查询 async seek() { const res = await this.service.seek(this.ctx.query); this.ctx.ok({ ...res }); } // GET // 查询 async findbedroom() { const data = await this.service.findbedroom(this.ctx.query); this.ctx.ok({ data }); } async upjob() { const data = await this.service.upjob(this.ctx.request.body); this.ctx.ok({ data }); } // 删除学生班级 async deleteclass() { const data = await this.service.deleteclass(this.ctx.request.body); this.ctx.ok({ data }); } } module.exports = CrudController(StudentController, meta);