diff --git a/LICENSE b/LICENSE index 74c8b0933..f9919b67b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 john@johng.cn +Copyright (c) 2017 john@johng.cn http://johng.cn Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.MD b/README.MD index 57eb5f70a..3dfa4b61d 100644 --- a/README.MD +++ b/README.MD @@ -7,7 +7,7 @@ go get -u gitee.com/johng/gf ## 使用 ```go -import "gitee.com/johng/gf/g/xxx" +import "gitee.com/johng/gf/g/xxx/xxx" ``` ## 说明 diff --git a/g/encoding/gjson/json.go b/g/encoding/gjson/json.go index 9ef2c0090..dcb7d69fb 100644 --- a/g/encoding/gjson/json.go +++ b/g/encoding/gjson/json.go @@ -103,6 +103,15 @@ func (p *Json) GetMap(pattern string) map[string]interface{} { return nil } +// 将检索值转换为Json对象指针返回 +func (p *Json) GetJson(pattern string) *Json { + result := p.Get(pattern) + if result != nil { + return &Json{&result} + } + return nil +} + // 获得一个数组[]interface{},方便操作,不需要自己做类型转换 // 注意,如果获取的值不存在,或者类型与json类型不匹配,那么将会返回nil func (p *Json) GetArray(pattern string) []interface{} { diff --git a/g/frame/gbase/gbase.go b/g/frame/gbase/gbase.go index 3445aed1e..d468abc99 100644 --- a/g/frame/gbase/gbase.go +++ b/g/frame/gbase/gbase.go @@ -3,14 +3,10 @@ package gbase import ( "gitee.com/johng/gf/g/os/gfile" + "gitee.com/johng/gf/g/os/gconsole" "gitee.com/johng/gf/g/database/gdb" "gitee.com/johng/gf/g/frame/gconfig" "gitee.com/johng/gf/g/frame/ginstance" - "gitee.com/johng/gf/g/os/gconsole" -) - -const ( - gDEFAULT_CONFIG_FILE = "config.json" // 默认读取的配置文件名称 ) // 框架基类,所有的基于gf框架的类对象都继承于此,以便使用框架的一些封装的核心组件