添加测试文件

This commit is contained in:
john
2018-10-26 11:02:15 +08:00
parent 7b07443c14
commit 77b317f182
3 changed files with 35 additions and 11 deletions

View File

@ -1,17 +1,24 @@
package main
import (
"fmt"
"gitee.com/johng/gf/g/container/gtype"
"gitee.com/johng/gf/g/frame/gmvc"
"gitee.com/johng/gf/g/net/ghttp"
)
func test() {
defer fmt.Println(1)
fmt.Println(2)
type ControllerIndex struct {
gmvc.Controller
}
func (c *ControllerIndex) Info() {
c.View.Assign("title", "Go Frame 第一个网站")
c.View.Assigns(map[string]interface{}{
"name" : "很开心",
"score" : 100,
})
c.View.Display("web/index.html")
}
func main() {
v := gtype.NewInt(1)
fmt.Println(v.Set(2))
fmt.Println(v.Set(2))
}
s := ghttp.GetServer()
s.SetServerRoot("/home/john/Workspace/Go/GOPATH/src/gitee.com/johng/gf/geg/other/web/")
s.BindController("/", new(ControllerIndex))
s.SetPort(8199)
s.Run()
}

16
geg/other/test2.go Normal file
View File

@ -0,0 +1,16 @@
package main
import (
"gitee.com/johng/gf/g/os/gcron"
"gitee.com/johng/gf/g/os/glog"
"gitee.com/johng/gf/g/os/gtime"
)
func main() {
start := gtime.Second()
gcron.Add("*/5 * * * * ?", func() {
glog.Println(gtime.Second() - start)
})
select{}
}

1
geg/other/web/index.html Normal file
View File

@ -0,0 +1 @@
123456789