package services import ( "fmt" "go_dreamfactory/sys/cache" "github.com/liwei1dao/lego/base/rpcx" "github.com/liwei1dao/lego/sys/log" ) type ServiceBase struct { rpcx.RPCXService } func (this *ServiceBase) InitSys() { this.RPCXService.InitSys() if err := cache.OnInit(this.GetSettings().Sys["cache"]); err != nil { panic(fmt.Sprintf("init sys.cache err: %s", err.Error())) } else { log.Infof("init sys.cache success!") } }