mirror of
https://gitee.com/johng/gf
synced 2026-06-27 09:47:19 +08:00
26 lines
454 B
Go
26 lines
454 B
Go
// 路由重复注册检查 - object
|
|
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/g"
|
|
"github.com/gogf/gf/g/net/ghttp"
|
|
)
|
|
|
|
type Object struct{}
|
|
|
|
func (o *Object) Index(r *ghttp.Request) {
|
|
r.Response.Write("object index")
|
|
}
|
|
|
|
func (o *Object) Show(r *ghttp.Request) {
|
|
r.Response.Write("object show")
|
|
}
|
|
|
|
func main() {
|
|
s := g.Server()
|
|
g.Server().BindObject("/object", new(Object))
|
|
g.Server().BindObject("/object", new(Object))
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
}
|