路由写在一个文件里
type RouterConfig struct {
Goft *goft.Goft `inject:"-"`
IndexClass *classes.IndexClass `inject:"-"`
}
func NewRouterConfig() *RouterConfig {
return &RouterConfig{}
}
func (this *RouterConfig) IndexRoutes() interface{} {
this.Goft.Handle("GET", "/a", this.IndexClass.TestA)
this.Goft.Handle("GET", "/b", this.IndexClass.TestA)
this.Goft.Handle("GET", "/void", this.IndexClass.IndexVoid)
return goft.Empty
}注册路由
最后更新于