student.js 955 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.student.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 学生管理
  7. class StudentController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.student;
  11. }
  12. // GET
  13. // 查询
  14. async seek() {
  15. const res = await this.service.seek(this.ctx.query);
  16. this.ctx.ok({ ...res });
  17. }
  18. // GET
  19. // 查询
  20. async findbedroom() {
  21. const data = await this.service.findbedroom(this.ctx.query);
  22. this.ctx.ok({ data });
  23. }
  24. async upjob() {
  25. const data = await this.service.upjob(this.ctx.request.body);
  26. this.ctx.ok({ data });
  27. }
  28. // 删除学生班级
  29. async deleteclass() {
  30. const data = await this.service.deleteclass(this.ctx.request.body);
  31. this.ctx.ok({ data });
  32. }
  33. }
  34. module.exports = CrudController(StudentController, meta);