add GET
This commit is contained in:
parent
9df516247c
commit
ba9357e166
6
api.go
6
api.go
@ -54,6 +54,12 @@ func (e *Engine) POST(uri string, handler Handler) {
|
|||||||
e.Engine.POST(uri, h)
|
e.Engine.POST(uri, h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e *Engine) GET(uri string, handler Handler) {
|
||||||
|
h := handlerWrapper(handler)
|
||||||
|
log.Infof("api handler [%v] registor success", handler)
|
||||||
|
e.Engine.GET(uri, h)
|
||||||
|
}
|
||||||
|
|
||||||
// handlerWrapper
|
// handlerWrapper
|
||||||
func handlerWrapper(handler Handler) gin.HandlerFunc {
|
func handlerWrapper(handler Handler) gin.HandlerFunc {
|
||||||
handlerFunc := handler.HandlerFunc()
|
handlerFunc := handler.HandlerFunc()
|
||||||
|
Loading…
Reference in New Issue
Block a user