import { IMiddleware } from '@midwayjs/core'; import { Middleware } from '@midwayjs/core'; import { NextFunction, Context } from '@midwayjs/koa'; @Middleware() export default class BookMiddleware implements IMiddleware { resolve() { return async (ctx: Context, next: NextFunction) => { console.log('in book middleware'); await next(); return 'ok'; }; } static getName() { return 'book_middleware'; } }