core: flow: support handler/:action/:name#:method

pull/490/head
undefined 2 years ago
parent 94244cb55f
commit 361e1c9b1c

@ -254,16 +254,18 @@ async function handle(ctx: KoaContext, HandlerClass, checker) {
const name = HandlerClass.name.replace(/Handler$/, ''); const name = HandlerClass.name.replace(/Handler$/, '');
const steps = [ const steps = [
'init', 'handler/init', `handler/before-prepare/${name}`, 'handler/before-prepare', 'init', 'handler/init',
'log/__prepare', '__prepare', '_prepare', 'prepare', `handler/before-prepare/${name}#${method}`, `handler/before-prepare/${name}`, 'handler/before-prepare',
'log/__prepareDone', `handler/before/${name}`, 'handler/before', 'log/__prepare', '__prepare', '_prepare', 'prepare', 'log/__prepareDone',
`handler/before/${name}#${method}`, `handler/before/${name}`, 'handler/before',
'log/__method', 'all', method, 'log/__methodDone', 'log/__method', 'all', method, 'log/__methodDone',
...operation ? [ ...operation ? [
`handler/before-operation/${name}`, 'handler/before-operation', `handler/before-operation/${name}`, 'handler/before-operation',
`post${operation}`, 'log/__operationDone', `post${operation}`, 'log/__operationDone',
] : [], 'after', ] : [], 'after',
`handler/after/${name}`, 'handler/after', 'cleanup', `handler/after/${name}#${method}`, `handler/after/${name}`, 'handler/after',
`handler/finish/${name}`, 'handler/finish', 'cleanup',
`handler/finish/${name}#${method}`, `handler/finish/${name}`, 'handler/finish',
]; ];
let current = 0; let current = 0;

Loading…
Cancel
Save