'use strict'; const Controller = require('egg').Controller; const { CrudController } = require('naf-framework-mongoose/lib/controller'); // 拦截 class InterceptController extends Controller { constructor(ctx) { super(ctx); this.service = this.ctx.service.intercept; } async get() { const res = await this.service.getDeal(); this.ctx.body = res; } async post() { const res = await this.service.postDeal(); this.ctx.body = res; } async delete() { const res = await this.service.deleteDeal(); this.ctx.body = res; } async freeWeb() { const res = await this.service.freeWebCount(); this.ctx.body = res; } } module.exports = CrudController(InterceptController, {});