'use strict'; const meta = require('./config/.question.js'); const Controller = require('egg').Controller; const { CrudController } = require('naf-framework-mongoose-free/lib/controller'); // 调研考察 class QuestionController extends Controller { constructor(ctx) { super(ctx); this.service = this.ctx.service.news.question; } async index() { const { data = [], total = 0 } = await this.service.query(this.ctx.query); this.ctx.ok({ data, total }); } } module.exports = CrudController(QuestionController, meta);