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