!55 修改middle代码自动生成模板

Merge pull request !55 from Sodesnei/middle-template
This commit is contained in:
Sodesnei 2021-10-08 12:14:07 +00:00 committed by Gitee
commit 1540651864
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%}
}
}