'use strict'; const meta = require('./config/.goods.js'); const Controller = require('egg').Controller; const { CrudController } = require('naf-framework-mongoose-free/lib/controller'); // class GoodsController extends Controller { constructor(ctx) { super(ctx); this.service = this.ctx.service.view.goods; } async indexGoodsList() { const { skip, limit } = this.ctx.query; const { list, total } = await this.service.indexGoodsList(this.ctx.query, { skip, limit }); this.ctx.ok({ data: list, total }); } } module.exports = CrudController(GoodsController, meta);