expert.js 506 B

1234567891011121314151617
  1. 'use strict';
  2. const meta = require('./.expert.js');
  3. const Controller = require('egg').Controller;
  4. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  5. // 专家
  6. class ExpertController extends Controller {
  7. constructor(ctx) {
  8. super(ctx);
  9. this.service = this.ctx.service.users.expert;
  10. }
  11. async index() {
  12. const { data, total } = await this.service.query(this.ctx.query);
  13. this.ctx.ok({ data, total });
  14. }
  15. }
  16. module.exports = CrudController(ExpertController, meta);