mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
单例控制器增加SetRedis方法,TODO++
This commit is contained in:
1
TODO
1
TODO
@ -1,6 +1,7 @@
|
||||
ON THE WAY:
|
||||
1. 增加对于数据表Model的封装;
|
||||
2. ghttp.Server平滑重启方案;
|
||||
3. 更多数据库的ORM支持;
|
||||
|
||||
|
||||
DONE:
|
||||
|
||||
@ -61,6 +61,16 @@ func SetDatabase(v *gdb.Db, name...string) {
|
||||
instances.Set(dbCacheKey, v)
|
||||
}
|
||||
|
||||
// 自定义框架核心组件:Redis
|
||||
func SetRedis(v *gredis.Redis, name...string) {
|
||||
dbCacheKey := gFRAME_CORE_COMPONENT_NAME_REDIS
|
||||
if len(name) > 0 {
|
||||
dbCacheKey += name[0]
|
||||
}
|
||||
instances.Set(dbCacheKey, v)
|
||||
}
|
||||
|
||||
|
||||
// 核心对象:View
|
||||
func View() *gview.View {
|
||||
result := Get(gFRAME_CORE_COMPONENT_NAME_VIEW)
|
||||
|
||||
Reference in New Issue
Block a user