//默认情况下路由和控制器是设置在一起的
type IndexClass struct {
}
func NewIndexClass() *IndexClass {
return &IndexClass{}
}
//这里就是设置路由的方法,必须有这个方法
func (this *IndexClass) Build(goft *goft.Goft) {
goft.HandleWithFairing("GET", "/",
this.GetIndex, fairing.NewIndexFairing()).
Handle("GET", "/users", this.TestUsers).
Handle("GET", "/users/:id", this.TestUserDetail).
Handle("GET", "/test", this.Test)
}
func (this *IndexClass) Name() string {
return "IndexClass"
}