document.js 705 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. const _ = require('lodash');
  3. const meta = require('./.document.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 积分归档
  7. class DocumentController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.document;
  11. }
  12. async create() {
  13. const res = await this.service.create();
  14. this.ctx.ok({ msg: 'created', data: res });
  15. }
  16. // GET
  17. // 查询
  18. async queryTeacher() {
  19. const res = await this.service.queryTeacher(this.ctx.query);
  20. this.ctx.ok({ ...res });
  21. }
  22. }
  23. module.exports = CrudController(DocumentController, meta);