forked from golang/hotime
37 lines
837 B
Go
37 lines
837 B
Go
package main
|
|
|
|
import (
|
|
. "code.hoteas.com/golang/hotime"
|
|
"code.hoteas.com/golang/hotime/example/app"
|
|
|
|
//. "code.hoteas.com/golang/hotime/common"
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
date, _ := time.Parse("2006-01-02 15:04", time.Now().Format("2006-01-02")+" 14:00")
|
|
fmt.Println(date, date.Unix())
|
|
//fmt.Println("0123456"[1:7])
|
|
appIns := Init("config/config.json")
|
|
//a:=Map{}
|
|
//a.GetBool()
|
|
appIns.SetConnectListener(func(that *Context) (isFinished bool) {
|
|
that.Session("admin_id", 1)
|
|
//if len(that.RouterString) == 3 {
|
|
// if that.HandlerStr == "/app/hotime/test" {
|
|
// that.Session("admin_id", 1)
|
|
// that.Display(0, "开始测试")
|
|
// return true
|
|
// }
|
|
//}
|
|
return isFinished
|
|
})
|
|
//appIns.Db.Action(func(db db.HoTimeDB) (isSuccess bool) {
|
|
// return isSuccess
|
|
//})
|
|
appIns.Run(Router{
|
|
"app": app.Project,
|
|
})
|
|
}
|