'use strict'; const Controller = require('egg').Controller; class MenuController extends Controller { async create() { const { ctx } = this; const res = await ctx.service.menu.create(ctx.request.body); ctx.body = res; } async update() { const { ctx } = this; const res = await ctx.service.menu.update(ctx.request.body); ctx.body = res; } async del() { const { ctx } = this; const res = await ctx.service.menu.del(ctx.params); ctx.body = res; } async query() { const { ctx } = this; const res = await ctx.service.menu.query(ctx.query); ctx.body = res; } } module.exports = MenuController;