card.js 552 B

1234567891011121314151617181920
  1. 'use strict';
  2. const meta = require('./.card.js');
  3. const Controller = require('egg').Controller;
  4. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  5. // card
  6. class CardController extends Controller {
  7. constructor(ctx) {
  8. super(ctx);
  9. this.service = this.ctx.service.card;
  10. }
  11. async group() {
  12. let { total, list } = await this.service.group(this.ctx.query);
  13. list = await this.ctx.service.set.changeName(list);
  14. this.ctx.ok({ data: list, total });
  15. }
  16. }
  17. module.exports = CrudController(CardController, meta);