fix(middle-template): update middle template

This commit is contained in:
Sodesnei 2021-10-08 20:11:13 +08:00
parent 63bd44da44
commit 166d1f20c1
2 changed files with 8 additions and 4 deletions

View File

@ -12,9 +12,11 @@ import (
func GetMiddlewareMap() map[string]plugins.MiddleToolsInterface {
logMiddle := logMiddle.NewMiddleware()
mapKey := mapKey.NewMiddleware()
return map[string]plugins.MiddleToolsInterface{
"logMiddle": logMiddle.NewMiddleware(),
"mapKey": mapKey.NewMiddleware(),
logMiddle.Name(): logMiddle,
mapKey.Name(): mapKey,
}
}

View File

@ -12,10 +12,12 @@ import (
func GetMiddlewareMap() map[string]plugins.MiddleToolsInterface {
{%for dir in dirs %}
{{dir[0]}}:={{dir[0]}}.NewMiddleware()
{%- endfor%}
return map[string]plugins.MiddleToolsInterface{
{%for dir in dirs %}
"{{dir[0]}}":{{dir[0]}}.NewMiddleware(),
{{dir[0]}}.Name():{{dir[0]}},
{%- endfor%}
}
}