框架优化

This commit is contained in:
hoteas
2022-03-13 17:02:19 +08:00
parent e426c285b0
commit cb0bcdb2d1
8 changed files with 96 additions and 66 deletions
+16 -3
View File
@@ -1,7 +1,7 @@
package main
import (
"code.hoteas.com/golang/hotime"
. "code.hoteas.com/golang/hotime"
//. "code.hoteas.com/golang/hotime/common"
"fmt"
"time"
@@ -11,8 +11,21 @@ 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 := hotime.Init("config/config.json")
appIns := Init("config/config.json")
//a:=Map{}
//a.GetBool()
appIns.Run(hotime.Router{})
appIns.SetConnectListener(func(that *Context) (isFinished bool) {
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{})
}