student.js 687 B

12345678910111213141516171819202122232425262728293031
  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. }
  25. module.exports = CrudController(StudentController, meta);