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