successfully run facade
This commit is contained in:
@@ -16,4 +16,7 @@ import (
|
||||
// Register register routes based on the IDL 'api.${HTTP Method}' annotation.
|
||||
func Register(r *server.Hertz) {
|
||||
|
||||
root := r.Group("/", rootMw()...)
|
||||
root.POST("/login", append(_loginMw(), facade.Login)...)
|
||||
root.POST("/register", append(_registerMw(), facade.Register)...)
|
||||
}
|
||||
|
||||
@@ -5,3 +5,18 @@ package facade
|
||||
import (
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
func rootMw() []app.HandlerFunc {
|
||||
// your code...
|
||||
return nil
|
||||
}
|
||||
|
||||
func _loginMw() []app.HandlerFunc {
|
||||
// your code...
|
||||
return nil
|
||||
}
|
||||
|
||||
func _registerMw() []app.HandlerFunc {
|
||||
// your code...
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user