Ready to refine the context and router bean.

This commit is contained in:
zicla
2019-04-27 23:36:50 +08:00
parent 02805363ac
commit 76a544fb1f
9 changed files with 43 additions and 30 deletions

11
code/core/controller.go Normal file
View File

@ -0,0 +1,11 @@
package core
import "net/http"
type IController interface {
IBean
//注册自己固定的路由。
RegisterRoutes() map[string]func(writer http.ResponseWriter, request *http.Request)
//处理一些特殊的路由。
HandleRoutes(writer http.ResponseWriter, request *http.Request) (func(writer http.ResponseWriter, request *http.Request), bool)
}