mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 03:07:45 +08:00
improve quote handling of table string for package gdb; improve rotation feature for package glog
This commit is contained in:
parent
495b5758ec
commit
6b7ea97777
@ -2,15 +2,18 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/frame/g"
|
||||
"github.com/gogf/gf/net/ghttp"
|
||||
)
|
||||
|
||||
func main() {
|
||||
g.DB().SetDebug(true)
|
||||
tx, err := g.DB().Begin()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
smsTaskInfo := "`sms_sys`.sms_task_info"
|
||||
m := tx.Table(smsTaskInfo)
|
||||
_, err = m.Where("`delete`=0 AND is_review_temp=1 AND UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(create_time)>=86400").Delete()
|
||||
//g.Server().Run()
|
||||
s := g.Server()
|
||||
s.BindHandler("/aaa", func(r *ghttp.Request) {
|
||||
r.Cookie.Set("theme", "default")
|
||||
r.Session.Set("name", "john")
|
||||
content := `Config:{{.Config.redis.cache}}, Cookie:{{.Cookie.theme}}, Session:{{.Session.name}}, Query:{{.Query.name}}`
|
||||
r.Response.WriteTplContent(content, nil)
|
||||
})
|
||||
s.SetPort(8199)
|
||||
s.Run()
|
||||
}
|
||||
|
@ -35,11 +35,11 @@ type Logger struct {
|
||||
}
|
||||
|
||||
const (
|
||||
gDEFAULT_FILE_FORMAT l.con = `{Y-m-d}.log`
|
||||
gDEFAULT_FILE_FLAGS = os.O_CREATE | os.O_WRONLY | os.O_APPEND
|
||||
gDEFAULT_FILE_PERM = os.FileMode(0666)
|
||||
gDEFAULT_FILE_EXPIRE = time.Minute
|
||||
gPATH_FILTER_KEY = "/os/glog/glog"
|
||||
gDEFAULT_FILE_FORMAT = `{Y-m-d}.log`
|
||||
gDEFAULT_FILE_FLAGS = os.O_CREATE | os.O_WRONLY | os.O_APPEND
|
||||
gDEFAULT_FILE_PERM = os.FileMode(0666)
|
||||
gDEFAULT_FILE_EXPIRE = time.Minute
|
||||
gPATH_FILTER_KEY = "/os/glog/glog"
|
||||
)
|
||||
|
||||
const (
|
||||
|
Loading…
Reference in New Issue
Block a user