go_dreamfactory/services/servicebase.go
2022-05-30 16:28:02 +08:00

23 lines
440 B
Go

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!")
}
}