viper-app/cmd/inits/service.go

56 lines
1.0 KiB
Go
Raw Normal View History

package inits
import (
"demo-server/internal/config"
"demo-server/internal/service"
//"demo-server/internal/manager/kafka"
//"demo-server/internal/service"
//"demo-server/internal/service/group"
//"demo-server/internal/service/instance"
)
var (
svc *servicePolymer
)
type servicePolymer struct {
//group *group.Service
//instance *instance.Service
}
//
//func (s servicePolymer) GetGroupService() *group.Service {
// return s.group
//}
//
//func (s servicePolymer) GetInstanceService() *instance.Service {
// return s.instance
//}
//
//func (s servicePolymer) SetKafka(ka kafka.Manager) {
// s.GetInstanceService().SetKafka(ka)
// s.GetGroupService().SetKafka(ka)
//}
func GetSvcPolymer() service.Interface {
return svc
}
func initService() (err error) {
dp := getDaoPolymer()
conf := config.Get()
if dp == nil || conf == nil {
err = ErrorInitFundamental
return
}
svc = &servicePolymer{
//instance: instance.New(dp),
//group: group.New(dp),
}
//svc.group.SetISvc(svc.instance)
return
}