student.js 545 B

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