Refine the context and Try to fix the nil issue.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package rest
|
||||
|
||||
import (
|
||||
"github.com/eyebluecn/tank/code/core"
|
||||
"github.com/eyebluecn/tank/code/tool/util"
|
||||
"github.com/robfig/cron"
|
||||
"time"
|
||||
@ -21,27 +22,27 @@ func (this *DashboardService) Init() {
|
||||
this.Bean.Init()
|
||||
|
||||
//手动装填本实例的Bean. 这里必须要用中间变量方可。
|
||||
b := CONTEXT.GetBean(this.dashboardDao)
|
||||
b := core.CONTEXT.GetBean(this.dashboardDao)
|
||||
if b, ok := b.(*DashboardDao); ok {
|
||||
this.dashboardDao = b
|
||||
}
|
||||
|
||||
b = CONTEXT.GetBean(this.footprintDao)
|
||||
b = core.CONTEXT.GetBean(this.footprintDao)
|
||||
if b, ok := b.(*FootprintDao); ok {
|
||||
this.footprintDao = b
|
||||
}
|
||||
|
||||
b = CONTEXT.GetBean(this.matterDao)
|
||||
b = core.CONTEXT.GetBean(this.matterDao)
|
||||
if b, ok := b.(*MatterDao); ok {
|
||||
this.matterDao = b
|
||||
}
|
||||
|
||||
b = CONTEXT.GetBean(this.imageCacheDao)
|
||||
b = core.CONTEXT.GetBean(this.imageCacheDao)
|
||||
if b, ok := b.(*ImageCacheDao); ok {
|
||||
this.imageCacheDao = b
|
||||
}
|
||||
|
||||
b = CONTEXT.GetBean(this.userDao)
|
||||
b = core.CONTEXT.GetBean(this.userDao)
|
||||
if b, ok := b.(*UserDao); ok {
|
||||
this.userDao = b
|
||||
}
|
||||
|
Reference in New Issue
Block a user