2018-08-19 11:25:15 +08:00
|
|
|
// 路由重复注册检查 - object
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2019-07-29 21:01:19 +08:00
|
|
|
"github.com/gogf/gf/frame/g"
|
|
|
|
|
"github.com/gogf/gf/net/ghttp"
|
2018-08-19 11:25:15 +08:00
|
|
|
)
|
|
|
|
|
|
2019-04-03 00:03:46 +08:00
|
|
|
type Object struct{}
|
2018-08-19 11:25:15 +08:00
|
|
|
|
|
|
|
|
func (o *Object) Index(r *ghttp.Request) {
|
2019-04-03 00:03:46 +08:00
|
|
|
r.Response.Write("object index")
|
2018-08-19 11:25:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (o *Object) Show(r *ghttp.Request) {
|
2019-04-03 00:03:46 +08:00
|
|
|
r.Response.Write("object show")
|
2018-08-19 11:25:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func main() {
|
2019-04-03 00:03:46 +08:00
|
|
|
s := g.Server()
|
|
|
|
|
g.Server().BindObject("/object", new(Object))
|
|
|
|
|
g.Server().BindObject("/object", new(Object))
|
|
|
|
|
s.SetPort(8199)
|
|
|
|
|
s.Run()
|
|
|
|
|
}
|