1234567891011121314151617181920 |
- 'use strict';
- const meta = require('./.card.js');
- const Controller = require('egg').Controller;
- const { CrudController } = require('naf-framework-mongoose/lib/controller');
- // card
- class CardController extends Controller {
- constructor(ctx) {
- super(ctx);
- this.service = this.ctx.service.card;
- }
- async group() {
- let { total, list } = await this.service.group(this.ctx.query);
- list = await this.ctx.service.set.changeName(list);
- this.ctx.ok({ data: list, total });
- }
- }
- module.exports = CrudController(CardController, meta);
|