From 57bdec3c1d41e8799ee28ce7324d69f921684869 Mon Sep 17 00:00:00 2001 From: bandl <1658002533@qq.com> Date: Wed, 29 Sep 2021 21:21:45 +0800 Subject: [PATCH] feat(middleware): update middleware --- middleware/config/middle.gen.go | 4 ++-- middleware/config/middle.template | 4 ++-- middleware/define.go | 4 ++-- middleware/log-middle/middleware.go | 4 ++-- middleware/map-key/middleware.go | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/middleware/config/middle.gen.go b/middleware/config/middle.gen.go index 4f00352..6efac1e 100644 --- a/middleware/config/middle.gen.go +++ b/middleware/config/middle.gen.go @@ -10,9 +10,9 @@ import ( mapKey "gitee.com/timedb/wheatCache/middleware/map-key" ) -func GetMiddlewareMap() map[string]middleware.MiddlewareInterface { +func GetMiddlewareMap() map[string]middleware.MiddleToolsInterface { - return map[string]middleware.MiddlewareInterface{ + return map[string]middleware.MiddleToolsInterface{ "logMiddle": logMiddle.NewMiddleware(), "mapKey": mapKey.NewMiddleware(), diff --git a/middleware/config/middle.template b/middleware/config/middle.template index 4f8986f..5bcbc70 100644 --- a/middleware/config/middle.template +++ b/middleware/config/middle.template @@ -11,9 +11,9 @@ import ( ) -func GetMiddlewareMap() map[string]middleware.MiddlewareInterface { +func GetMiddlewareMap() map[string]middleware.MiddleToolsInterface { - return map[string]middleware.MiddlewareInterface{ + return map[string]middleware.MiddleToolsInterface{ {%for dir in dirs %} "{{dir[0]}}":{{dir[0]}}.NewMiddleware(), {%- endfor%} diff --git a/middleware/define.go b/middleware/define.go index c116927..376e5bc 100644 --- a/middleware/define.go +++ b/middleware/define.go @@ -1,6 +1,6 @@ package middleware -type MiddlewareInterface interface { +type MiddleToolsInterface interface { Init() - Exat(interface{}) (interface{}, error) + Exec(interface{}) (interface{}, error) } diff --git a/middleware/log-middle/middleware.go b/middleware/log-middle/middleware.go index 55478bc..386d87f 100644 --- a/middleware/log-middle/middleware.go +++ b/middleware/log-middle/middleware.go @@ -12,11 +12,11 @@ type A struct { func (i *A) Init() { } -func (i *A) Exat(interface{}) (interface{}, error) { +func (i *A) Exec(interface{}) (interface{}, error) { fmt.Println(1) return nil, nil } -func NewMiddleware() middleware.MiddlewareInterface { +func NewMiddleware() middleware.MiddleToolsInterface { return &A{} } diff --git a/middleware/map-key/middleware.go b/middleware/map-key/middleware.go index 1fffda6..3f33fba 100644 --- a/middleware/map-key/middleware.go +++ b/middleware/map-key/middleware.go @@ -12,11 +12,11 @@ type ABB struct { func (i *ABB) Init() { } -func (i *ABB) Exat(interface{}) (interface{}, error) { +func (i *ABB) Exec(interface{}) (interface{}, error) { fmt.Println(1) return nil, nil } -func NewMiddleware() middleware.MiddlewareInterface { +func NewMiddleware() middleware.MiddleToolsInterface { return &ABB{} }