hotime/example/main.go
2022-07-11 11:07:17 +08:00

28 lines
590 B
Go

package main
import (
. "code.hoteas.com/golang/hotime"
. "code.hoteas.com/golang/hotime/common"
"fmt"
)
func main() {
appIns := Init("config/config.json")
appIns.Run(Router{"app": Proj{
"user": Ctr{
"test": func(that *Context) {
fmt.Println("dasdasd")
id := that.Db.Insert("user", Map{"name": "test"})
ok := that.Db.Update("user", Map{"name": "test1"}, Map{"name": "test"})
ps := that.Db.Select("user", "*")
p := that.Db.Get("user", "*")
row := that.Db.Delete("user", Map{"id": id})
that.Display(0, Slice{id, ok, ps, p, row})
},
},
},
})
}